The below sample REST API requests can be inserted and tested via our REST API Simulator in MXT.

Note: The 'Origin' field can be left blank to use a number from the SMSGlobal Shared Numbers Pool.


Example request body for sending SMS In REST:

Method: POST

Host: api.smsglobal.com

URI: /sms/

Body:

Type: JSON

{
"origin" : "origin",
"destination" : mobilenumber,
"message" : "Hello Test"
}

Type: XML

<messages>
<origin>INSERTORIGIN</origin>
<destination>INSERTNUMBER</destination>
<message>SMSTEXT</message>
</messages>


Example for sending to multiple destinations:

Method: POST

Host: api.smsglobal.com

URI: /sms/

Body:

{
"origin" : "origin",
"destinations" : [number, number],
"message" : "Hello Test"
}


Example for sending to multiple destinations and multiple message content:

Method: POST

Host: api.smsglobal.com

URI: /sms/

Body:

{
"messages": [{
"origin": "origin",
"destination": number1,
"message": "Hello Test from REST"
},{
"origin": "origin",
"destination": number2,
"message": "Hello Test 2 from REST"
}]
}


Example request body for sending SMS with notifyUrl and incomingUrl:

Method: POST

Host: api.smsglobal.com

URI: /sms/

Body:

{
"origin" : "",
"destination" : mobilenumber,
"message" : "Message content",
"notifyUrl" : "Post-back URL",
"incomingUrl" : "Post-back URL"
}


Example Request for Creating a Group in MXT

Method: POST

Host: api.smsglobal.com

URI: /group/

Body:

{
"name" : "RestTest3",
"keyword" : "RestTest3",
"defaultOrigin" : "Restetest3",
"isGlobal" : true
}

Note: "defaultOrigin" can be left blank for SMSGlobal Shared Numbers Pool.


Example request to GET incoming replies

Method: GET

Host: api.smsglobal.com

URI: /sms-incoming/?startDate=2021-07-20&endDate=2021-07-30


Did this answer your question?