This article provides information about the upcoming depreciation of the WholesaleSMS API and how to use Sinch MessageMedia REST API.
As part of the ongoing transition of WholesaleSMS into the Sinch MessageMedia family, and in line with our continued focus on security enhancements and improved performance, we have decided to deprecate the WholesaleSMS API. WholesaleSMS API will reach its official end-of-life on 30 September 2025, after which it will no longer be available for use.
You can switch to the Sinch MessageMedia REST API using your existing WholesaleSMS API credentials, as they should grant you access without the need to create new ones. Alternatively, you can create new credentials and delete the existing ones for improved security.
Technical Guideline
This section highlights key differences between the current WholesaleSMS API endpoints and the REST API endpoints and provides examples to understand the technical changes required for the transition.
How to Use REST API
The Sinch MessageMedia Messages REST API provides a number of endpoints for building powerful two-way messaging applications. The Messages API provides access to three main resources:
- Messages - Messages delivered from an application to a handset.
- Delivery Reports - Real time reports on the delivery status of a message. As a message is processed, it's status may change several times before it is finally delivered to a handset.
- Replies - Messages sent from a handset to an application. These messages are typically a reply to a previously sent message.
REST API developer’s guide can be accessed from Developer Guides – Sinch MessageMedia .
Getting Access
Current API users need to set up a REST API key, which can be done by logging into the WholesaleSMS Hub and navigating to Settings → API Settings → Basic Authentication → Create new key
API Endpoint Matrix Summary
Endpoint |
Summary |
REST API |
---|---|---|
api/v2/send-sms.json | Sending SMS | POST /v1/messages |
api/v2/get-balance.json | Get Balance | Currently unavailable in REST API |
api/v2/send-sms.json | Schedule an SMS | POST /v1/messages |
api/v2/cancel-sms.json | Cancel a scheduled SMS | PUT /v1/messages/{message_id} |
Key Changes:
- Basic credentials can remain the same. In other words, you don’t need new credentials for switching to REST API
- Note that the request is a POST submission but not form submission. Therefore the content-type should be application/json instead of
application/x-www-form-urlencoded
. - Please note that REST API does not support XML so if you are using WholesaleSMS’s
/api/v2/send-sms.xml
then the request body will need to change to json format. - More advance features can be accessed by specifying different properties in message body. More information can be found in this documentation.
Guide to Endpoint Transition
Sending SMS
WholesaleSMS API
POST /api/v2/send-sms.json HTTP/1.1 Host: api.wholesalesms.com.au Content-Type: application/x-www-form-urlencoded Authorization: Basic <base64(username:password)> message=This%20a%20reminder%20that%20your%20appointment%20is%20scheduled%20for%20Monday%209am&to=<mobile_number>&from=<sender_id>
Key Notes:
- message parameter is url encoded. There the above message would read as “This a reminder that your appointment is scheduled for Monday 9am”
- sender_id is a string.
-
mobile_number is specified in E.164 international format.
REST API
POST /v1/messages HTTP/1.1 Host: api.messagemedia.com Content-Type: application/json; charset=utf-8 Accept: application/json Authorization: Basic <base64(username:password)> { "messages": [ { "content": "This a reminder that your appointment is scheduled for Monday 9am", "source_number": "+<mobile_number>", "destination_number": "+<mobile_number>", "delivery_report": true } ] }
Key Changes:
- content The content of the message. This can be a Unicode string, up to 5,000 characters long. Message content is required.
- source_number Parameter is specified and is optional. If a source number is specified and no source number type is specified, the source number type will be inferred from the source number, however this may be inaccurate.
- destination_number The destination number the message should be delivered to. This should be specified in E.164 international format. For information on E.164, please refer to http://en.wikipedia.org/wiki/E.164. A destination number is required.
-
delivery_report Delivery reports can be requested with each message. If delivery reports are requested, a webhook will be submitted to the
callback_url
property specified for the message (or to the webhooks specified for the account) every time the status of the message changes as it is processed. The current status of the message can also be retrieved via the Delivery Reports endpoint of the Messages API. Delivery reports are optional and by default will not be requested.
Get Balance
Currently unavailable in REST API
Schedule an SMS
WholesaleSMS API
POST /api/v2/send-sms.json HTTP/1.1 Host: api.wholesalesms.com.au Content-Type: application/x-www-form-urlencoded Authorization: Basic <base64(username:password)> message=This%20a%20reminder%20that%20your%20appointment%20is%20scheduled%20for%20Monday%209am&to=<mobile_number>&send_at=&from=%7B%7Bsenderid%7D%7D
Key Notes:
- message parameter is url encoded. There the above message would read as “This a reminder that your appointment is scheduled for Monday 9am”
- sender_id is a string.
- mobile_number is specified in E.164 international format.
- Provide schedule in send_at parameter.
REST API
POST /v1/messages HTTP/1.1 Host: api.messagemedia.com Content-Type: application/json; charset=utf-8 Accept: application/json Authorization: Basic <base64(username:password)> { "messages": [ { "content": "This a reminder that your appointment is scheduled for Monday 9am", "destination_number": "+<mobile_number>", "delivery_report": true "scheduled": "<UTC date time specified in ISO 8601 format>" } ] }
Key Changes:
- SMS can be scheduled by providing the “scheduled” property in the message body.
- More information can be found in this documentation.
Cancel a scheduled SMS
WholesaleSMS API
POST /api/v2/cancel-sms.json HTTP/1.1 Host: api.wholesalesms.com.au Content-Type: application/x-www-form-urlencoded Authorization: Basic <base64(username:password)> id=10000015
Key Notes:
- id is the message to be cancelled
REST API
PUT /v1/messages/{message_id} HTTP/1.1 Host: api.messagemedia.com Content-Type: application/json; charset=utf-8 Accept: application/json Authorization: Basic <base64(username:password)> { "status": "cancelled" }
Key Changes:
- Cancelling a scheduled message that has not been sent yet is done by submitting a PUT request to the messages endpoint using the message ID as a parameter. See Line:1 above. Body should just contain status as cancelled as in the example above.
- More information can be found in this documentation.
Comments
0 comments
Article is closed for comments.