DooxSwitch Mobile API manual

From DooxSwitch wiki
Jump to: navigation, search

API FOR MOBILE PLATFORMS:

SendBOX

http://your-server-ip-or-domain.com/en/api/index.htm?act=login

to test and to check the API strings please use the url above

Registration

Registration of new users on our switch using your mobile application: (Get the country ID from attached, SQL file and retrieve country code, prompt user to enter number)

and send the request to http://your-server-ip-or-domain.com/en/api/ajax.htm


'jsonData={"act":"reg_step1","fields":{"country":"123","prefix":"456","number":"01234567890}}'

(Server will send SMS with 4 digit code, prompt user to enter it)


Device Registration

with this string you can register Devices ID and App ID for Push Notiffications

'jsonData={"act":"reg_step2","fields":{"code":"23dd3","user_id":"158",}}'

(Prompted to enter email and password)


'jsonData={"act":"reg_step3","fields":{"email":"[email protected]","user_id":"158","password":"123456

","password2":"123456","sipid":45""}}'

Loggin in

First we need to pass the login and password

'jsonData={"act":"login","fields":{"username":"45601234567890","password":"12345"}}'

it will return

{"status":"ok","text":"logged","userId":158}

then you can query the balance

Balance Enquiry

'jsonData={"act":"balance","fields":{"userId":"158"}}'

Contact book synchronization

Example of contact book synchronization

the query looks like this , we are passing phone numbers from the contact book to the server


'jsonData={"act":"sipList","fields":"numbers":["768876786]}'

the server will return the sip id of the user if phone number matches in this format

{"response":[{"sip_id":"0000","number":"768876786"}],"status":"ok"}