Getcontact(ctid, gpid, ctname, callbackfunction) – Grandstream GXP2200 GMI Web Service Guide User Manual
Page 12

GXP2200 GMI WEB SERVICE GUIDE V1.0
Page 11 of 38
HTTP Request
• url: "http://"+ ip + "/manager?"
• action: "getgroup"
• groupID: ""
• 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=getgroup&groupID=&format=json&jsoncall
back=?
Return
1. HTTP request return:
• Return successful
"{"res": "success", "msg":
[{"groupID":"0","groupName":"default"}, {"groupID":"100","groupName":"blacklist"}]}"
• No groups
"{"res": "error", "msg" : "0"}"
• Return failed
"{"res": "error", "msg" : "can't get groups information"}"
• Parameters in wrong format (GMI version 9 or newer)
"{"res": "error", "msg" : "wrong format"}"
2. callbackFunction(data) will process the data returned from HTTP request
12. getContact(ctID, gpID, ctName, callbackFunction)
Description
1. Retrieve contact information
• If ctID is specified but ctName is empty, return the contact ctID
• If ctName is specified, return the contacts which has string ctName in its name field
• If ctID and ctName are empty but gpID is specified, return all the contacts in group
gpID
• If ctID, ctName and gpID are empty, return all contacts
2. Before using getContact interface, users could get the number of contacts by
getContactCount interface first. If the number of contacts is more than 20, it is
recommended to use setPhonebook interface instead of getContact interface
Parameters
callbackFunction: Call back function