The MailUp transactional API for text messages (SMS) is the best choice when you have to send single messages, regardless the number of messages you need to send. The main features of this API are the following:
- sending is immediate
- authentication is very simple
- it works on http post, then you can use the "send" command as a callback function into a system that supports webhooks
POST https://sendsms.mailup.com/api/v2.0/sms/{account_ID}/{List_ID} HTTP/1.1 User-Agent: Fiddler Host: sendsms.mailup.com Content-Type: application/json;odata=verbose;charset=utf-8 Content-Length: 428 { "Content":"Hi [Name], welcome to [City]", "ListGuid":"xxxxxxxx-aaa-bbbb-cccc-e3a98b626156", "ListSecret":"yyyyyyyy-ddd-eeee-ffff-3e1cb0e6e64c", "Recipient":"+393350000001", "CampaignCode":"Welcome messages", "DynamicFields":[{"N":"Name","V":"John"},{"N":"City","V":"Cremona"}], "isUnicode":0 }
Getting started
Security is managed by means of "ListSecret" field, which is list specific and it can be enabled/disabled using APIs
You can perform GET, POST, DELETE on /lists/{List_ID}/listsecret resource, Basic Authentication is required.
You can use GET method to check if a ListSecret is already configured (if not, you should use POST method)
-- Request GET https://sendsms.mailup.com/api/v2.0/lists/1/listsecret HTTP/1.1 User-Agent: Fiddler Authorization: Basic aBcDeFgHiLmNoPqRsTuVz Host: sendsms.mailup.com Content-Length: 0 -- Response 1 (when ListSecret does not exist) HTTP/1.1 200 OK Content-Length: 71 Content-Type: application/json; charset=utf-8 Server: Microsoft-HTTPAPI/2.0 Date: Wed, 09 Mar 2016 16:39:24 GMT {"Data":{"ListSecret":null},"Code":"0","Description":"","State":"DONE"} -- Response 2 (when ListSecret exists) HTTP/1.1 200 OK Content-Length: 105 Content-Type: application/json; charset=utf-8 Server: Microsoft-HTTPAPI/2.0 Date: Wed, 09 Mar 2016 16:45:39 GMT {"Data":{"ListSecret":""yyyyyyyy-ddd-eeee-ffff-3e1cb0e6e64c"},"Code":"0","Description":"","State":"DONE"}
As soon as you get the value of ListSecret you can start sending text messages (refer to next paragraph).
POST https://sendsms.mailup.com/api/v2.0/lists/{List_ID}/listsecret HTTP/1.1 User-Agent: Fiddler Authorization: Basic aBcDeFgHiLmNoPqRsTuVz Host: sendsms.mailup.com Content-Length: 55 Content-Type: application/json;odata=verbose;charset=utf-8 { "ListGUID":"xxxxxxxx-aaa-bbbb-cccc-e3a98b626156" }
If you want to disable transactional APIs, you can use DELETE method, which can also be used, when followed by a POST method, to change the ListSecret value
DELETE https://sendsms.mailup.com/api/v2.0/lists/1/listsecret?listGUID=xxxxxxxx-aaa-bbbb-cccc-e3a98b626156 HTTP/1.1 User-Agent: Fiddler Authorization: Basic aBcDeFgHiLmNoPqRsTuVz Host: sendsms.mailup.com Content-Length: 0
How to send an SMS
Once you have ListSecret, you can start sending text messages and authentication is no more required. The example below sends an SMS to number +393350000001
POST https://sendsms.mailup.com/api/v2.0/sms/{account_ID}/{List_ID} HTTP/1.1 User-Agent: Fiddler Host: sendsms.mailup.com Content-Type: application/json;odata=verbose;charset=utf-8 Content-Length: 428 { "Content":"Hi [Name], welcome to [City]", "ListGuid":"xxxxxxxx-aaa-bbbb-cccc-e3a98b626156", "ListSecret":"yyyyyyyy-ddd-eeee-ffff-3e1cb0e6e64c", "Recipient":"+393350000001", "CampaignCode":"Welcome messages", "DynamicFields":[{"N":"Name","V":"John"},{"N":"City","V":"Cremona"}], "isUnicode":0 }
On this page... |
---|