I am currently using Bulk API 2.0 to insert, update and delete data in Salesforce.
What I am confused about is uploading more than 1 batch of CSV records to a job before it is closed?
I create a Bulk API 2 job, I can then upload to that job once, but I cannot upload a second batch of data to the same job id. The examples do not show a second batch of data being uploaded to the same job id but the REST API suggests it can be done by :
- having a URL that ends with the word batches and not batch singular i.e. services/data/v44.0/jobs/ingest/jobid/batches
- having a separate PATCH (for URL services/data/v44.0/jobs/ingest/jobid) method to mark the job as complete. If you weren't expecting more batches of CSV data to be uploaded why not mark the job as complete automatically and dispense with this API call.
Is it possible to upload multiple batches to the same Job ID?