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.

2

1 Answer 1

1

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.

5
  • Do you know if you can use v47.0 version if your Salesforce org is currently lower than that? For example, 45.0 using 47.0 Rest API?
    – Coova
    Apr 20, 2020 at 19:37
  • No but currently all the orgs should be on 51.0 Mar 12, 2021 at 21:08
  • 1
    The link is not relevant. Bulk API 2.0 does not give you batch count.
    – kratos
    Jul 16, 2021 at 19:19
  • 1
    Thanks @kratos. Funny enough, I guess I got smarter in the year as I answered your question right but got this one wrong. Updated it to reflect correct information. Jul 16, 2021 at 19:53
  • @KrisGoncalves Thank you. I upvoted the answer again;)
    – kratos
    Jul 28, 2021 at 13:46

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .