Third Light Developer Exchange

Code and templating community forum for developers and software integrators

You are not logged in.

Announcement

If you wish to join the Developer Exchange, please contact your account manager - this is to avoid unnecessary spam in the forums. Many thanks for your understanding.

#1 2016-08-17 10:30:31

angela
Member
Registered: 2016-04-25
Posts: 3

How to Append Keywords Meta Data for multiple Assets

We are currently using Files_SetMetadata to setting metadata for multiple asset, but this is replacing existing keywords. body for file setmeta data is as below:

   "apiVersion":"1.0.1",
   "sessionId":"BylVqplVPYNl1UF6okci9fuy70iRr6ej",
   "action":"Files.SetMetaData",
   "inParams":{ 
      "assetId":[ 
         "37182959451",
          "37182955474",
                    "37182736317"  ],
      "values":{ 
         "37182959451":{ 
            "Keywords":[{ 
               "value":"CTS",
               "inherit":false,
               "override":false
            }]
         },
         "37182955474":{ 
            "Keywords":[{ 
               "value":"CTS",
               "inherit":false,
               "override":false
            }]
         },
                 "37182736317":{ 
            "Keywords":[{ 
               "value":"CTS",
               "inherit":false,
               "override":false
            }]
         }
      }
   }
}


I have tried to change "inherit":false,"override":false values but no effect. I was successful in appending the Keywords AddMetadata for single record, needs help with syntax for multiple assetids. or could help me with alternate API

Offline

#2 2016-08-22 10:28:05

ben
Third Light Staff
From: Third Light
Registered: 2013-06-06
Posts: 79

Re: How to Append Keywords Meta Data for multiple Assets

Hi angela,
The short answer is that there is not currently a way to to append metadata to multiple files at once. The Files.SetMetadata(...) call will always overwrite with whatever you have specified in the call. So if you want to use this method you would need to start with a call to Files.GetMetadata(...), append the values as desired to the returned data, and then use this modified data in the call to Files.SetMetadata(...).

(Note that Files.GetMetadata(...) does accept an array of assetIds despite this not being mentioned in the documentation).

Alternative you could call Files.AddMetadata(...) multiple times - once for each asset you want to update.

Best wishes,
Ben

Offline

Board footer