POST update_metadata¶
Update the metadata for a list of images already present in your collection.
Resource URL¶
https://multicolorengine.tineye.com/<company>/rest/update_metadata/
Performance¶
The MulticolorEngine API can perform one add, update or delete request at a time. Any extra requests submitted will be queued up for processing as slots become available.
Each request accepts maximum 10 filepaths.
Metadata limitations¶
The metadata keywords can contain any character. However, some characters need to be escaped when using the JSON or XML protocol (see the Character escaping and Handling Unicode sections under Metadata format).
When calling update_metadata for an image all previous metadata associated with that image will be discarded. It is not possible to do partial metadata updates. This method can be also used to delete the metadata associated with an image.
Parameters¶
Filepath¶
Key |
Description |
---|---|
filepath |
A filepath under which the image file was added to the collection. |
image_id (optional) |
An ID under which the image file will be stored in the collection. Any string or integer can be used as image ID, up to 255 characters. |
metadata (optional) |
A hierarchical set of keywords to be stored along with the image. Can be sent using either XML or JSON format. |
Filepaths¶
Key |
Description |
---|---|
filepaths[0] |
A filepath under which the first image file was added to the collection. |
image_ids[0] (optional) |
An ID under which the first image file will be stored in the collection. |
metadata[0] (optional) |
A hierarchical set of keywords to be stored along with the first image. |
… |
… |
filepaths[n] (optional) |
A filepath under which the last image file was added to the collection. |
image_ids[n] (optional) |
An ID under which the last image file will be stored in the collection. |
metadata[n] (optional) |
A hierarchical set of keywords to be stored along with the last image. |
Request example¶
curl https://multicolorengine.tineye.com/<company>/rest/update_metadata/ \
-F "filepath=path/folder/1.jpg" \
-F "image_id=dd8d-6dc8-bf3f" \
-F "metadata='{\"keywords\": [\"whale\", \"shark\", \"octopus\"], \"id\": {\"action\": \"return\", \"type\": \"uint\", \"\": \"54321\"}}'"
or
curl https://multicolorengine.tineye.com/<company>/rest/update_metadata/ \
-F "filepaths[0]=path/folder/1.jpg" \
-F "image_ids[0]=6558512785" \
-F "metadata[0]='{\"maker\": \"Acura\"}'" \
-F "filepaths[1]=path/folder/2.jpg" \
-F "image_ids[1]=9658451257" \
-F "metadata[1]='{\"maker\": \"Lexus\"}'"
Response examples¶
JSON¶
{
"method": "update_metadata",
"status": "ok",
"error": [],
"result": [],
"stats": {
"time_update": 6.01,
"time_total": 6.56
}
}
XML¶
<?xml version="1.0" encoding="utf-8"?>
<data>
<method>update_metadata</method>
<status>ok</status>
<error/>
<result/>
<stats>
<time_update>6.01</time_update>
<time_total>6.56</time_total>
</stats>
</data>