1

I have been trying to upload a csv via the the Bulk API V2. Attached is a screenshot of my issue as such.

Everything seems to go fine, except when processing the batches every single record fails. The issue is that it does not show me what the failed results are. This is only for custom objects. For standard objects such as Contacts, I have no issues with being able to retrieve the failed records. TIA!

Salesforce issue with Bulk API V2

1 Answer 1

5

To find out why these records are failing, use the API documented here

Once you have the jobId you can use invoke the REST API below

/services/data/vXX.X/jobs/ingest/jobID/failedResults/

This will return the below fields in the response,

sf__Error, sf__Id, Fields from the original CSV request data

This will tell you why these jobs failed. It could be due to validation rules or any other reason

Update

From the comments looks like for the version number V is used in the URL instead of v

The URL needs to be in below form

/services/data/v51.0/jobs/ingest/<jobID>/failedResults/

9
  • I should have mentioned this in my OP. I have tried this and it returns the following result: [{"errorCode":"NOT_FOUND","message":"The requested resource does not exist"}] Commented Apr 20, 2021 at 22:25
  • Can you screenshot the error? Commented Apr 20, 2021 at 23:00
  • The error is exactly as above that appears in the CLI, that is what I get when I query the failed results endpoint above Commented Apr 23, 2021 at 0:16
  • Sorry I was wondering if you could share the full url you are trying to invoke? Commented Apr 23, 2021 at 0:18
  • 1
    Awesome that has fixed it. Something so simple.... Thanks for your help Mohith! :) Commented Apr 23, 2021 at 3:02

You must log in to answer this question.

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