• EN
  • IT

Authentication is done through the Apikey present in the SmsWay app (Dot menu    → Apikey)

Apikey can be passed to the server in 2 ways: 

  • in cookies by qualifier tokenapi
  • in the json parameters using the key tokenapi

Example: 

curl -k -X POST 'https://smsway.s7a.it/remote/smssend'
--cookie "tokenapi=MY_API_KEY"
-H "accept: application/json"
-H "Content-Type: application/json"
-d '{"tokenapi": "MY_API_KEY", …}'

both are valid for identifying the user (if both cookies are given priority)

Queries that use Apikey, in addition to the specific response codes for each call, will be able to return the following codes produced during the authentication phase: 

  • -21 Apikey is not valid
  • -22 invalid user role
  • -23 user disabled
  • -24 generic error
  • -25 unauthorized source ip address (only if a list of authorized ip has been specified, refer to updateuserinfo)

Sends a single text message of maximum standard length (160 characters).

If the text time quota has been reached (max number of text messages per minute, hour or day), then the text messages are discarded and the status will be canceled.


Action (POST): /remote/smssend


Parameters: 

  • recipientrecipient phone (digits only, no spaces, with country code)
  • smstextmessage text (truncated to 160 characters). For carriage return use the sequence \r\n
  • simsim number, referred to the device slot (optional). If not indicated or -1 then select the sim of slot 0

Response (json): 

  •  1 success
  •  0 push notification failed
  • -2 smsToken (credits) insufficient
  • -3 request above threshold (exceeds the set limits, if set)
  • -4 generic error
  • -5 international prefix not allowed (if set)

Please note:  the answer refers to the request of shipping. For information on the sending status of the sms use the smsgetlast api

Example: 

curl -k -X POST 'https://smsway.s7a.it/remote/smssend'
--cookie "tokenapi=MY_API_KEY"
-H "accept: application/json"
-H "Content-Type: application/json"
-d '{
"recipient": "3938012345678",
"smstext": "sms body text\r\nwith carriege return"
}'

Asks for information on the latest text messages sent.


Action (GET): /remote/smsgetlast


Parameters: 

  • qtysms number to return (default 10, max 100)

Response (json): 

  • recipient (string)recipient's phone number
  • tsreq (long ts ms)requested date
  • tsdelivered (long ts ms | null)shipping date
  • sim (int)sim slot number
  • smstext (string)sms text
  • state (int)delivery state
    1. request
    2. push notification failed
    3. sms sent
    4. sms not sent
    5. device no sms provider
    6. device null pdu
    7. device radio off
    8. sms delivered
    9. sms deleted
    10. service unavailable

Example: 

curl -k -X GET 'https://smsway.s7a.it/remote/smsgetlast'
--cookie "tokenapi=MY_API_KEY"
-H "accept: application/json"
-H "Content-Type: application/json"
-d '{
"qty": 2
}'


json response

{
"res": 1,
"smslist": [{
"recipient": "3938012345678",
"tsreq": 1592999866000,
"tsdelivered": 1592999867000,
"sim": 1,
"smstext": "sms body text",
"state": 1
}, {
"recipient": "3938012345678",
"tsreq": 1592984570000,
"tsdelivered": null,
"sim": 1,
"smstext": "sms body text",
"state": 2
}]
}

Receives the user configuration parameters


Action (GET): /remote/userinfo


Parameters: 

  • none

Response (json): 

  • res0 fails, 1 success
  • mobilephonedevice phone number
  • simsim used to send sms (in case of dual sim device). The number indicated refers to the internal slot (usually 0 or 1). Default -1 (automatic mode)
  • localeiso2mobile locale iso (it, en, de, ...)
  • mobiletimezonedevice timezone (-12 +12)
  • servertimezoneserver timezone (-12 +12)
  • adminphoneadmin phone number
  • maxdaymaximum number of text messages per day (if 0, no limit)
  • maxhourmaximum number of text messages per hour (if 0, no limit)
  • maxminmaximum number of text messages per minute (if 0, no limit)
  • ipv4grantlist of ipv4 authorized to send requests to the server (empty list = all granted)
  • prefixwhitelist of country codes to which sms can be sent (empty list = all allowed)

Example: 

curl -k -X GET 'https://smsway.s7a.it/remote/userinfo'
--cookie "tokenapi=MYTOKEN"
-H "accept: application/json"
-H "Content-Type: application/json"

Update user information


Action (POST): /remote/updateuserinfo


Parameters: 

  • adminphonesame of userinfo
  • maxdaysame of userinfo
  • maxhoursame of userinfo
  • maxminsame of userinfo
  • simsame of userinfo
  • ipv4grantipv4 list granted (es: “192.168.10.1,192.168.10.2,192.68.10.3”) WARNING: if you specify a wrong address, subsequent requests will be banned.
  • prefixwhitelist of allowed country codes. The list must be separated by commas. Ex: “39,1,44,” Requests from prefixes not listed will be rejected. If the list is empty then accept any prefix.

Only the parameters expressly indicated in the query are updated.


Response (json): 

  • res0 fails, 1 success

Example: 

curl -k -X POST 'https://smsway.s7a.it/remote/updateuserinfo'
--cookie "tokenapi=MYTOKEN"
-H "accept: application/json"
-H "Content-Type: application/json"
-d '{
"maxday" : 100,
"prefixwhite" : ""
}'

This site uses technical cookies to improve your navigation experience I GET IT

More information is available HERE