Newer Version Available
Get Attachment Content from a Record
Use the sObject Blob Retrieve resource to retrieve blob data for a given record.
The following example retrieves the blob data for an Attachment record. The Attachment can be associated with a Case, Campaign, or other object that allows attachments.
- Example for retrieving blob body for an Attachment record
-
1curl https://yourInstance.salesforce.com/services/data/v52.0/sobjects/Attachment/001D000000INjVe/body -H "Authorization: Bearer token" - Example request body
- none required
- Example response body
- Attachment body content is returned in binary form. Note that the response content type will not be JSON or XML since the returned data is binary.
The following example retrieves the blob data for a Document record.
- Example for retrieving blob body for a Document record
-
1curl https://yourInstance.salesforce.com/services/data/v52.0/sobjects/Document/015D0000000NdJOIA0/body -H "Authorization: Bearer token" - Example request body
- none required
- Example response body
- Document body content is returned in binary form. Note that the response content type will not be JSON or XML since the returned data is binary.