beautypg.com

Getmessage(id, callfunction) – Grandstream GXP2200 GMI Web Service Guide User Manual

Page 24

background image

GXP2200 GMI WEB SERVICE GUIDE V1.0

Page 23 of 38

http://192.168.121.230/manager?action=phbkresponse&format=json

Return:
• Import done: "{"res": "success", "phbkresponse":"0"}"
• Importing in process:

"{"res": "success", "phbkresponse":"1"}"

• Contacts full

"{"res": "success", "phbkresponse":"2"}"

• Parse failed

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

• Import failed

"{"res": "success", "phbkresponse":"4"}"

• Phone is processing

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

• Invalid file

"{"res": "success", "phbkresponse":"10"}"

23. getMessage(id, callFunction)

Description

Get message according to message id. When id=-1, get the last message

Parameters

• id: Message ID
• callbackFunction: Call back function

HTTP Request

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

jsoncallback=?

Return

1. HTTP request return:

• Successful

"{"res": "success", "msg" : [{"id" : "15", "number" : "8107314", "account" : "0", "state",
"1", "message" : "hello"}]}"

• Failed

"{"res" : "error", "msg" : "get message failed"}"

• Parameters in wrong format (GMI version 9 or newer)

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