Metadata API
Zoom metadata can be fetched by the Zoom Find command easily. Once you have the desired metadata for an asset, you can edit it using the SetMetadata API as described below.
Request URL:
Authentication Parameters:
- zm_username=<zoom-username>
- zm_cookie=<zoom-auth-cookie>, or,
- zm_password=<zoom-password>
Request JSON Syntax:
data=
{
clientVersion:”ZoomClient/4.1-b5835″,
cmd:setmetadata,
message:
{
newData:
[
{
key:<name of the metadata property>,
value:<value to be assigned>
},
… so on
],
delData:
[
<name of the metadata property to be deleted>,
… so on
],
assetsInfo:
[
{
fuid:<Asset ID of the asset on which the metadata modifications must be applied>,
rrn:<Repository Revision Number at which the modifications must be applied>
},
… so on
],
append: true | false // append = false will replace the existing values with the request parameters
}
}
Request Sample:
zm_username=some-user&
zm_cookie=zoom-auth-cookie-for-user&
data=
{
clientVersion:”ZoomClient/4.1-b5835″,
cmd:setmetadata,
message:
{
newData:
[
{
key:”IPTC_Keywords”,value:”grey”
}
],
delData:
[
],
assetsInfo:
[
{
fuid:187,
rrn:429
}
],
append:false
}
}
Response JSON syntax:
{
“success”:<true/false>
}
Keyword Stock API
Keywords are critical metadata and Zoom offers some special Web APIs targeted towards keywords management.
View Keyword Stock
Request URL:
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:
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
]
}
}