The WhatsApp API allows you to send WhatsApp messages using the Telepie API.
You can send WhatsApp messages to a specific number or a group of numbers.
Allowed HTTP Request
- GET
- POST
- Plain/Text
- JSON
Description of usual server responses
- 200 OK - the request was successful.
- 201 Created - the request was successful and a resource was created.
- 204 No Content - the request was successful but there is no
representation to return(i.e. the response is empty).
- 400 Bad Request - the request could not be understood or was
missing required parameters.
- 401 Unauthorized - authentication failed or user doesn’t
have permissions for requested operation.
- 403 Forbidden - access denied.
- 404 Not Found - resource was not found.
- 405 Method Not Allowed - requested method is not supported for resources.
Error Codes & Descriptions
| API Type | Error Code | Error Description |
| Send Media API | 200 | SUCCESS |
| Send Media API | 131009 | Parameter value is invalid |
| Send Media API | 100 | Invalid Parameter |
| Send Media API | 133010 | Phone number is not registered with WhatsApp business platform. |
| Send Media API | 133004 | Server is temporarily unavailable. |
| Send Media API | 132015 | Template parameters invalid or missing. |
| Send Media API | 132001 | The template does not exist in the specified language or the template has not been approved. |
| Send Media API | 132000 | The number of variable parameter values included in the request did not match the number of variable parameters defined in the template. |
| Send Media API | 131051 | Unsupported message type. |
| Send Media API | 131000 | Message failed to send due to an unknown error. |
| Send Media API | 131021 | Sender and recipient phone number is the same. |
| Send Media API | 131016 | A service is temporarily unavailable. |
Supported Countries
Currently address messages
are supported in India & Singapore . Below table outlines which fields are supported in which country specifically.
| Field Name | Display Label | Input Type | Supported Countries | Limitations |
| name | Name | text | India, Singapore | None |
| phone_number | Phone Number | tel | India, Singapore | Valid phone numbers only |
| in_pin_code | Pin Code | text | India | Max length: 6 |
| sg_post_code | Post Code | number | Singapore | Max length: 6 |
| house_number | Flat/House Number | text | India | None |
| floor_number | Floor Number | text | India | None |
| tower_number | Tower Number | text | India | None |
| building_name | Building/Apartment Name | text | India | None |
| address | Address | text | India | None |
| landmark_area | Landmark/Area | text | India, Singapore | None |
| unit_number | Unit Number | text | India | None |
| city | City | text | India | None |
| state | State | text | India | None |
The Interactive Object of Type List
The Interactive object generally contains 4 main components: header, body,
footer, and action.
The interactive object of type list must have minimum 1 and maximum 10 section
objects should be nested with the unique ids.
| Name | Description |
| list | Required Use it for List Messages. |
| header | Optional Header content displayed on top of a message. |
| body | Required The body of the message. There’s a maximum of 1024 characters. Emojis and markdown are supported. |
| footer | Optional The footer of the message. There’s a maximum of 60 characters. Emojis and markdown are supported. |
| action | Required Action you want the user to perform after reading the message. |
The interactive object generally contains 4 main components: header, body,
footer, and action.
The interactive object of type button must have minimum 1 and maximum 3
buttons should be nested with the unique ids.
| Name | Description |
| type | Required Supported values: button (Use it for Reply Buttons). |
| header | Optional Header content displayed on top of a message. |
| body | Required The body of the message. There’s a maximum of 1024 characters. Emojis and markdown are supported. |
| footer | Optional The footer of the message. There’s a maximum of 60 characters. Emojis and markdown are supported. |
| action | Required Action you want the user to perform after reading the message. You must add at least one button, and include type, title, and id for your buttons. You cannot add more than 3 buttons. |
Example action object
{
"action": {
"buttons": [
{
"type": "reply",
"reply": {
"id": "unique-postback-id-1",
"title": "First Button’s Title"
}
},
{
"type": "reply",
"reply": {
"id": "unique-postback-id-2",
"title": "Second Button’s Title"
}
}
]
}
}
| Name | Description |
| type | Required The header type you would like to use. |
| text | Required if type is set to text. Text for the header. Maximum of 60 characters. Formatting allows emojis, but not markdown. |
| video | Required if type is set to video. Contains the media object for this video. |
| image | Required if type is set to image. Contains the media object for this image. |
| document | Required if type is set to document. Contains the media object for this document. |
Supported Values are :
text : Used for Reply Buttons.
video : Used for Reply Buttons.
image : Used for Reply Buttons.
document : Used for Reply Buttons.
{
"header": {
"type": "text",
"text": "your text"
}
// OR
,
{
"document": {
"id": "your-media-id",
"filename": "some-file-name"
}
}
// OR
,
{
"document": {
"link": "the-provider-name/protocol://the-url",
"provider": {
"name": "provider-name"
},
"filename": "some-file-name"
}
}
// OR
,
{
"video": {
"id": "your-media-id"
}
}
// OR
,
{
"video": {
"link": "the-provider-name/protocol://the-url",
"provider": {
"name": "provider-name"
}
}
}
// OR
,
{
"image": {
"id": "your-media-id"
}
}
// OR
,
{
"image": {
"link": "http(s)://the-url",
"provider": {
"name": "provider-name"
}
}
}
}
The Body Object
| Name | Description |
| text | Required The body content of the message. Maximum of 1024 characters. |
| Name | Description |
| text | Required if the footer Object is present The footer content of the message. Maximum of 60 characters. |
The Action Object
| Name | Description |
| button | Required for Reply Button Messages. |
A button can contain the following parameters:
- type : only supported type is reply (for Reply Button Messages)
- title : Button title. It cannot be an empty string and must be unique within
- the message : Maximum of 20 characters. Does not allow emojis or
markdown.
- id : Unique identifier for your button. Maximum of 256 characters. This ID is
returned in the webhook when the button is clicked by the user.