[Advertiser] Bulk SMS API for service providers
This API is the way you connect your server with ours. It is a very simple integration, essentially it calls our web service, which will send the messages.
Implementing the API:
Login with you user name and password of your advertiser account > click edit profile > next to API ID click “Generate”
API URL: https://mcpn.us/sendBulk
Supply XML file:
<?xml version="1.0" ?>
<Data>
<User>USER_NAME</User>
<ApiId>API_ID</ApiId>
<Shortcode>71441-US</Shortcode>
<Json>true/false</Json>
<Sync>true/false</Sync>
<Sends>
<Send>
<Mobile>MOBILE_NUMBER</Mobile> <Message>TEXT</Message>
</Send>
<Send>
<Mobile>MOBILE_NUMBER</Mobile>
<Message>TEXT</Message>
</Send>
</Sends>
</Data>
This API is limited to 1000 numbers
Any number above this will be ignored
Note:
The default behavior of this API is to run asynchronously so it's just gets the details and return Batch ID, then do validation checks and each invalid number or message is ignored. This is in order to return a fast response.
There is an option to run it with synchronous checks so all the validation checks of the numbers and message will run and then return a Json response with the invalid numbers/message (MobilesErrors array in the Json) in order to do it need to provide in the XML the node <Sync>true</Sync> (default is false). This option needs to run with <Json>true</Json> in order to get the error numbers in the Json response.
Use this example to test the API:
Replace USER_NAME with advertiser user name
Replace API_ID with the code generated
Replace MOBILE_NUMBER with the phone number must include the 1 prefix
Replace TEXT with the message to be send
Replace the short code with one of your short codes
Return Code
If the API succeeds, then it will return with status code 200.
If an error occurs or there is an invalid parameter, then it returns with status code 400 or 500 with an error message in the response body.
Return content
If Json option is set to false
Will return a success message with this format: "Messages Queued Successfully:<BATCH ID>"
Where <BATCH ID> is indication the Batch ID for all the mobiles supplied by this XML.
i.e. Messages Queued Successfully:7624309221
If Json option is set to true
Will return a json object with status, batch ID, error ID and error message.
List of all error codes is in the bottom of this document
In case of success will return the following:
{ "Status":"OK", "BatchID":"34876837468"
"MobilesErrors":[{"15555555555":"Mobile is not opted-in to a list"},{"14444444444":"Mobile is not opted-in to a list"}
}
In case of error will return the following:
{
"Status":"Error",
"ErrorId":"102",
"ErrorMessgae":"Node: User is empty"
}
Error ID List
101 - Error while parse xml
102- Node: User is empty
103 - Node: ApiId is empty
104 - Nodes: Sends are empty
105 - Error while getting user data
106 - user not exists or invalid api id
107 - This API is not enabled please contact support
108 - Credits error
130 - General Error
Comments
0 comments
Article is closed for comments.