Skip to content

API Examples

Send SMS request

Request

1
2
3
4
curl -i -X'POST' "https://srp.spirius.com:55001/v1/replypath/sendsms"
-u User:Pass
-H 'Content-Type: application/json'
-d '{"To":"+4612345;+4667890", "Msg":"abc","DLR":1,"VP":60,"OneShot":1}'

Response, example 1

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 243
Date: Tue, 20 Sep 2016 14:55:47 GMT
Server: 0.0.0.0
[
    {
        "DestinationAddress": "+4612345",
        "TransactionId": "ec69cd46-e337-4c01-b20b-656124bc86ae"
    },
    {
        "DestinationAddress": "+4667890",
        "TransactionId": "ea552fb5-2e7f-4d49-988f-182fc6298da2"
    }
]

Response, example 2 - with 409 Rate Limit Exceeded

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 258
Date: Tue, 20 Sep 2016 14:58:12 GMT
Server: 0.0.0.0
[
    {
        "DestinationAddress": "+4612345",
        "TransactionId": "ccc3d04a-5eb3-44a2-9e94-427f1e8de46c"
    },
    {
        "DestinationAddress": "+4667890",
        "ErrorCode": "409",
        "ErrorDescription": "Rate limit exceeded"
    }
]

Receive user responses

The replypath URL configured for the account shown in the examples below is http://hostname:80/reply.

HTTP GET

1
127.0.0.1 - - [15/Sep/2016 20:31:45] "GET /reply?Msg=Ja+tack&InResponseTo=2531e755-71d0-4449-bb0c-e5657d13c570

HTTP POST

1
2
3
4
5
6
127.0.0.1 - - [15/Sep/2016 20:59:10] "POST /reply HTTP/1.1" 200 -
{
    "From": "+4612345",
    "InResponseTo": "21d318ca-6598-4e3a-9212-f6b8ab5e79ae",
    "Msg": "Ja tack"
}

Email

The E-mail delivery is mainly for testing purposes. Beware that a large number of emails might trigger SPAM filters.