You are not logged in.
Pages: 1
Is there a method to upload metadata for multiple files? I am using at the moment Files_UpdateMetadata for each ims file reference which uploads one at a time.
Offline
Hi Andrei,
Files.SetMetadata accepts an array for $assetId - in this case the $values hashes for each file should be provided as a hash keyed by IMS file reference.
Dominic
Offline
Could you please help us with Syntax to Set Meta data for multiple files using Files.SetMetaData, I am getting Input error
Offline
Hi Angela,
I see our docs for Files.SetMetadata() are not very clear, but under the hood that method calls straight through into Metadata.SetMetadata() which has some more comprehensive documentation.
An example call with Files.SetMetadata would look like:
Files.SetMetadata({
"assetId":"123123123",
"values":{
"keywords":[
{
"value":"blue sky",
"inherit":false,
"override":false
},
{
"value":"clouds",
"inherit":false,
"override":false
}
],
"caption":[
{
"value":"Scenery at midday",
"inherit":false,
"override":false
}
],
"copyright":[
{
"value":"Photograph Copyright Jo Bloggs 2016",
"inherit":false,
"override":true
}
],
"exifcreationdate":[
{
"value":1394298395,
"inherit":false,
"override":false
}
]
}
})
One important thing to note is that each entry in the "values" hash must be an array even when the metadata field doesn't support multiple values. e.g. Caption - as above this is specified as an array with one item.
Hope this helps,
Ben
Offline
Further to the above, this would be an example call when setting multiple files in one go:
Files.SetMetadata({
"assetId":["123","456"],
"values":{
"123": {
"caption":[
{
"value":"First Caption",
"inherit":false,
"override":false
}
],
},
"456": {
"caption":[
{
"value":"Second Caption",
"inherit":false,
"override":false
}
],
}
}
})
Ben
Offline
Thanks you very much.. the above example has resolved the issue
Offline
Pages: 1