Step 6: Query Jobs
This Bulk API 2.0 example shows you how to create a query job, monitor its progress, and get the job results.
-
Create the job.
URI
Example of creating a bulk query job
The response includes the job
idand shows the job’s state asUploadComplete. (You use the jobidto monitor the job or get its results.)Example response body
-
Monitor the job’s state using the returned job
id.URI
Example of monitoring the state of the query job
Example response body
The response shows the current state of the job. Repeat this step until the state is
JobComplete. -
Get the results of the job.
URI
Example of getting the results of the job
The response shows the results of the SOQL query when you created the query job.
Example response body
This example returns a small result set, and it’s easy to see the complete results. Queries that return larger results spread them across a sequence of result sets. To see the other result sets, use the locator to fetch the next set of results. For more information, see Get Results for a Query Job.