Reply on a WhatsApp thread with an attachment
curl --request POST \
--url https://api.pineyard.ai/whatsapp/conversations/{id}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'Idempotency-Key: <idempotency-key>' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
options.body = form;
fetch('https://api.pineyard.ai/whatsapp/conversations/{id}/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/whatsapp/conversations/{id}/media"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"messages": [
{
"id": "<string>",
"direction": "OUTBOUND",
"toPhone": "<string>",
"type": "TEXT",
"body": "<string>",
"status": "QUEUED",
"providerMsgId": "<string>",
"mediaItemId": "<string>",
"collectionId": "<string>",
"callId": "<string>",
"campaignId": "<string>",
"error": "<string>",
"createdAt": "<string>",
"sentAt": "<string>",
"deliveredAt": "<string>",
"readAt": "<string>",
"templateId": "<string>",
"providerErrorReason": "<string>",
"failureReason": "<string>",
"templateValues": {
"headerValues": [
"<string>"
],
"bodyValues": [
"<string>"
],
"name": "<string>",
"templatePurpose": "<string>",
"fileName": "<string>"
},
"conversationId": "<string>",
"contactId": "<string>",
"campaignContactId": "<string>",
"hasMedia": true,
"mediaMimeType": "<string>",
"mediaFileName": "<string>"
}
]
}Conversations
Reply on a WhatsApp thread with an attachment
POST
/
whatsapp
/
conversations
/
{id}
/
media
Reply on a WhatsApp thread with an attachment
curl --request POST \
--url https://api.pineyard.ai/whatsapp/conversations/{id}/media \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: multipart/form-data' \
--header 'Idempotency-Key: <idempotency-key>' \
--form file=@example-fileconst form = new FormData();
form.append('file', '<string>');
const options = {
method: 'POST',
headers: {'Idempotency-Key': '<idempotency-key>', Authorization: 'Bearer <token>'}
};
options.body = form;
fetch('https://api.pineyard.ai/whatsapp/conversations/{id}/media', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://api.pineyard.ai/whatsapp/conversations/{id}/media"
files = { "file": ("example-file", open("example-file", "rb")) }
headers = {
"Idempotency-Key": "<idempotency-key>",
"Authorization": "Bearer <token>"
}
response = requests.post(url, files=files, headers=headers)
print(response.text){
"messages": [
{
"id": "<string>",
"direction": "OUTBOUND",
"toPhone": "<string>",
"type": "TEXT",
"body": "<string>",
"status": "QUEUED",
"providerMsgId": "<string>",
"mediaItemId": "<string>",
"collectionId": "<string>",
"callId": "<string>",
"campaignId": "<string>",
"error": "<string>",
"createdAt": "<string>",
"sentAt": "<string>",
"deliveredAt": "<string>",
"readAt": "<string>",
"templateId": "<string>",
"providerErrorReason": "<string>",
"failureReason": "<string>",
"templateValues": {
"headerValues": [
"<string>"
],
"bodyValues": [
"<string>"
],
"name": "<string>",
"templatePurpose": "<string>",
"fileName": "<string>"
},
"conversationId": "<string>",
"contactId": "<string>",
"campaignContactId": "<string>",
"hasMedia": true,
"mediaMimeType": "<string>",
"mediaFileName": "<string>"
}
]
}Required scope:
whatsapp.send
Idempotency: an Idempotency-Key header is required when calling with an API key. See Idempotency.Authorizations
Your API key, e.g. pk_live_xxxxxxxxxxxxxxxxxxxxxxxx.
Headers
Unique value (e.g. a UUID) per action, up to 200 printable ASCII characters. Reuse it only to retry the same request; the first response is replayed for 24 hours.
Maximum string length:
200Example:
"f1d2c3b4-0000-4000-8000-000000000000"
Response
Queued
Show child attributes
Show child attributes

