Home Sign In Try Free

Messages


The messages path contains function relating to the sending and managing of campaigns and messages


Preview Message


Request URL

http://api.textplode.com/v3/messages/merge

Parameters

[string] message - Your message, containing merge tags if applicable
[string] recipients - a JSON encoded array containing a 'phone_number' and 'merge' element for each recipient

Response

[array] An array of groups (id, first_name, last_name, number, score)

Send Message


Request URL

http://api.textplode.com/v3/messages/send

Parameters

[string] api_key - Your API Key
[string] message - The content of the message to be sent, including merge tags if required
[string] from - The Sender name or number
[string] recipients - JSON encoded array

Each recipient in the recipients array should be an array containing "phone_number" and "merge". 
The merge element is itself an array where the key is the text to be replaced and the value is the replacement text. 

Response

[int] campaign_id - The ID of the campaign
[array] messages - An array of message_ids associated with the campaign

Delivery Reports


Request URL

http://api.textplode.com/v3/messages/status

Parameters

[string] api_key - Your API Key
[int] id - The ID of the campaign to be returned

Response

[int] campaign_id The ID of the campaign requested
[array] An array of messages (message_id, recipient, message, status)

Note: Status can be one of:
PENDING
DELIVERED
EXPIRED
NOT_DELIVERED
REJECTED
UNDELIVERABLE
INVALID_DESTINATION_ADDRESS. 

It is possible that this field is returned blank for messages sent using 
older versions of the API 

Delivery Reports - Callback URL

If you have a callback URL set for your account, the following information will be sent to the URL specified as a JSON encoded array


Data

[string] to The phone number the message was sent to
[string] messageId - The unique ID of the message
[int] smsCount - The number of SMS credits the message used
[string] sentAt - The UNIX timestamp that the message was sent to the operator
[string] doneAt - The UNIX timestamp that the current status was reached 
[array] error - Contains 2 elements, 'description' and 'name'. Description gives a human formatted error message whereas name provides shorter text for use in code.
[array] status - Contains 2 elements, 'description' and 'name'. Description gives a human formatted error message whereas name provides shorter text for use in code. The list of possible statuses is largely the same as the Delivery Reports API call above

Example

{"doneAt": "1471623589", "error": { "description": "No Error", "name": "NO_ERROR"}, "messageId": "000001", "sentAt": "1471623578", "smsCount": 2, "status": { "description": "Message delivered to handset", "name": "DELIVERED_TO_HANDSET" }, "to": "44000000001" }