API Examples HTTP GET

1. MOBILE TERMINATED MESSAGES

1.1 Send a SMS

A complete URL for sending “Hello World” to the subscriber with number +46701234567 is given below. Pasting this URL into a web browser and pressing ‘Enter’ creates the correct GET-request and sends it to the specified host and port.

https://get.spiricom.spirius.com:55001/cgi-bin/sendsms?User=myuser&Pass=mypassword&To=+46701234567&From=+46701234567&Msg=Hello+world

If everything is correct the web browser will display a message similar to the one given below.

Accepted for delivery, eda0ae82-98d7-40b3-bbaa-205b68b63c0b

1.2 Send a FLASH SMS

The message is a flash SMS containg the message “Hello World”.

https://get.spiricom.spirius.com:55001/cgi-bin/sendsms?User=myuser&Pass=mypassword&To=+46701234567&From=+46701234567&Msg=Hello+world&MsgType=1

1.3 Send a SMS with Alphanumeric SENDER

The message is sent from sender alphanumeric address “Test”. A maximum of 11 characters and A-Z, a-z, 0-9.

https://get.spiricom.spirius.com:55001/cgi-bin/sendsms?User=myuser&Pass=mypassword&To=+46701234567&From=Test&FromType=A&Msg=Hello+world

1.4 Send a SMS with ÅÄÖ using ISO-8859-1

The message contains ”åäöÅÄÖ” with default ISO-8859-1 encoding.

https://get.spiricom.spirius.com:55001/cgi-bin/sendsms?User=myuser&Pass=mypassword&To=+46701234567&From=+46701234567&Msg=%E5%E4%F6%C5%C4%D6

1.5 Send a SMS with ÅÄÖ using UTF-8

The message contains ”åäöÅÄÖ” with UTF-8 encoding.

https://get.spiricom.spirius.com:55001/cgi-bin/sendsms?User=myuser&Pass=mypassword&To=+46701234567&From=+46701234567&Msg=%C3%A5%C3%A4%C3%B6%C3%85%C3%84%C3%96​&CharSet=UTF8

1.6 Send a SMS using UTF-16

The message contains “ABBA” and is sent with UTF-16 encoding.

https://get.spiricom.spirius.com:55001/cgi-bin/sendsms?User=myuser&Pass=mypassword&To=+46701234567&From=+46701234567&Msg=%fe%ff%00%41%00%42%00%42%00%41&CharSet=UTF16

1.7 Send a Unicode UCS-2 SMS

The message contains “ABBA”. The Coding parameter determine how the message will be encoded when delivered to the handset.

https://get.spiricom.spirius.com:55001/cgi-bin/sendsms?User=myuser&Pass=mypassword&To=+46701234567&From=+46701234567&Msg=ABBA&Coding=2

1.8 Send SMS with smileys

This is the same as a Unicode UCS-2 SMS.

https://get.spiricom.spirius.com:55001/cgi-bin/sendsms?User=myuser&Pass=mypassword&To=+46123456789&From=+46123456789&CharSet=UTF8&Coding=2&Msg=%F0%9F%98%83

1.9 Send a Binary SMS

The binary message contains ”Hello world”. The Coding parameter determine how the message will be encoded when delivered to the handset.

https://get.spiricom.spirius.com:55001/cgi-bin/sendsms?User=myuser&Pass= mypassword&To=+46701234567&From=+46701234567&MsgType=3&Msg=48656c6c6f20776f726c64&Coding=1

2. MOBILE ORIGINATED MESSAGES

2.1 Push

The message below is an example of a GET-request sent from Spirius SMS Gateway, containing a MO-message. Note that the entire URL can be specified by the client (except for the parameters containing information regarding the message). Messages will be resent until acknowledged with HTTP status code 200 OK.

The message contains ”Hello world”.

GET /sms?From=Test&FromType=A&To=%2B46712345678&ToType=I&Msg=Hello%20world&MsgType=0 HTTP/1.1
Connection: keep-alive
User-Agent: SPIRIcom/1.0
X-Timestamp: 2018-10-03 12:39:14
X-Transaction-Id: eda0ae82-98d7-40b3-bbaa-205b68b63c0b

2.2 Pull

Example of getnextmessage:

https://get.spiricom.spirius.com:55001/cgi-bin/getnextmessage?User=myuser&Pass=mypassword

The message below is an example of a valid response to getnextmessage.

HTTP/1.1 200 OK
Server: SPIRIcom/1.0
Date: Tue, 02 Oct 2018 14:27:35 GMT
Content-Length: 164
Content-type: text/html
Pragma: no-cache
Cache-Control: no-cache

{"Result": 1, "From": "+46733317002", "FromType": "I", "To": "+46731297001", "ToType": "I", "Msg": "Hello world ", "MsgType": 0, "Timestamp": "2018-10-02 14:27:31"}

Example of getmessagelist:

https://get.spiricom.spirius.com:55001/cgi-bin/getmessagelist?User=myuser&Pass=mypassword

The message below is an example of a valid response to getmessagelist.

HTTP/1.1 200 OK
Server: SPIRIcom/1.0
Date: Tue, 02 Oct 2018 14:46:43 GMT
Content-Length: 86
Content-type: text/html
Pragma: no-cache
Cache-Control: no-cache

{"Result": 1, "Messages": [{"TransactionId": "dca03424-25d5-4652-8b16-ac078978241e"}]}

Example of getmessageforid:

https://get.spiricom.spirius.com:55001/cgi-bin/getmessageforid?TransactionId=dca03424-25d5-4652-8b16-ac078978241e&User=myuser&Pass=mypassword

The message below is an example of a valid response to getmessageforid.

HTTP/1.1 200 OK
Server: SPIRIcom/1.0
Date: Tue, 02 Oct 2018 14:49:34 GMT
Content-Length: 164
Content-type: text/html
Pragma: no-cache
Cache-Control: no-cache

{"Result": 1, "From": "+46123456789", "FromType": "I", "To": "+46731297001", "ToType": "I", "Msg": "Hello world ", "MsgType": 0, "Timestamp": "2018-10-02 14:46:39"}

3. DELIVERY REPORTS

3.1 Push

The message below is an example of a GET-request sent from Spirius SMS Gateway, containing the report for transaction id bc757d8a-a0db-4e0d-a388-bf6d6eee0d87.

GET /dlr HTTP/1.1
Connection: keep-alive
User-Agent: SPIRIcom/1.0
X-Transaction-Id: bc757d8a-a0db-4e0d-a388-bf6d6eee0d87
X-Timestamp: 2018-10-03 13:26:00
X-Result: Delivered

The message below is an example of a valid response to a delivery report. Delivery reports will be resent until acknowledged with HTTP status code 200 OK.

HTTP/1.1 200 OK
Connection: close

3.2 Pull

The message below is an example of a GET-request sent to SMS Gateway, to request the status of transaction id bc757d8a-a0db-4e0d-a388-bf6d6eee0d87.

https://get.spiricom.spirius.com:55001/cgi-bin/getmessagestatus?User=myuser&Pass=mypassword&TransactionId=bc757d8a-a0db-4e0d-a388-bf6d6eee0d87

The message below is an example of a valid response.

HTTP/1.1 200 OK
Server: SPIRIcom/1.0
Date: Thu, 09 Sep 2010 13:10:20 GMT
Content-Length: 31
Content-type: text/html
Pragma: no-cache
Cache-Control: no-cache
{"Result": 1, "StatusCode": 1}