Get purchase attachment
Scope: accounting:purchases.read https://api.alladdin.com/api/v2/purchases/{purchaseId}/attachments/{attachmentId}
Downloads a specific attachment from a purchase. The response contains the raw binary content of the file.
Parameters
Path parameters
purchaseId string required
Purchase ID (24-char hex ObjectId)
attachmentId string required
Attachment identifier (filename)
Request
import requests
url = "https://api.alladdin.com/api/v2/purchases/{purchaseId}/attachments/{attachmentId}"
headers = {
"Authorization": "Bearer YOUR_API_KEY",
"Accept": "application/json",
}
response = requests.get(url, headers=headers)
print(response.json())Responses
Response
"string"Success responses
200 Attachment binary content application/octet-stream string<binary>
Error responses
401 Invalid or missing API key application/json 403 Insufficient permissions application/json 404 Purchase or attachment not found application/json 429 Rate limit exceeded application/json
