API for Developers

Here is an example of the API String

app.bearsms.com/index.php?app=ws&u=USERNAME&h=HASHKEY&op=pv&to=9725051234567&msg=hello+world

u = Username
h = password (Hashkey)

api-picture

Parameters

Listed in the below table are webservices parameters for individual tasks.

NameDescription
hwebservices token, configured by user from Preferences menu
uusername
ppassword, supplied for op=get_token
opoperation or type of action
formatoutput format selection
fromSMS sender ID (for op=pv)
todestination numbers, @username or #groupcode, may use commas
footerSMS footer (for op=pv)
nofooterremove SMS footer
msgmessage (+ or %20 for spaces, urlencode for non ascii chars)
scheduleschedule message delivery, format: YYYY-MM-DD hh:mm:ss
typemessage type (flash or text)
unicodewhether message unicode or not (1=unicode, 0=not unicode)
queuequeue code
srcsender number or ID
dstdestination number (single number)
dtsend SMS date/time
smslog_idSMS Log ID
lastlast SMS log ID (this number not included on result)
cnumber of delivery status that will be retrieved
kwdkeyword
login_keylogin key sets by admin through webservices call op=loginkeyset
queryquery server for useful information

Listed in the below table are webservices parameters for admin tasks.

NameDescription
recvnumreceiver number (for op=inject)
smscSMSC (for op=inject)
data_*admin tasks related supplied data

Please note that all values should be URL encoded.

Return Codes

Below table listed return coded after unsuccessful call to a webservices operation. Successful operation will returns an OK data in the response message.

Please note that by default the response message is a JSON encoded message.

Error codeDescription
ERR 100authentication failed
ERR 101type of action is invalid or unknown
ERR 102one or more field empty
ERR 103not enough credit for this operation
ERR 104webservice token is not available
ERR 105webservice token not enable for this user
ERR 106webservice token not allowed from this IP address
ERR 200send message failed
ERR 201destination number or message is empty
ERR 400no delivery status available
ERR 401no delivery status retrieved and SMS still in queue
ERR 402no delivery status retrieved and SMS has been processed from queue
ERR 501no data returned or result is empty
ERR 600admin level authentication failed
ERR 601inject message failed
ERR 602sender id or message is empty
ERR 603account addition failed due to missing data
ERR 604fail to add account
ERR 605account removal failed due to unknown username
ERR 606fail to remove account
ERR 607set parent failed due to unknown username
ERR 608fail to set parent
ERR 609get parent failed due to unknown username
ERR 610fail to get parent
ERR 611account ban failed due to unknown username
ERR 612fail to ban account
ERR 613account unban failed due to unknown username
ERR 614fail to unban account
ERR 615editing account preferences failed due to missing data
ERR 616fail to edit account preferences
ERR 617editing account configuration failed due to missing data
ERR 618fail to edit account configuration
ERR 619viewing credit failed due to missing data
ERR 620fail to view credit
ERR 621adding credit failed due to missing data
ERR 622fail to add credit
ERR 623deducting credit failed due to missing data
ERR 624fail to deduct credit
ERR 625setting login key failed due to missing data
ERR 626fail to set login key

There might appear new error codes in the future, you should be aware that new codes might appear in this syntax:

Error codeDescription
ERR 1xxauthentication or parameter erorrs
ERR 2xxspecific pv errors
ERR 4xxdelivery status errors
ERR 5xxothers
ERR 6xxadministrative tasks

I am text block. Click edit button to change this text. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Ut elit tellus, luctus nec ullamcorper mattis, pulvinar dapibus leo.