Sarv.com

SMS HTTP API Documentation

Transactional Route

http://manage.sarvsms.com/api/send_transactional_sms.php?username=USER_ID&msg_token=USER_ID_TOKEN&sender_id=SENDER_ID_TEXT&message=MSG&mobile=MOBILE_NO

Other Route

http://manage.sarvsms.com/api/MSG_TYPE?username=USER_ID&msg_token=USER_ID_TOKEN&message=MSG&mobile=MOBILE_NO
STANZA Detail Value Type
MSG_TYPE Type of message to send. It is a file name. See below table for detail. File name ,
USER_ID Your user id by which you want to send message String
USER_ID_TOKEN Every user have a unique message token for authentication. Get it from panel. Eg. XXXXXX Get it from panel. 6 character length
SENDER_ID_TEXT Submit message from sender id XXXXXX 6 char
MSG Your message text String
MOBILE_NO Message sending to this no. 9876543210 10 digits number

MSG_TYPE

MSG_TYPE VALUE
Normal send_general_sms.php
Priority send_priority_sms.php
Promotional send_promotional_sms.php
Transactional send_transactional_sms.php
Enterprise send_enterprise_sms.php

Response

Response Meaning
ERROR : PARAMETAR_MISSING parameters are missing
ERROR : INVALID USERTYPE Invalid user id
ERROR : MESSAGE_BLANK Message is blank
ERROR : MAXIMUM_MOBILE_NO_EXCEED 15 mobile no’s are allowed at a time
ERROR : INVALID_MOBILE_NO - not a valid mobile number
ERROR : USER_INACTIVE user is inactive
ERROR : INVALID_SENDER_ID sender id is not valid
ERROR : INVALID_CREDENTIALS invalid user id
ERROR : INVALID_ARGUMENTS parameter is missing
ERROR :UNSUFFICIENT_PROCESSING_CR not sufficient credits
ERROR :PROCESSING_CR_VALIDITY_EXPIRED Processing Credit validity expired
ERROR :UNSUFFICIENT_CR user have not sufficient credits
ERROR :CR_VALIDITY_EXPIRED Credit validity expired
ERROR :INVALID_OWNER user parent id is not valid
ERROR :UNSUFFICIENT_PROCESSING_CR_OWNER parent not have sufficient processing credits
ERROR :CR_VALIDITY_EXPIRED_OWNER up hierarchy credit validity expired
SUCCESS :<MOBILE_NO,CAMPAIGN_ID MSG_ID_PREFIX ID> 10 digit mobile number, campaign id is in digits, msg_id_prefix is string,
If message is send on more than one contact then output will be like, SUCCESS :<MOBILE_NO,CAMPAIGN_ID MSG_ID_PREFIX ID> <MOBILE_NO,CAMPAIGN_ID MSG_ID_PREFIX ID> MSG_ID_PREFIX see below table

MSG_ID_PREFIX Table

MSG_ID_PREFIX DETAIL
gr General SMS
tr Transactional SMS
en Enterprise SMS
pr Priority SMS
po Promotional SMS

Campaign Status API

http://manage.sarvsms.com/api/campaign_status_api.php?myuid=USER_ID&mytoken=USER_TOKEN&mycmp=CAMPAIGN_ID
STANZA Detail Value Type
USER_ID Your user id by which you want to send message String
USER_TOKEN Every user have a unique message token for authentication. Get it from panel. XXXXXX 6 Character Length
CAMPAIGN_ID user campaign id 2356 Integer

Response

Response Meaning
ERROR :INVALID_MYUID user id is not valid or blank
ERROR :INVALID_MYTOKEN invalid user token or blank
ERROR :INVALID_MYCMP invalid campaign id or blank
ERROR:INVALID_PARAMETER parameter not set
SUCCESS:STATUS see Status table

Status

Status
INPROGRESS
DELIVERED
VERIFYING
PAUSED
COMPLETE
UNKNOWN

DID No. Misscall Api

http://manage.sarvsms.com/api/api_get_misscall_did_no_data.php?username=USER_ID&msg_token=USER_MSG_TOKEN&did_no=DID_NO&start_from=START_FROM_RECORD_NUMBER
STANZA Detail Value Type
USER_ID Your user id by which you want to send message sr1 String
USER_MSG_TOKEN Every user have a unique message token for authentication. Get it from panel. XXXXXX 6 Character Length
DID_NO did no which is allot for you 9876543210 10 digits number
START_FROM_RECORD_NUMBER get data after numbers of record EX : if have 100 records from this did no. and we pass 10, now api get after 10 records data 0/1/100 any no digit date

Response

Error Case :

{"msg":"ERROR","msg_text":"ERROR TEXT "} 

Success Case :

{"msg":"SUCCESS","msg_text":"DATA FETCH","data"null/json_data”} 

Note see json data :

If no result found from this did number than return below

{"msg":"SUCCESS","msg_text":"DATA FETCH","data":null}

Else return below

{"msg":"SUCCESS","msg_text":"data FETCH","data":[{"sn":2,"mob_no":"7727884183","date":"09-May-2015","time":"6:05:07 PM"} ,{"sn":3,"mob_no":"7727884183","date":"09-May-2015","time":"6:06:24 PM"} ]}


STANZA Detail Value Type
sn simple result counting 1 to up to result digits
mobile_no mobile no 8989898989 10 digits mobile no
date calling date text date string
time calling time text time string

Response

Response Meaning
ERROR : START FROM MUST BE IN DIGITS start from record is not digits
ERROR : PARAMETER MISSING token / password not set
ERROR : USER IS INACTIVE user not active
ERROR: INVALID ADMIN TYPE user parent id is not valid
ERROR: ADMIN IS INACTIVE user parent id is not active
ERROR: INVALID ADMIN user parent id is not exist
ERROR: DID NO VALIDITY IS EXPIRED did no validity expired due to not pay next bill
ERROR : DID NO PLAN VALIDITY IS EXPIRED did no plan validity expired
ERROR: SOME ERROR IN DATA FETCH undefined error
ERROR : SOME ERROR IN DATA FETCH Undefined error
ERROR : PLAN SUMMARY NOT FOUND user`s plan detail no longer exist
ERROR : PLAN IS NOT ADDED plan not added from did no.
ERROR: DID NO NOT UNDER YOU not allot did no to user
ERROR : INVALID DID NO no entry exist for this did no
ERROR : INVALID CREDENTIALS invalid user id
ERROR : INVALID ARGUMENTS parameter not set
Success
SUCCESS: DATA FETCH

DID No. PUSH API

http://YOUR_DOMAIN_NAME/PATH/TO/API/?[OPTIONAL_ARGUMENTS]&mobile=%%MOBILE%%&did_no=%%DID_NO%%&auto_reg_no=%%REG_NO%%&time=%%TIME%%
STANZA Detail Value
YOUR_DOMAIN_NAME user domain name see example
this is user’s push api. User will insert the url as he wants Our system will replace the %%something%% with specific value of miscall data in user’s push api URL. The values that are replaced by the system are given as belows
%%MOBILE%% replace miscaller mobile no 10 digits
%%DID_NO%% replace with did no
%%REG_NO%% replace with auto registration no of misscaller
%%TIME%% replace with the time of misscall

Example :