0

When running this Bulk V2 query in Postman I get the following error. Query: SELECT Id FROM Attachment WHERE ParentId = XXX

Error: "errorCode": "INVALIDJOB", "message": "Attachment is not a supported object"

But I am able to run the same query in the workbench without an issue.

What I try to achieve is getting the attached PDF from an email message.

Thank you very much for the help!

1
  • 1
    It looks like loading of data into Attachment is allowed in Bulk V1 but not in V2. See doc & doc May 30, 2023 at 10:58

1 Answer 1

0

Bulk API 2.0 uploads do not currently support entities with binary fields, such as Attachment and ContentVersion. Loading of data into Attachment is allowed in Bulk V1 but not in V2.

It appears intentional that the bulk API v2 doesn't support attachments, mainly due to the payload limits. I think the payload is limited to 50m, so this limit would prevent you from uploading any single attachment >50MB or even >50 attachments that are 1MB each.

The workaround is basically to use Bulk V1, SOAP or REST to retrieve the Attachment records.

  • Bulk V1 API

  • You can use the multipart REST API request to upload large blob data.You can either upload a single or collection of files.

  • Incase of SOAP API, you just need to make sure the data is base64-encoded, then assign it to the VersionData field when calling SOAP create().

1
  • 1
    Thanks a lot Swetha! This helped me a lot. We now use Bulk V1 to get the data for the Attachments.
    – Michael SF
    Jun 9, 2023 at 9:28

You must log in to answer this question.

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