beautypg.com

Grandstream GXP2200 GMI Web Service Guide User Manual

Page 16

background image

GXP2200 GMI WEB SERVICE GUIDE V1.0

Page 15 of 38

mobile; //Mobile number

fax; //Fax number

mail; //Email address

}
• If ctID is empty, contact will be added with a ctID in the returned info. If ctID is

existed, contact ctID will be edited

• If contacts need to be added in batch, it is recommended to use setPhonebook

interface to import the contacts

Parameters

• PhbkContact: Contact information
• callbackFunction: Call back function

HTTP Request

• url: "http://"+ ip + "/manager?"
• action: "setcontact"
• contactInfo: ctID::ctName::gpID::work::home::mobile::fax::mail
• format: "json"
• jsoncallback: "?" (This is the HTTP request for the call back function, usually used in

AJAX and JQuery)

• For example:

http://192.168.121.230/manager?action=setcontact&contactInfo=1::grandstream::0::

5211::2512::1234::0120::::&format=json&jsoncallback=?

Return

1. HTTP request return:
• Return successful

"{"res": "success", "msg": "1"}" //ctID is "1"

• Return failed

"{"res": "error", "msg" : "can't set contact"}"

• "contactInfo" is empty

"{"res" : "error", "msg": "contact information is empty" }"

• Contact setup failed

"{"res" : "error", "msg": "set contact failed" }"

• "contactInfo" wrong format

"{"res" : "error", "msg": "wrong format" }"

• Database operation error (GMI version 9 or newer)

"{"res" : "error", "msg": "0" }"

2. callbackFunction(data) will process the data returned from HTTP request