Get Information About a Query Job
Gets information about one 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: Bearer token
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 "isPkChunkingSupported": true
19}Response Parameters:
| Parameter | Type | Description |
|---|---|---|
| id | string | The unique ID for this job. |
| operation | OperationEnum | The type of query. Possible values are:
|
| object | string | The object type being queried. |
| createdById | string | The ID of the user who created the job. |
| createdDate | dateTime | The UTC date and time when the job was created. |
| systemModstamp | dateTime | The UTC date and time when the API last updated the job information. |
| state | JobStateEnum |
The current state of processing for the job. Possible values are:
|
| concurrencyMode | ConcurrencyModeEnum | Reserved for future use. How the request is processed. Currently only parallel mode is supported. (When other modes are added, the API chooses the mode automatically. The mode isn’t user configurable.) |
| contentType | ContentType | The format that is used for the results. Currently the only supported value is CSV. |
| apiVersion | string | The API version that the job was created in. |
| jobType | JobTypeEnum | The job’s type. For a query job, the type is always V2Query. |
| lineEnding | LineEndingEnum | The line ending used for CSV job data, marking the end of a data
row. The default is LF.
Possible values are:
|
| columnDelimiter | ColumnDelimiterEnum | The column delimiter used for CSV job data. The default value is
COMMA. Possible values are:
|
| numberRecordsProcessed | long | The number of records processed in this job. |
| retries | int | The number of times that Salesforce attempted to save the results of an operation. Repeated attempts indicate a problem such as a lock contention. |
| totalProcessingTime | long | The number of milliseconds taken to process the job. |
| isPkChunkingSupported | boolean | Whether PK chunking is supported for the queried object (true), or isn't supported (false). |
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}]For details about error codes and messages, see Errors.
Example
This example gets information about the job with ID 750R0000000zxikIAA:
1curl --include --request GET \
2--header "Authorization: Bearer token" \
3"https://instance.salesforce.com/services/data/vXX.X/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 "isPkChunkingSupported": true
19}