Newer Version Available
Get Parallel Results for a Query Job
Returns up to five URIs in one response to use to get results for a query job. The job
must have the state jobComplete.
Syntax
- URI
- /services/data/vXX.X/jobs/query/queryJobId/resultPages
- Available since release
-
This resource is available in API version 58.0 and later.
- Formats
- JSON
- HTTP Methods
- GET
- Authentication
- Authorization: Bearer token
- Request Parameters
-
Parameter Description Required or Optional queryJobId The ID of the query job. The ID is retrieved when you create the query job. Required
Response Body with Request Parameters
The JSON response body contains multiple request URIs that you use to request data in parallel.
| Element | Description |
|---|---|
| resultPages | Contains the resultUrl URIs. |
| resultUrl | The request URI with the locator for getting data. |
| nextRecordUrl | The URI used to get a response body with the next resultPages element. |
| done | A Boolean value that indicates whether more resultUrl URIs are available. |
Example
This example retrieves the results for a job with the ID 750R0000000zxr8IAA. We start by sending an initial request to retrieve the first set of result links.
- Example Request
-
1curl --include --request GET \ 2--header "Authorization: Bearer token" \ 3--header "Accept: application/json" \ 4https://MyDomainName.my.salesforce.com\ 5/services/data/vXX.X/jobs/query/750R0000000zxr8IAA/resultPages - Example Response Body
-
1 2 { 3 "resultPages": [ 4 { 5 "resultUrl": "/services/data/vXX.X/jobs/query/750R0000000zxr8IAA/results?locator=aBcDeFg4N" 6 }, 7 { 8 "resultUrl": "/services/data/vXX.X/jobs/query/750R0000000zxr8IAA/results?locator=HiJkLmN4N" 9 }, 10 { 11 "resultUrl": "/services/data/vXX.X/jobs/query/750R0000000zxr8IAA/results?locator=oPQrStU4N" 12 }, 13 { 14 "resultUrl": "/services/data/vXX.X/jobs/query/750R0000000zxr8IAA/results?locator=vWxYzz4N" 15 }, 16 { 17 "resultUrl": "/services/data/vXX.X/jobs/query/750R0000000zxr8IAA/results?locator=NiKmABC4N" 18 } 19 ], 20 "nextRecordsUrl": "/services/data/vXX.X/jobs/query/750R0000000zxr8IAA/resultpages?locator=YcApWm4N", 21 "done": false 22} 23
The value of nextRecordsUrl is the URI for getting the next set of resultUrl URIs. The value of done is true if there are no more resultUrl URIs. The value of each resultUrl is a URI that you send as a request to get a set of results.