curl --location 'https://api.gupshup.io/wa/api/v1/msg' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'apikey: {{APIKEY}}' \
--data-urlencode 'source={{SOURCE}}' \
--data-urlencode 'destination={{DESTINATION}}' \
--data-urlencode 'message={
"type": "file",
"url": "https://www.clickdimensions.com/links/TestPDFfile.pdf",
"filename": "Sample pdf",
"caption": "sample caption"
}' \
--data-urlencode 'src.name={{APP_NAME}}'
curl --location 'https://api.gupshup.io/wa/api/v1/msg' \
--header 'Cache-Control: no-cache' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'apikey: xvnwgh9vgbbl6gjeezymu5v5iepxq2zt' \
--header 'cache-control: no-cache' \
--data-urlencode 'channel=whatsapp' \
--data-urlencode 'source=918097424541' \
--data-urlencode 'destination=91735824xxxx' \
--data-urlencode 'message={
"type":"file",
"url":"https://www.clickdimensions.com/links/TestPDFfile.pdf",
"filename":"Sample pdf",
"caption":"sample caption"
}' \
--data-urlencode 'src.name=TedLasso'
curl --location 'https://api.gupshup.io/wa/api/v1/msg' \
--header 'Cache-Control: no-cache' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'apikey: xvnwgh9vgbbl6gjeezymu5v5iepxq2zt' \
--header 'cache-control: no-cache' \
--data-urlencode 'channel=whatsapp' \
--data-urlencode 'source=918097424541' \
--data-urlencode 'destination=91735824xxxx' \
--data-urlencode 'message={
"type":"file",
"id":"8736363726265261",
"filename":"Sample pdf",
"caption":"sample caption"
}' \
--data-urlencode 'src.name=TedLasso'
curl --location 'https://api.gupshup.io/wa/api/v1/msg' \
--header 'Cache-Control: no-cache' \
--header 'Content-Type: application/x-www-form-urlencoded' \
--header 'apikey: xvnwgh9vgbbl6gjeezymu5v5iepxq2zt' \
--header 'cache-control: no-cache' \
--data-urlencode 'channel=whatsapp' \
--data-urlencode 'source=918097424541' \
--data-urlencode 'destination=91735824xxxx' \
--data-urlencode 'message={
"context":{
"msgId":"9c9ee217-db34-47ac-8922-17ee5b69cec3"
}
"type":"file",
"id":"8736363726265261",
"filename":"Sample pdf",
"caption":"sample caption"
}' \
--data-urlencode 'src.name=TedLasso'
| Parameter Name | Location | Type | Description | Required | Example |
|---|
| apikey | Header | string | APIKEY of your Gupshup Account | Yes | 61b3021c97214370b341f8baaae0xxxx |
| Parameter Name | Location | Type | Description | Required | Example |
|---|
| source | Form | integer | Source Phone Number | Yes | 918929874278 |
| destination | Form | integer | Destination Phone Number | Yes | 918805162043 |
| src.name | Form | string | App Name | Yes | august18 |
| message | Form | object | Message object (refer to schema) | Yes | Refer to Message schema below |
| Property Name | Type | Description | Required | Example |
|---|
| context | object | Message context | No | { "msgId": "uniqueMsgId" } |
| type | string | Type of session message | Yes | file |
| id | string | Media Id | No | MEDIA_ID if URL is not provided |
| caption | string | Message caption | No | Lorem Ipsum |
| url | string | URL of the file | No | https://www.clickdimensions.com/links/TestPDFfile.pdf |
| filename | string | File name | No | sample.pdf |
| Parameter Name | Type | Description | Example |
|---|
| status | string | Response status | submitted |
| messageId | string | Unique message ID | 183dc8f1-7ecc-4419-895f-04fd0b1bfe07 |
| message | string | Error message | Invalid Destination, Invalid App Details, Authentication Failed, Too Many Requests |
| status | string | Status of the request | error |
| Status Code | Description | Response Schema |
|---|
| 200 | Successful response | { "status": "submitted", "messageId": "183dc8f1-7ecc-4419-895f-04fd0b1bfe07" } |
| 400 | Bad Request | { "message": "Invalid Destination", "status": "error" } or { "message": "Invalid App Details", "status": "error" } |
| 401 | Authentication Failed | { "message": "Authentication Failed", "status": "error" } |
| 429 | Too Many Requests | { "message": "Too Many Requests", "status": "error" } |