Message
The following actions can be performed with the Message API.
BaseURI: https://api.plivo.com/v1/Account/{auth_id}/Message/
Send a Message
URI: https://api.plivo.com/v1/Account/{auth_id}/Message/
Method: POST
Parameters
The following parameters are required to send a message.
Required Parameters
| Parameter | Description |
|---|---|
src |
The phone number to be used as the caller id (with the country code). For e.g. a USA number, 15671234567 |
dst |
The number to which the message needs to be sent.
Regular phone numbers must be prefixed with the country code but without the ‘+’ sign. For e.g, a USA caller id number could be, 15677654321,
with '1' for the country code. Multiple numbers can be sent by using a delimiter. For e.g. 15677654321<12077657621<12047657621.
|
text |
The text to send. |
Optional Parameters
| Parameter | Description |
|---|---|
type |
The type of message. Should be 'sms' for a text message. Defaults to 'sms'. |
url |
The URL to which with the status of the message is sent. The following parameters are sent to the URL:
|
method |
The method used to call the url. Defaults to POST. |
Response
HTTP Status: 202
JSON:
{
"message": "message(s) queued",
"message_uuid": [u'db3ce55a-7f1d-11e1-8ea7-1231380bc196'],
"api_id": "db342550-7f1d-11e1-8ea7-1231380bc196"
}
Get All Message Recordings
URI: https://api.plivo.com/v1/Account/{auth_id}/Message/
Method: GET
Parameters
| Parameter | Description |
|---|---|
limit |
Used to display the number of results per page. The maximum number of results that can be fetched is 20. |
offset |
Denotes the number of value items by which the results should be offset. Eg:- If the result contains a 1000 values and limit is set to 10 and
offset is set to 705, then values 706 through 715 are displayed in the results. This parameter is also used for pagination of the results.
|
Response
HTTP Status: 200
JSON:
{
"meta": {
"previous": null,
"total_count": 2,
"offset": 0,
"limit": 20,
"next": null
},
"api_id": "40b5a864-58cb-11e1-86da-adf28403fe48",
"objects": [
{
"cloud_rate": "0.00000",
"carrier_rate": "0.00800",
"message_direction": "outbound",
"to_number": "15551112200",
"message_state": "failed",
"total_amount": "0.00800",
"from_number": "155588877766",
"message_uuid": "c02600f8-b938-11e1-8ea7-12313806be9a",
"message_time": "2012-06-18T11:28:40",
"resource_uri": "/v1/Account/MAYUUUDMMJNJM2ZYU/Message/c02600f8-b938-11e1-8ea7-12313806be9a/",
"message_type": "sms",
},
{
"cloud_rate": "0.00000",
"carrier_rate": "0.00800",
"message_direction": "outbound",
"to_number": "15551112200",
"message_state": "failed",
"total_amount": "0.00800",
"from_number": "155588877766",
"message_uuid": "c02600f8-b938-11e1-8ea7-12313806be9a",
"message_time": "2012-06-18T11:28:40",
"resource_uri": "/v1/Account/MAYUUUDMMJNJM2ZYU/Message/c02600f8-b938-11e1-8ea7-12313806be9a/",
"message_type": "sms",
}
]
}
Get a Specific Message Recording
URI: https://api.plivo.com/v1/Account/{auth_id}/Message/{message_uuid}/
Method: GET
Parameters
There are no parameters required for this API call.
Response
HTTP Status: 200
JSON:
{
"meta": {
"previous": null,
"total_count": 1,
"offset": 0,
"limit": 20,
"next": null
},
"api_id": "40b5a864-58cb-11e1-86da-adf28403fe48",
"objects": [
{
"cloud_rate": "0.00000",
"carrier_rate": "0.00800",
"message_direction": "outbound",
"to_number": "15551112200",
"message_state": "failed",
"total_amount": "0.00800",
"from_number": "155588877766",
"message_uuid": "c02600f8-b938-11e1-8ea7-12313806be9a",
"message_time": "2012-06-18T11:28:40",
"resource_uri": "/v1/Account/MAYUUUDMMJNJM2ZYU/Message/c02600f8-b938-11e1-8ea7-12313806be9a/",
"message_type": "sms",
}
]
}


