beautypg.com

Getcontactcount(callbackfunction), Setgroup(phbkgroup, callbackfunction) – Grandstream GXP2200 GMI Web Service Guide User Manual

Page 14

background image

GXP2200 GMI WEB SERVICE GUIDE V1.0

Page 13 of 38

Return

1. HTTP request return:
• Return successful

"{"res": "success", "msg": "3"}"

• Return failed

"{"res": "error", "msg" : "can't get group count"}"

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

14. getContactCount(callbackFunction)

Description

Retrieve the number of contacts in phonebook

Parameters

callbackFunction: Call back function

HTTP Request

• url: "http://"+ ip + "/manager?"
• action: "getcontactcount"
• 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=getcontactcount&format=json&jsoncallback

=?

Return

1. HTTP request return:
• Return successful

"{"res": "success", "msg": "9"}"

• Return failed

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

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

15. setGroup(phbkGroup, callbackFunction)

Description

• Configure phonebook group information (edit group and add group)
• Phonebook group structure

PhbkGroup

{

gpID; //Group ID, string

gpName; //Group name, string

}
• If gpID is empty, the group with gpID will be added. If gpID is existed, group gpID

will be edited.