In order to use SMSEagle for sending or receiving messages from any external application or system you have, we have provided the following HTTP/HTTPS API functionalities.

If you would like to seamlessly and quickly start using SMSEagle’s HTTP API you may also look at code samples page

Notice: API can be used with HTTP or HTTPS protocol (HTTPS is supported from software version 2.7).

Send SMS: HTTP GET method

Sample Query:
http://url-of-smseagle/index.php/http_api/send_sms?login=john&pass=doe&to=1234567&message=mymessage
or
http://url-of-smseagle/index.php/http_api/send_sms?login=john&pass=doe&to=1234567&message=mymessage&date=201401152132
or
http://url-of-smseagle/index.php/http_api/send_sms?login=john&pass=doe&to=1234567&message=mymessage&highpriority=1

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
to: receipient telephone number (or numbers separated with comma)
message: your SMS message
date (optional parameter): date and time in format YYYYmmDDHHMM (YYYY – year, mm – month, DD – day, HH – hour, MM – minute). If this parameter is not null SMS will be scheduled for sending at the given date and time
highpriority (optional parameter): 0 = normal priority, 1 = SMS will have higher priority in Outbox queue when processed by GSM-modem
unicode (optional parameter): 0 = no Unicode encoding (default), 1 = SMS will be encoded using Unicode (you can send national characters)
flash (optional parameter): 0 = normal SMS (default), 1 = SMS will be sent as flash message
oid (optional parameter): This attribute specifies a user-defined unique ID that is assigned to a message-recipient pair. The oid is a varchar(36) that uniquely identifies a message sent to a particular recipient (particular phone number). The value of this ID allows client applications to match incoming reply messages to outgoing messages. If no oid was assigned to the outgoing message the oid attribute will have a value of null for incoming message

Response:
Response: OK; ID=[ID of message in outbox]
Sample response: OK; ID=297
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters): Wrong parameters

 

Notice:  You must encode URL before sending it to gateway if you use national characters in SMS message text.

Send SMS: JSONRPC method

HTTP POST method call: http://url-of-smseagle/index.php/jsonrpc/sms

Body:
{“method”:”sms.send_sms”, “params”:{“login”:”john”,”pass”:”doe”,”to”:”481234567″,”message”:”My message”}}
or
{“method”:”sms.send_sms”, “params”:{“login”:”john”,”pass”:”doe”,”to”:”481234567″,”message”:”My message”,”date”:”201401152132″}}
or
{“method”:”sms.send_sms”, “params”:{“login”:”john”,”pass”:”doe”,”to”:”481234567″,”message”:”My message”,”highpriority”:”1″}}

Response:
Response: {“result”: “OK; ID=[ID of message in outbox]”}
Sample response: {“result”: “OK; ID=297”}
Response: {“result”: “Invalid login or password”}
Response: {“result”: “Wrong parameters”}

Send SMS to a group: HTTP GET method

Sample Query:
http://url-of-smseagle/index.php/http_api/send_togroup?login=john&pass=doe&groupname=admins&message=mymessage
or
http://url-of-smseagle/index.php/http_api/send_togroup?login=john&pass=doe&groupname=admins&message=mymessage&date=201401152132
or
http://url-of-smseagle/index.php/http_api/send_togroup?login=john&pass=doe&groupname=admins&message=mymessage&highpriority=1

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
groupname: group name defined in your SMSEagle Phonebook. The group must be defined as Public
message: your SMS message
date (optional parameter): date and time in format YYYYmmDDHHMM (YYYY – year, mm – month, DD – day, HH – hour, MM – minute). If this parameter is not null SMS will be scheduled for sending at the given date and time
highpriority (optional parameter): 0 = normal priority, 1 = SMS will have higher priority in Outbox queue when processed by GSM-modem
unicode (optional parameter): 0 = no Unicode encoding (default), 1 = SMS will be encoded using Unicode (you can send national characters)
flash (optional parameter): 0 = normal SMS (default), 1 = SMS will be sent as flash message
oid (optional parameter): This attribute specifies a user-defined unique ID that is assigned to a message-recipient pair. The oid is a varchar(36) that uniquely identifies a message sent to a particular recipient (particular phone number). The value of this ID allows client applications to match incoming reply messages to outgoing messages. If no oid was assigned to the outgoing message this attribute will have a value of null for incoming message

Response:
Response: OK; ID=[ID of message in outbox]
Sample response: OK; ID=297
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters): Wrong parameters

Send binary SMS: HTTP GET method

Sample Query:
http://url-of-smseagle/index.php/http_api/send_binary_sms?login=john&pass=doe&to=1234567&udh=0605040B8423F0&data=EA0601AE02056A0045C60C037777772E736D736561676C652E657500080103534D534561676C65000101

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
to: receipient telephone number (or numbers separated with comma)
udh: UDH header for the message (in hex format)
data: binary message (in hex format)

Response:
Response: OK; ID=[ID of message in outbox]
Sample response: OK; ID=297
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters): Wrong or missing >>udh<< parameter
Response (when wrong parameters): Wrong or missing >>data<< parameter

Read SMS: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/read_sms?login=john&pass=doe&folder=inbox&idfrom=1234&limit=100&unread=1

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
folder: one of the following: inbox, outbox, sentitems
idfrom: (optional) minimal message-id
from: (optional) telephone number of SMS sender (for inbox)
to: (optional) telephone number of SMS receiver (for sentitems)
datefrom: (optional) date and time in format YYYYmmDDHHMMSS (YYYY – year, mm – month, DD – day, HH – hour, MM – minutes, SS – seconds). Show only messages sent/received on this date/time and later
dateto: (optional) date and time in format YYYYmmDDHHMMSS (YYYY – year, mm – month, DD – day, HH – hour, MM – minutes, SS – seconds). Show only messages sent/received on this date/time and earlier
limit: (optional) how many messages to show
unread: (optional) 1 = show only unread messages

Examples:
Show all messages from inbox:
http://url-of-smseagle/index.php/http_api/read_sms?login=john&pass=doe&folder=inbox
Show all unread messages from inbox:
http://url-of-smseagle/index.php/http_api/read_sms?login=john&pass=doe&folder=inbox&unread=1
Show messages from sentitems folder with id=1234 and higher. Limit number of messages to 5:
http://url-of-smseagle/index.php/http_api/read_sms?login=john&pass=doe&folder=sentitems&idfrom=1234&limit=5
Show messages from inbox folder with sender phone number +481234567:
http://url-of-smseagle/index.php/http_api/read_sms?login=john&pass=doe&folder=inbox&from=+481234567
Show messages from sentitems folder with receiver phone number 7654321 and datetime from 2014-12-24 08:10:00 to 2014-12-31 23:59:59:
http://url-of-smseagle/index.php/http_api/read_sms?login=john&pass=doe&folder=sentitems&to=7654321&datefrom=20141224081000&dateto=20141231235959

Response:
Sample responses: inbox folder, sentitems folder
Response (when no data): No data to display
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters): Wrong parameters

Delete SMS: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/delete_sms?login=john&pass=doe&folder=inbox&idfrom=1234&idto=1236

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
folder: one of the following: inbox, outbox, sentitems
idfrom: minimal id of message
idto: maximal id of message

Examples:
Delete message with id=1234 from inbox:
http://url-of-smseagle/index.php/http_api/delete_sms?login=john&pass=doe&folder=inbox&idfrom=1234&idto=1234
Delete messages with id 1234 – 1250 from inbox:
http://url-of-smseagle/index.php/http_api/delete_sms?login=john&pass=doe&folder=inbox&idfrom=1234&idto=1250
Delete all messages from outbox:
http://url-of-smseagle/index.php/http_api/delete_sms?login=john&pass=doe&folder=outbox&idfrom=1&idto=999999999

Response:
Response: OK
Response (when delete operation was not successful): Error
Response (when wrong logindata): Invalid login or password

Get outgoing queue length: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/get_queue_length?login=john&pass=doe

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle

Response:
Response: [number of messages in database that wait to be processed by GSM-modem]
Sample response: 7
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters): Wrong parameters

Get outgoing queue length: JSONRPC method

HTTP POST method call: http://url-of-smseagle/index.php/jsonrpc/sms

Body:
{“method”:”sms.get_queue_length”, “params”:{“login”:”john”,”pass”:”doe”}}

Response:
Response: {“result”: [number of messages in database that wait to be processed by GSM-modem]}
Sample response: {“result”:7}
Response: {“result”: “Invalid login or password”}
Response: {“result”: “Wrong parameters”}

Get inbox length: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/get_inbox_length?login=john&pass=doe

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle

Response:
Response: [number of messages in database Inbox folder]
Sample response: 3
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters): Wrong parameters

Get sentitems length: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/get_sentitems_length?login=john&pass=doe

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle

Response:
Response: [number of messages in database Sentitems folder]
Sample response: 21
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters): Wrong parameters

Get GSM signal strenght: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/get_gsmsignal?login=john&pass=doe&modem_no=1

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
modem_no (optional parameter): modem number to be queried (default = 1). Used only in multimodem devices

Response:
Response: GSM signal strength in percent (values between 0-100). If GSM modem is disconnected from GSM network, method returns -1
Sample response: 74
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters): Wrong parameters

Get GSM signal strenght: JSONRPC method

HTTP POST method call: http://url-of-smseagle/index.php/jsonrpc/sms

Body:
{“method”:”sms.get_gsmsignal”, “params”:{“login”:”john”,”pass”:”doe”}}

Response:
Response: {“result”: GSM signal strength in percent: values between 0-100. If GSM modem is disconnected from GSM network, method returns -1 }
Sample response: {“result”:7}
Response: {“result”: “Invalid login or password”}
Response: {“result”: “Wrong parameters”}

Phonebook group create: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/group_create?login=john&pass=doe&groupname=myusers&public=1

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
groupname: name for the created group
public (optional parameter): 0 = private group, 1 = public group

Response:
Response: OK; ID=[ID of created group]
Sample response: OK; ID=5
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters): Wrong or missing >>groupname<< parameter

Phonebook group read: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/group_read?login=john&pass=doe&public=1&uid=12

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
public (optional parameter): 0 = private group, 1 = public group
uid (optional parameter): id of user who created the group

Response:
Sample response: link
Response (when no data): No data to display
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters):
Wrong or missing >>uid<< parameter
Wrong or missing >>public<< parameter

Phonebook group update: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/group_update?login=john&pass=doe&group_id=2&groupname=myusers&public=1

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
group_id: id of existing group
groupname: name for the group
public (optional parameter): 0 = private group, 1 = public group

Response:
Response: OK
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters):
Wrong or missing >>groupname<< parameter
Wrong or missing >>group_id<< parameter
Response (when group_id is wrong): Group with the given id does not exists

Phonebook group delete: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/group_delete?login=john&pass=doe&group_id=2&groupname=myusers

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
group_id: id of existing group
groupname: name of existing group

Response:
Response: OK
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters):
Wrong or missing >>groupname<< parameter
Wrong or missing >>group_id<< parameter
Response (when group_id is wrong): Group with the given id and name does not exist

Phonebook group add contact: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/group_addcontact?login=john&pass=doe&group_id=2&contact_id=1

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
group_id: id of existing group
contact_id: id of contact. The contact will be added to the group

Response:
Response: OK
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters):
Wrong or missing >>group_id<< parameter
Wrong or missing >>contact_id<< parameter
Response (when id is wrong):
Group with the given id does not exists
Contact with the given id does not exists

Phonebook group remove contact: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/group_removecontact?login=john&pass=doe&group_id=2&contact_id=1

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
group_id: id of existing group
contact_id: id of contact. The contact will be removed  from the group

Response:
Response: OK
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters):
Wrong or missing >>group_id<< parameter
Wrong or missing >>contact_id<< parameter
Response (when id is wrong):
Group with the given id does not exists
Contact with the given id does not exists

Phonebook contact create: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/contact_create?login=john&pass=doe&contactname=johndoe&number=12345678&public=1

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
contactname: name for the created contact
number: telephone number for the created contact
public (optional parameter): 0 = private contact (default value), 1 = public contact

Response:
Response: OK; ID=[ID of created contact]
Sample response: OK; ID=2
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters):
Wrong or missing >>contactname<< parameter
Wrong or missing >>number<< parameter

Phonebook contact read: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/contact_read?login=john&pass=doe&public=1&uid=12

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
public (optional parameter): 0 = private contacts, 1 = public contacts
uid (optional parameter): id of user who created the contact

Response:
Sample response: link
Response (when no data): No data to display
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters):
Wrong or missing >>uid<< parameter
Wrong or missing >>public<< parameter

Phonebook contact update: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/contact_update?login=john&pass=doe&contact_id=4&contactname=johnlord&number=123456789&public=1

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
contact_id: id of existing contact
contactname: name for the contact
number: phone number for the contact
public (optional parameter): 0 = private group, 1 = public group

Response:
Response: OK
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters):
Wrong or missing >>contactname<< parameter
Wrong or missing >>contact_id<< parameter
Wrong or missing >>number<< parameter
Response (when contact_id is wrong): Contact with the given id does not exists

Phonebook contact delete: HTTP GET method

Sample Query: http://url-of-smseagle/index.php/http_api/contact_delete?login=john&pass=doe&contact_id=4&contactname=johnlord

Parameters:
login: your user to login to SMSEagle
pass: your password to login to SMSEagle
contact_id: id of existing contact
contactname: name of existing contact

Response:
Response: OK
Response (when wrong logindata): Invalid login or password
Response (when wrong parameters):
Wrong or missing >>contactname<< parameter
Wrong or missing >>contact_id<< parameter
Response (when group_id is wrong): Contact with the given id and name does not exists

Have a question or an idea? We can help you...

If you have any technical questions regarding HTTP API feel free to contact our Support Team.