beautypg.com

Gmi web service interface – Grandstream GXP2200 GMI Web Service Guide User Manual

Page 5

background image

GXP2200 GMI WEB SERVICE GUIDE V1.0

Page 4 of 38

GMI WEB SERVICE INTERFACE

GXP2200 GMI Web Service provides basic API to facilitate users calling the existing application on the

GXP2200 or to retrieve the phone's status. Usually JavaScript and Windows MFC can be used for

development. However, no matter what programming language is used, the functions in the interface

have the same name and parameters, which are included in GMIService class. Users could define the

interface according to the parameters and HTTP request. This section describes details for each

interface.

Note:
• Parameter account in each interface represents the account index. This is the index number

retrieved from getAccountInfo [10. getAccountInfo(callbackFunction)] interface. The valid index

number is from 0 to 5 for account 1 to account 6.

• For the HTTP requests in each interface introduced below, if the action data is empty or incorrect, the

following message will be returned:

"{"res": "error", "msg": "command not found"}"

• For the interfaces introduced below, if the HTTP requests' interval is more than 900s, the request will

be disconnected. The following message will be returned and users will need login again.

"{"res": "error", "msg": "authentication required"}"

1. webServiceLogin(ip, username, password, callbackFunction)

Description

Login GXP2200 web GUI with IP address, username and password. This interface has

to be executed first before using other interfaces (except getVendor, getProduct and

getProductInfo interfaces)

Parameters

• ip: Phone's IP address
• username: Web GUI login username
• password: Web GUI login password
• callbackFunction: Call back function

HTTP Request

• url: "http://"+ ip + "/manager?"
• action: "login"
• username: "admin"
• secret: "123"
• format: "json"