API

User authorization

Sign in to check your authentication information.


Authorization

All API require authentication. Please set Authorization on http request header.

Authorization: token <Authorization Token>

Send One SMS

POST https://api.smsdove.com/v1/account/:AccountID/sms

Parameters

Name Type Description
To string Required. Phone number to receive text messages
Msg string Required. SMS content
Content-Type: application/json

{
  "To": "12345678",
  "Msg": "text message"
}

Response

Status: 201 Created
Location: https://api.smsdove.com/v1/account/1/sms/137

{
  "Id": 137
}

SMS Bulk Send

PATCH https://api.smsdove.com/v1/account/:AccountID/sms

Parameters

Content-Type: application/json

[
  {
    "To": "12345678",
    "Msg": "text message 1"
  },
  {
    "To": "456789123",
    "Msg": "text message 2"
  }
]

Response

Status: 201 Created

[
  {
    "Id": 157
  },
  {
    "Id": 158
  }
]

Note: A single request can contain up to 100 messages.

Get SMS

GET https://api.smsdove.com/v1/account/:AccountID/sms/:sms_id

Response

Status: 200 OK

{
  "Id": 137,
  "UserId": 1,
  "To": "12345678",
  "Msg": "test message",
  "Status": "failed",
  "Ctime": "2016-11-18T11:27:49+00:00",
  "ReportTime": "2016-11-18T11:27:49+00:00",
  "ReportMsg": "Error: 9999 no active device",
  "DeviceId": 120
}

Status are: accepted, queued, sent, failed.

SMS Send Status Callback

POST :callback_url

Parameters

Name Type Description
Id int sms id
Status string queued, sent, failed
Error string Error message for failed status.
Time string e.g. 2016-11-10T16:58:02.064691Z
Content-Type: application/json
X-Body-Sign: d7ceb3981bf700758243a0f17240084e

{
  "Id": 137,
  "Status": "failed",
  "Error": "Error: 9999 no active device",
  "Time": "2016-11-18T11:27:49.064691Z"
}

Response

OK
Important: Each status sends a request to :callback_url ,and you must return OK (2 characters).
Otherwise, the request will be resent in the next 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560 seconds (at most 11 requests).
You can use X-Body-Sign to verify the request, the rule is md5( <request Body> + <Authorization Token> ) == X-Body-Sign
Sms Send Status Callback URL
Sign in to set your :callback_url.

SMS Receive Callback

POST :callback_url

Parameters

Name Type Description
Id int received sms id (This ID is different from the ID of the sending SMS)
From string The sender's mobile number of the received message.
Msg string The content of the received SMS.
DeviceId string The device ID of the SMS received.
Time string e.g. 2016-11-10T16:58:02.064691Z
Content-Type: application/json
X-Body-Sign: 96aadbca96762027fe7505b84847bd17

{
  "Id": 1032,
  "From": "+123456789",
  "Msg": "test msg from me.",
  "DeviceId": 6,
  "Time": "2016-11-19T12:20:39.134652Z"
}

Response

OK
Important: Each received sms sends a request to :callback_url ,and you must return OK (2 characters).
Otherwise, the request will be resent in the next 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560 seconds (at most 11 requests).
You can use X-Body-Sign to verify the request, the rule is md5( <request Body> + <Authorization Token> ) == X-Body-Sign
Sms Receive Callback URL
Sign in to set your :callback_url.

SMS Device Callback

POST :callback_url

Parameters

Name Type Description
Id int device id
Status string INACTIVATED, SUSPENDED, TERMINATED, DISABLED, NOTCONNECTED, ACTIVE, ERROR
Error string Error message for ERROR status.
Time string e.g. 2016-11-10T16:58:02.064691Z
Content-Type: application/json
X-Body-Sign: 456210adbedbdf9b32df386c500cd183

{
  "Id": 13,
  "Status": "ERROR",
  "Error": "Error: 9999 SMS no service",
  "Time": "2016-11-18T11:27:49.064691Z"
}

Response

OK
Important: Each device state change sends a request to :callback_url ,and you must return OK (2 characters).
Otherwise, the request will be resent in the next 5, 10, 20, 40, 80, 160, 320, 640, 1280, 2560 seconds (at most 11 requests).
You can use X-Body-Sign to verify the request, the rule is md5( <request Body> + <Authorization Token> ) == X-Body-Sign
Device Callback URL
Sign in to set your :callback_url.
app download  OR  从应用宝安装 从应用宝安装   Install the app on the Android phone that sent the message.