SMS REST – API

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

ParameterTypeMandatoryDescription
authorizationIdstringyesThe 32 bit authorization token used to authenticat the request
destinationintyesThe phone number to the receiver of the SMS
originatorstringyesWho sent the SMS, where was it from. Either a number or a string max 11 characters
textstringyesThe actual SMS text message
typestringnoType can be set to either text for regular text message or flash to be displayed directly on the cellphones display
scheduledatetimenoWhen 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

ParameterTypeMandatoryDescription
trackingidstringyesThe trackind id is used to track the delivery of the SMS, this should be stored at the senders side to receive delivery reports
authorizationIdstringyesThe 32 bit authorization token used to authenticat the request
destinationintyesThe phone number to the receiver of the SMS
originatorstringyesWho sent the SMS, where was it from. Either a number or a string max 11 characters
textstringyesThe actual SMS text message
typestringnoType can be set to either text for regular text message or flash to be displayed directly on the cellphones display
scheduledatetimenoWhen you like the SMS to be delivered, should be in the format 20150101T10:30:00
statusstringyesThe 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"
}

Code in PHP: