Api documentation

Documentation | SmsGateway24.com

v.1.0

1. Getting a token:

Description: Upon successful execution of this query, you will receive a token. Subsequently, you can use this token to access the server and make additional requests.
Endpoint: https://smsgateway24.com/getdata/gettoken
Method:: GET
Parameters of the request:
Variable Type Description
email string [required] Your login in the system. Usually email
pass string [required] Your password in the system

JSON-formatted response::
Variable Type Description
token string Your token is acquired through the token retrieval method:
error int 0 | 1 - indicates whether there is an error in processing the request
message string Error message, empty if everything is in order.
Link to code example Curl
Link to code example Guzzle
Example of the response:
{"error":0,"message":"OK","token":"abbde3e31e9d026c02f41119fc551111e"}
or
{"error":1,"message":"Login or password incorrect"}

2. Send single SMS using TOKEN:

Description: Generates SMS messages on the server to be sent collectively in a single batch. Enables the creation of multiple SMS messages simultaneously through a single request.
Endpoint: https://smsgateway24.com/getdata/addsms
Method:: GET, POST ( Use %2B instead of the plus sign '+' in the GET request )
Parameters of the request:
Variable Type Description
token string [required] Your token is acquired through the token retrieval method.
sendto string [required]Phone number of the subscriber. All characters are permissible. For example: +4915752982212, +4917642111111, +1 17642031984. Alternatively, multiple numbers can be specified separated by commas
body string [required] Message body
device_id string [required] Device ID
timetosend string
YYYY-MM-DD
or
YYYY-MM-DD HH:MM:SS
[optional] Time designated for sending a message. For instance, 2024-04-20 13:56:50
sim int, default = 0 [optional] SIM slot # 0 or 1
customerid int [optional] Your customer's ID number. Optional field.
urgent int [optional] SMS marked as urgent. This field is optional. The SMS will be sent with priority, and it can be beneficial when sending one-time passwords (OTPs).

JSON-formatted response::
Variable Type Description
token string Your token is acquired through the token retrieval method:
error int 0 | 1 - indicates whether there is an error in processing the request
message string Error message, empty if everything is in order.
Link to code example Curl
Link to code example Guzzle
Example of the response:
{ "error": 0, "sms_id": 62807347, "message": "Sms has been saved successfully"}

2.1 Send single SMS using login and password:

Description: Generates SMS messages on the server to be sent collectively in a single batch. Enables the creation of multiple SMS messages simultaneously through a single request.
Endpoint: https://smsgateway24.com/getdata/smstosend
Method:: GET, POST ( Use %2B instead of the plus sign '+' in the GET request )
Parameters of the request:
Variable Type Description
email string [required] Your email
pass string [required] Your password
sendto string [required]Phone number of the subscriber. All characters are permissible. For example: +4915752982212, +4917642111111, +1 17642031984. Alternatively, multiple numbers can be specified separated by commas
body string [required] Message body
device_id string [required] Device ID
timetosend string
YYYY-MM-DD
or
YYYY-MM-DD HH:MM:SS
[optional] Time designated for sending a message. For instance, 2024-04-20 13:56:50
sim int, default = 0 [optional] SIM slot # 0 or 1
customerid int [optional] Your customer's ID number. Optional field.
urgent int [optional] SMS marked as urgent. This field is optional. The SMS will be sent with priority, and it can be beneficial when sending one-time passwords (OTPs).

JSON-formatted response::
Variable Type Description
token string Your token is acquired through the token retrieval method:
error int 0 | 1 - indicates whether there is an error in processing the request
message string Error message, empty if everything is in order.
Link to code example Curl
Link to code example Guzzle
Example of the response:
{ "error": 0, "sms_id": 62807347, "message": "Sms has been saved successfully"}

3. Sending SMS in bulk using JSON

Description: Creates SMS on the server to send. After that, the phone with the Smsgateway24 application calls the server and takes the SMS and sends it from your sim card Download the application at the link
Endpoint: https://smsgateway24.com/getdata/addalotofsms
Method:: GET, POST
Parameters of the request:
Variable Type Description
datajson string [required] {"token":"df427bfcf113c9a21c67718035076b5b","smsdata":[{"sendto":"015752982212","body":"Test message","sim":1,"timetosend":"2019-07-01 23:50:00","device_id":260},{"sendto":"+4915752982212","body":"Test message 2","sim":1,"timetosend":"2019-07-01 23:50:00","device_id":260,"urgent":1}]}

JSON-formatted response::
Variable Type Description
error int 0 | 1 - indicates whether there is an error in processing the request
message string Error message, empty if everything is in order.
Link to code example Curl
Link to code example Guzzle
Request example:
{ "token":"df427bfcf113c9a21c6771803501", "smsdata":[ { "sendto":"015752982212", "body":"Your password is 12345", "sim":1, "timetosend":"2019-07-01 23:50:00", "device_id":260, "customerid":122, "urgent":1 }, { "sendto":"015752982212", "body":"Regular SMS. Not urgnet", "sim":1, "timetosend":"2019-07-01 23:50:00", "device_id":260, "customerid":122, "urgent":0 } ] }

4. Get all SMS (Including incoming SMS):

Description: This request allows you to retrieve all messages associated with your account, including incoming SMS from customers. All input variables are mandatory in this method, and SMS messages may vary in status.
Endpoint: https://smsgateway24.com/getdata/getallsms
Method: GET, POST (Use %2B instead of the plus sign "+" in the GET request)
Parameters of the request:
Variable Type Description
token string [required] Your token is acquired through the token retrieval method.
device_id string [optional] Device ID
status int [optional]
  • 1 - Pending SMS
  • 2 - SMS taken by phone
  • 3 - Queued for sending. Certainly, it would have been more logical to place the status "queued for sending" before "SMS taken by phone," but for backward compatibility, the statuses are in the following order: 1, 3, 2."
  • 5 - Incoming SMS
  • 6 - SMS Sent by Phone
  • 7 - SMS has been Delivered
  • 8 - SMS was NOT Delivered
  • 9 - SMS didn't SENT at all - Generic failure. (Read what to do with this error here)
  • Other, less common errors:
  • 10 - SMS Not Sent - No Service
  • 11 - SMS Not Sent - Null PDU
  • 12 - SMS Not Sent - Radio Off
  • 100, 101 - SMS Not Sent - NOT ALLOWED. (Permissions for sending SMS in the application were not granted)
begindate string
YYYY-MM-DD
or
YYYY-MM-DD HH:MM:SS
[optional] Begin Date Time
enddate string
YYYY-MM-DD
or
YYYY-MM-DD HH:MM:SS
[optional] End Date Time
sim int [optional] SIM slot # 0 or 1
customerid int [optional] Your customer's ID number. Optional field
onlycount int [optional] 0 | 1 count only
phone string [optional] 0 | 1 Phone number filter
orderbydesc int [optional] 0 | 1 Order by any field
timezone int [optional] Specify your local time zone, such as setting it to Australia/Sydney, for example.

JSON-formatted response::
Variable Type Description
token string Your token is acquired through the token retrieval method:
error int 0 | 1 - indicates whether there is an error in processing the request
message string Error message, empty if everything is in order
count int SMS amount
smss int JSON object
Link to code example Curl
Link to code example Guzzle
Example of the response ... :
{ "smss": { "62050971": { "id": 62050971, "sendto": "+4912312312332", "body": "Hello! Thank you for Order! ", "customerid": null, "status": 2, "statustitle": "sending", "deviceid": 11231, "urgent": null, "created": { "date": "2023-11-02 22:44:43.000000", "timezone_type": 3, "timezone": "Europe/Paris" }, "senttime": null, "timetosend": null, "paketid": null, "pakettitle": null, "paketbody": null }, "62051117": { "id": 62051117, "sendto": "+4912312312332", "body": "Hello! Thank you for Order! ", "customerid": null, "status": 7, "statustitle": "delivered", "deviceid": 11231, "urgent": null, "created": { "date": "2023-11-02 22:46:09.000000", "timezone_type": 3, "timezone": "Europe/Paris" }, "senttime": null, "timetosend": null, "paketid": null, "pakettitle": null, "paketbody": null } } }

5. Add a new Contact list

Description: The tag is required for generating a newsletter targeting a group of numbers. For instance, use the tag Employees
Endpoint: https://smsgateway24.com/getdata/savetag
Method:: GET, POST
Parameters of the request:
Variable Type Description
token string [required] Your token is acquired through the token retrieval method.
title string [required] Tag name

JSON-formatted response::
Variable Type Description
tag_id int Tag ID
error int 0 | 1 - indicates whether there is an error in processing the request
message string Error message, empty if everything is in order.
Link to code example Curl
Link to code example Guzzle
Example of the response:
{ "error": 0, "tag_id": 8303, "message": "OK" }

6. Add contacts to Contact list:

Description: Add contacts for any tag. For example, for the tag * Employees * your colleagues will perfectly fit.
Endpoint: https://smsgateway24.com/getdata/savecontact
Method:: GET, POST
Parameters of the request:
Variable Type Description
token string [required] Your token is acquired through the token retrieval method.
phone string [required] phone number
ctag_id int [required] Tag ID
fullname string [required] Your customer's name

JSON-formatted response::
Variable Type Description
contact_id int Contact Id
error int 0 | 1 - indicates whether there is an error in processing the request
message string Error message, empty if everything is in order.
Link to code example Curl
Link to code example Guzzle
Example of the response ... :
{"error":0,"contact_id":15954765,"message":"ok"}

7. Create a Newsletter

Description:Once you have created the tag, you can do the mailing on the tag phones.
Endpoint: https://smsgateway24.com/getdata/savepaket
Method:: GET, POST
Parameters of the request:
Variable Type Description
token string [required] Your token is acquired through the token retrieval method.
title string [required] Newsletter title
device_id string [required] Device ID
body string [required] Target message body
tags string [required] Tag Id. Can be several, separated by commas. For example: 12,13,14
sim int, default = 0 [required]sim slot number in the phone: 0 or 1
time_to_send int, default = 0 [required]Date time when Newsletter should be sent. Do not forget tap start on device. DD.MM.YYYY H:i:s

JSON-formatted response::
Variable Type Description
contact_id int Contact Id
error int 0 | 1 - indicates whether there is an error in processing the request
message string Error message, empty if everything is in order.
paket_id int Package ID
Link to code example Curl
Link to code example Guzzle
Example of the response ... :
{"error":0,"message":"OK","token":"abbde3e31e9d026c02f4f49fc551111e"}
or
{"error":1,"message":"Login or password incorrect"}

8. Get device list

Description: You can find out all about your devices.
Endpoint: https://smsgateway24.com/getdata/getalldevices
Method:: GET, POST
Parameters of the request:
Variable Type Description
token string [required] Your token is acquired through the token retrieval method.

JSON-formatted response::
Variable Type Description
count int Number of devices:
device json
  • id - Device ID
  • title - Device Name
  • created - Device Creation Date
  • createdhumanformat - Date created device in regular format
  • lastseen - The date the device was last seen
  • lastseenhumanformat - The date the device was last seen
  • serialnumber - Device serial number
  • siminfo - Information about SIM cards in JSON
  • appversion - The version of the application installed on the device
  • subscription - Is there a subscription on the device
message string Error message, empty if everything is in order.
Link to code example Curl
Link to code example Guzzle
Example of the response:
    {
    "count": 2,
    "device": {
        "1576": {
            "id": 1576,
            "title": "AOSP_on_IA_Emulator",
            "number": null,
            "imei": "358240051111110",
            "created": {
                "date": "2020-03-28 20:10:29.000000",
                "timezone_type": 3,
                "timezone": "UTC"
            },
            "createdhumanformat": "28.03.2020 20:10:29",
            "lastseen": {
                "date": "2020-04-23 17:02:21.000000",
                "timezone_type": 3,
                "timezone": "UTC"
            },
            "lastseenhumanformat": "23.04.2020 17:02:21",
            "serialnumber": "EMULATOR30X0X5X0",
            "siminfo": [
                {
                    "Slot": "0",
                    "IccId": "89014103211118510720",
                    "Number": " 15555215554",
                    "Roaming": "0",
                    "CountryIso": "us",
                    "CarrierName": "Android (T-Mobile)"
                }
            ],
            "appversion": "12.1.21",
            "isappversionactual": false,
            "delaybetweeneachsms": null,
            "delaybetweenrequest": 1,
            "subscription": true
        },
        "1297": {
            "id": 1297,
            "title": "Android_SDK_built_for_x86",
            "number": null,
            "imei": "null",
            "created": {
                "date": "2020-01-20 14:01:05.000000",
                "timezone_type": 3,
                "timezone": "UTC"
            },
            "createdhumanformat": "20.01.2020 14:01:05",
            "lastseen": {
                "date": "2020-04-20 20:51:34.000000",
                "timezone_type": 3,
                "timezone": "UTC"
            },
            "lastseenhumanformat": "20.04.2020 20:51:34",
            "serialnumber": "unknown",
            "siminfo": [
                {
                    "Slot": "0",
                    "IccId": "8949226172233934327",
                    "Number": "+4915752982212",
                    "Roaming": "1",
                    "CountryIso": "de",
                    "CarrierName": "Drillisch (o2)"
                }
            ],
            "appversion": "12.1.21",
            "isappversionactual": false,
            "delaybetweeneachsms": 5,
            "delaybetweenrequest": 10,
            "subscription": false
        }
    }
}

9. Get the Delivery Status of a single SMS

Description: You can find out the delivery status of each SMS using this method
Endpoint: https://smsgateway24.com/getdata/getsmsstatus
Method:: GET, POST
Parameters of the request:
Variable Type Description
token string [required] Your token is acquired through the token retrieval method.
sms_id int [required] Sms Id

JSON-formatted response::
Variable Type Description
sms_id int SMS ID
status int SMS Status
  • 1 - Pending SMS
  • 2 - SMS taken by phone
  • 3 - Queued for sending. Certainly, it would have been more logical to place the status "queued for sending" before "SMS taken by phone," but for backward compatibility, the statuses are in the following order: 1, 3, 2."
  • 5 - Incoming SMS
  • 6 - SMS Sent by Phone
  • 7 - SMS has been Delivered
  • 8 - SMS was NOT Delivered
  • 9 - SMS didn't SENT at all - Generic failure. (Read what to do with this error here)
  • Other, less common errors:
  • 10 - SMS Not Sent - No Service
  • 11 - SMS Not Sent - Null PDU
  • 12 - SMS Not Sent - Radio Off
  • 100, 101 - SMS Not Sent - NOT ALLOWED. (Permissions for sending SMS in the application were not granted)
status_description string Status Name
error int 0 | 1 - is there an error in processing the request
message string Error message, empty if everything is in order.
Link to code example Curl
Link to code example Guzzle
Example of the response:
{"error":0,"message":"OK","token":"abbde3e31e9d026c02f4f49fc551111e"}
or
{"error":1,"message":"Login or password incorrect"}