Get Information About a Query Job
Syntax
- URI
- /services/data/vXX.X/jobs/query/queryJobId
- Available since release
-
This resource is available in API version 47.0 and later.
- Formats
- JSON
- HTTP methods
- GET
- Authentication
- Authorization: OAuth sessionId
- Request parameters
-
Parameter Description Required or Optional queryJobId The ID of the query job. Required - Response Body
-
1{ 2 "id" : "750R0000000zlh9IAA", 3 "operation" : "query", 4 "object" : "Account", 5 "createdById" : "005R0000000GiwjIAC", 6 "createdDate" : "2018-12-10T17:50:19.000+0000", 7 "systemModstamp" : "2018-12-10T17:51:27.000+0000", 8 "state" : "JobComplete", 9 "concurrencyMode" : "Parallel", 10 "contentType" : "CSV", 11 "apiVersion" : 46.0, 12 "jobType" : "V2Query", 13 "lineEnding" : "LF", 14 "columnDelimiter" : "COMMA", 15 "numberRecordsProcessed" : 500, 16 "retries" : 0, 17 "totalProcessingTime" : 334 18} - Response Parameters
-
Parameter Description id The unique ID for this job. operation The type of query. Possible values are: - query—Returns data that has not been deleted or archived. For more information, see query() in the SOAP API Developer Guide.
- queryAll—Returns records that have been deleted because of a merge or delete, and returns information about archived Task and Event records. For more information, see queryAll() in the SOAP API Developer Guide.
object The object type being queried. For example: Account. If this is not specified, the API determines the object from the query. createdById The ID of the user who created the job. createdDate The UTC date and time when the job was created. systemModstamp The UTC date and time when the API last updated the job information. state The current state of processing for the job. Possible values are:- UploadComplete—All job data has been uploaded and the job is ready to be processed. Salesforce has put the job in the queue.
- InProgress—Salesforce is processing the job.
- Aborted—The job has been aborted. See Abort a Query Job.
- JobComplete—Salesforce has finished processing the job.
-
Failed—The job failed.
concurrencyMode Reserved for future use. How the request is processed. Currently only parallel mode is supported. (When other modes are added, the API will choose the mode automatically. The mode will not be user configurable.) contentType The format that is used for the results. Currently the only supported value is CSV. apiVersion The API version that the job was created in. lineEnding The line ending used for CSV job data, marking the end of a data row. The default is LF. Possible values are: - LF—linefeed character
- CRLF—carriage return character followed by a linefeed character
columnDelimiter The column delimiter used for CSV job data. The default value is COMMA. Possible values are: - BACKQUOTE—backquote character (`)
- CARET—caret character (^)
- COMMA—comma character (,)
- PIPE—pipe character (|)
- SEMICOLON—semicolon character (;)
- TAB—tab character
numberRecordsProcessed The number of records processed in this job. retries The number of times that Salesforce attempted to save the results of an operation. Repeated attempts indicate a problem such as a lock contention. - Response Body - For an Unsuccessful Request
- If the request fails, the server returns a non-200 status, and the request body shows details of the error. For example, if the job has been deleted the status is 404 (Not Found) and
the response body is:
1[{ 2 "errorCode": "NOT_FOUND", 3 "message": "The requested resource does not exist" 4}]
Example
This example gets information about the job with ID 750R0000000zxikIAA:
1curl --include --request GET \
2--header "Authorization: OAuth 00DR00000000nd2aAQ8AQORpU.gf72HWKXAOkAcjOhYvBfvXiqgkMcERVkxSauharjcilr8BxJRjou
3E5mopL2TvHflPMtRd4.FFl63Yuq5pmhPaa1" \
4"https://instance.salesforce.com/services/data/v46.0/jobs/query/750R0000000zxikIAAThe response
is:
1{
2 "id" : "750R0000000zxikIAA",
3 "operation" : "query",
4 "object" : "Account",
5 "createdById" : "005R0000000GiwjIAC",
6 "createdDate" : "2018-12-18T22:51:36.000+0000",
7 "systemModstamp" : "2018-12-18T22:51:58.000+0000",
8 "state" : "JobComplete",
9 "concurrencyMode" : "Parallel",
10 "contentType" : "CSV",
11 "apiVersion" : 46.0,
12 "jobType" : "V2Query",
13 "lineEnding" : "LF",
14 "columnDelimiter" : "COMMA",
15 "numberRecordsProcessed" : 740003,
16 "retries" : 0,
17 "totalProcessingTime" : 21046
18}