REST
The REST API is a easy way to read and write to smsNet.
Authorization
The API uses basic authorization, and all requests must be authorized at every request.
A 32 bit token is used to authenticat the request.
Encoding
UTF8
Address
https://login.smsnet.se/v1/
Format
The REST API is only using JSON all requests body should be in JSON and all responses will be JSON. Make sure you set Request.Header.Content-Type to “application/json”.
Error
Here is a list of the error codes that can get return
404 – The request can not be found
500 – Internal error
300 – Reciver is missing or invalid
301 – Sender is missing or invalid
302 – Content is missing or invalid
303 – Schedual date and time are invalid or has passed
Overview
- Send SMS
- Status SMS
Send SMS
POST/sms
Request
Parameter | Type | Mandatory | Description |
---|---|---|---|
authorizationId | string | yes | The 32 bit authorization token used to authenticat the request |
destination | int | yes | The phone number to the receiver of the SMS |
originator | string | yes | Who sent the SMS, where was it from. Either a number or a string max 11 characters |
text | string | yes | The actual SMS text message |
type | string | no | Type can be set to either text for regular text message or flash to be displayed directly on the cellphones display |
schedule | datetime | no | When you like the SMS to be delivered, should be in the format 2015-01-01 10:30:00 |
Sample request
POST/sms HTTP/1.1 Content-Type: application/json; charset=UTF-8 { "authorizationId": "dXNlcm5hbWU6cGFzc3dvcmQ", "destination": "0709846366", "originator": "smsNet", "text": "Hello world", "type": "text", "schedule": "2015-01-01 10:30:00" }
Response
Parameter | Type | Mandatory | Description |
---|---|---|---|
trackingid | string | yes | The trackind id is used to track the delivery of the SMS, this should be stored at the senders side to receive delivery reports |
authorizationId | string | yes | The 32 bit authorization token used to authenticat the request |
destination | int | yes | The phone number to the receiver of the SMS |
originator | string | yes | Who sent the SMS, where was it from. Either a number or a string max 11 characters |
text | string | yes | The actual SMS text message |
type | string | no | Type can be set to either text for regular text message or flash to be displayed directly on the cellphones display |
schedule | datetime | no | When you like the SMS to be delivered, should be in the format 20150101T10:30:00 |
status | string | yes | The status, that can be acknowledge,delivered,buffered or failed |
POST/sms HTTP/1.1 Content-Type: application/json; charset=UTF-8 { "trackingid": "4ebeab48-ee03-474f-bc79-c6db082c2bad", "authorizationId": "dXNlcm5hbWU6cGFzc3dvcmQ", "destination": "0709846366", "originator": "smsNet", "text": "Hello world", "type": "text", "schedule": "2015-01-01 10:30:00", "status": "acknowledge" }