Get a contact attachment
Scope: contacts:contacts.read https://api.alladdin.com/api/v2/contacts/{contactId}/attachments/{filename}
Downloads a single attachment from a contact.
The response body contains the raw file bytes. Use the Content-Disposition header to obtain the original file name.
Parameters
Path parameters
contactId string required
Contact ID (24-char hex ObjectId)
filename string required
Attachment file name (case-insensitive match)
Request
import requests
url = "https://api.alladdin.com/api/v2/contacts/{contactId}/attachments/{filename}"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.get(url, headers=headers)
print(response.json())Responses
Response
"string"Success responses
200 File binary content. The Content-Type header reflects the actual mime type of the stored file (e.g. image/png, application/pdf); files with no identifiable type are served as application/octet-stream. application/octet-stream string<binary>
Error responses
401 Invalid or missing API key application/json 403 Insufficient permissions application/json 404 Contact or attachment not found application/json 429 Rate limit exceeded application/json
