[SalesForce] how to query job batches info bulk api 2.0

Before, using bulk api 1.0 endpoint. I could make request to get all job's batches like so: `

req.setEndpoint('callout:BulkApi' + '/' + jobId + '/batch');
req.setMethod('GET');
req.setHeader('Content-Type', 'application/json; charset=UTF-8');
req.setHeader('X-SFDC-Session', getAccessToken());

HttpResponse res = httpInstance.send(req);`

Is there anyway to do it with bulk api 2.0? I know the url is different however, in documentation there is no trace of similar 'batch' endpoint so I am wondering how can I retrieve batches info for job created using bulk api 2.0

For any help, directions I would be really grateful.

Best Answer

As was pointed out, previous answer and link in comment to the question was only relevant to Bulk API 1.0. You can see where I got this right in the following question.

In short, Bulk API 2.0 does not provide a way to get batch info as it now auto-batches for you.

Salesforce provides an additional API, Bulk API 2.0, which uses the REST API framework to provide similar capabilities to Bulk API. Bulk API 2.0 removes the need for creating and monitoring batches, and lets you load record data for a job directly.

Related Topic