Messages API
This page is used to implement SendTalk messages APIs, please refer to these following APIs
Send Message API
Send Message
POST
https://sendtalk-api.taptalk.io/api/v1/message/send_whatsapp
Send a message to the specified number via WhatsApp
Headers
Name | Type | Description |
---|---|---|
API-Key* | string | The integration API key for accessing the API |
Content-Type | string | Content-type of the body request |
User-Agent | string | The user agent of the client accessing the API |
Request Body
Name | Type | Description |
---|---|---|
phone* | string | The recipient number (example: 62811001234) |
messageType* | string | The message type
Values: |
body* | string | The message body (text message or file URL for the image) |
filename | string | The name of the file (required for all message type, except for "text") |
caption | string | The caption, if any (for message type "image") |
Message Types
The difference between OTP
type and TEXT
type is based on the queue of our system. The message withOTP
type will be prioritized first than the other type in sending the message.
Important Do not forget to add API-Key in Headers and make sure the Body Parameters type is JSON
Request
Field | Type | Description |
---|---|---|
phone | string | The phone number to send the message to. |
messageType | string | The message type. Allowed values: |
body | string | The message body (text message or file URL). |
fileName (optional) | string | The name of the file (required for message type other than |
caption (optional) | string | The caption, if any (for message type |
Below is the example of the request:
Response Success 200
Field | Type | Description |
---|---|---|
success | boolean | If message is sent successfully. |
message | string | The success or error message. |
reason | string | Failure reason ( |
id | string | The message ID, if successful. |
Response Error 4xx
Name | Description |
---|---|
| The parameter validation failed. |
| The request header validation failed. |
Get Send Status API
Get Status Message
POST
https://sendtalk-api.taptalk.io/api/v1/message/get_status
Get the status of a message.
Headers
Name | Type | Description |
---|---|---|
API-Key* | string | The integration API key for accessing the API |
Content-Type | string | Content-type of the body request |
User-Agent | string | The user agent of the client accessing the API |
Request Body
Name | Type | Description |
---|---|---|
id* | string | The message ID. |
Important Do not forget to add API-Key in Headers and make sure the Body Parameters type is JSON
Request
Field | Type | Description |
---|---|---|
id | string | The ID of the message. |
Below is the example of the request:
Response Success 200
Field | Type | Description |
---|---|---|
status | string | The message status |
isPending | boolean | If the message is pending |
isSent | boolean | If the message has been sent to the channel |
sentTime | long | The time the message was sent, in Unix milliseconds |
currency | string | The currency |
price | long | The charged price |
createdTime | long | The time the message was created, in Unix milliseconds |
Response Error 4xx
Name | Description |
---|---|
| The parameter validation failed. |
| The message ID is not found. |
| The request header validation failed. |
Last updated