In order to receive text messages events, you need to ensure you have set up your account callback URL under Company settings > API
Parameters | Sample | Description |
---|---|---|
type | message-received | will always be message-received for incoming messages. |
from | 3056490655 | One of your telephone numbers assigned under the account, if not assigned, will result in error. |
to | 9195551212 | The phone number the message should be sent to |
message_body | string | The contents of the text message. |
direction | in | It will be always "in" for recieved messages. |
segmentCount | number | How many messages this message counted as (each segement is 259 characters). |
message_id | string | Unique ID for the message |
Example:
Example :
POST /your_url HTTP/1.1
Content-Type: application/json; charset=utf-8
Response :
- {
- "type":"message-received",
- "time":"2016-09-14T18:20:16Z",
- "from":"626446262",
- "to":"305689888",
- "direction":"in",
- "message_body":"This is the message body",
- "segmentCount":"1",
- "message_id":"Hmdbn479ikf7",
- }