API Documentation

Send Messages

URL:

		POST https://triplesms.com/api/v1/message
	

HTTP Headers

All API methods expect requests to supply a Content-Type header with the value application/json. All responses will have the Content-Type header set to application/json.

Probably the most simple example:


		{
			"to": "+959xxxxxxxx",
			"body": "Hello World!"
		}
	

		{
			"code": 200,
			"message": "Success",
			"description": "Success",
			"status": "success",
			"batchId": "1531800242",
			"encoding": "Plain Text",
			"message_content": "Hello World!",
			"total_characters": 21,
			"message_parts": 1,
			"total_sms": 1,
			"source": "Api",
			"data": [
				{
					"messageId": "c1ec23d6-792b-11e8-a7e4-b06ebf2cef50",
					"recipient": "+959xxxxxxxx",
					"operator": "MPT",
					"status": "Delivered",
					"send_at": "14 Jun 2018 17:01",
				}
			]
		}
	

A message, to multiple recipients


		{
			"to": ["+959xxxxxxxx", "+959xxxxxxxx", "+959xxxxxxxx"],
			"body": "မဂၤလာပါ"
		}
	

200 An array of the messages that were created from the request


		{
			"code": 200,
			"message": "Success",
			"description": "Success",
			"status": "success",
			"batchId": "1531800242",
			"encoding": "Plain Text",
			"message_content": "Hello World!",
			"total_characters": 21,
			"message_parts": 1,
			"total_sms": 3,
			"source": "Api",
			"data": [
				{
					"messageId": "c1ec23d6-792b-11e8-a7e4-b06ebf2cef51",
					"recipient": "+959xxxxxxxx",
					"operator": "MPT",
					"status": "Delivered",
					"send_at": "14 Jun 2018 17:01",
				},
				{
					"messageId": "c1ec23d6-792b-11e8-a7e4-b06ebf2cef52",
					"recipient": "+959xxxxxxxx",
					"operator": "MPT",
					"status": "Delivered",
					"send_at": "14 Jun 2018 17:01",
				},
				{
					"messageId": "c1ec23d6-792b-11e8-a7e4-b06ebf2cef53",
					"recipient": "+959xxxxxxxx",
					"operator": "MPT",
					"status": "Delivered",
					"send_at": "14 Jun 2018 17:01",
				}
			]
		}
	

HTTP response codes

CodeMessageDescription
401UnauthorizedUnauthorized Token is invalid.
01Invalid RequestA request containing invalid parameters or invalid data.
03Insufficient BalanceYou need to purchase more Packages before you can create message.
04Account VerificationVerify your email address first.
06Not AcceptableYou cannot use this sender ID.

Get all contacts

To retrieve all contacts, use:


		GET https://triplesms.com/api/v1/contacts
	
NameRequired?ExampleDescription
pageNo3Fetch the specified results page. The default is 1.
limitNo25The number of results per page. The default is 10.

Get all messages

To retrieve all messages, use:


		GET https://triplesms.com/api/v1/messages
	
NameRequired?ExampleDescription
pageNo3Fetch the specified results page. The default is 1.
limitNo25The number of results per page. The default is 10.

Check Balance

To check remaining balance, use:


		GET https://triplesms.com/api/v1/balance