Keyword Management Web API

Keyword Stock API

Keywords are critical metadata and Zoom offers some special Web APIs targeted towards keywords management.

View Keyword Stock

Request URL:

http://zm.server:8443/command

Request JSON Syntax:

The “data” parameter of the request is in JSON format. It must carry, apart from the command name i.e. cmd: getkwstock, a JSON object “message”, which will be interpreted by the Zoom API engine, to retrieve the stock. This message consists of an optional component, as given below:

data=

{

clientVersion:”ZoomClient/4.1-b5835″,

cmd:getkwstock,

message:

{

mtime: <Epoch time in milliseconds from when you want to fetch the changes in the Zoom keyword database; set to 0 if you want to fetch the entire stock>

}

}

Request Sample:

zm_username=some_user&

zm_cookie=zoom-auth-cookie-for-user&

data=

{

clientVersion:”ZoomClient/4.1-b5835″,

cmd:getkwstock,

message:

{

mtime: 0

}

}

Response JSON Syntax: 

If successful, all entries that were either modified or added to the keyword stock since the specified “mtime” will be returned in the form of JSON, along with the total count of keywords available. Each keyword entry contains the following:

parentKwid: <Keyword ID of the parent under which this keyword is defined; -1 if defined at the ROOT>

kwid: <Keyword ID of the current entry>

value: <String associated with the current entry>

Response JSON Sample: 

{
“entries”:

[

{

“parentKwid”: 74,
“kwid”: 76,
“value”: “fir”

},
{

“parentKwid”: -1,
“kwid”: 59,
“value”: “brent”

},

… so on

],
“nentries”: 94,
“success”: true

}

Edit Keyword Stock

Request URL:

http://zm.server:8443/command

Request JSON Syntax: 

The “data” parameter of the request is in JSON format. It must carry, apart from the command name i.e. cmd: editkwstock, a JSON object called “message”, which will be interpreted by the Zoom API engine. This message consists of the following two components required to execute the editing of the stock.

newData:

[

{

kwid: <A negative number < -1 if you want to create a new keyword, or the keyword ID of the entry that you want to edit>

parentKwid: <The keyword ID of the parent under which this keyword is to be created / moved to; specify -1 for ROOT>,

value: <The keyword string>

}

]

delData:

[

< specify the list of comma-separated keyword IDs, of the entries that must be deleted from the stock>

]

Request Sample:

zm_username=some_user&

zm_cookie=zoom-auth-cookie-for-user&

data=

{

clientVersion:”ZoomClient/4.1-b5835″,

cmd:editkwstock,

message:

{

newData:

[

{

kwid: -100,

parentKwid: -1,

value: “Newly created sample keyword”

},

{

kwid: -101,

parentKwid: -100,

value: “Newly created child keyword”

},

],

delData:

[

40, 38, 100

]

}

}

Leave a Comment