Bynder / bynder-php-sdk

SDK in PHP for integration with Bynder
MIT License
14 stars 22 forks source link

modifyMedia does not work for "property_" values #49

Closed mhelm-sitation closed 2 years ago

mhelm-sitation commented 2 years ago

I'm trying to use the modifyMedia to update a value "property_Brand" and have not been able to get it to work.

This call works: $promise = $assetBankManager->modifyMedia( '0E242B12-0609-4310-90F58FD42E051771', [ 'description' => 'TEST" ] ); $promise->wait();

But this call does not: $promise = $assetBankManager->modifyMedia( '0E242B12-0609-4310-90F58FD42E051771', [ 'property_Brand' => 'TEST" ] ); $promise->wait();

This is how the fields appear on the item in question: ["description"]=> string(20) "Job Number: ANO 4682"

["property_Brand"]=> array(1) { [0]=> string(6) "Anolon" }

Am I doing something wrong or is this a limitation of the SDK?

Arpit-Sharma-USC commented 2 years ago

Hi @mhelm-sitation are you trying to pass a brandId to the modifyMedia call? For reference here are the fields you can pass on as an array to the form_params of the request.

https://bynder.docs.apiary.io/#reference/assets/specific-asset-operations/modify-asset

mhelm-sitation commented 2 years ago

@Arpit-Sharma-USC

I'm not trying to update brandId. There is a multi-select metaproperty called property_Brand which I'm trying to update. I see in the docs that metaproperty expects a comma separated list of strings, which is what I'm providing.

mhelm-sitation commented 2 years ago

After taking a look at the apiary docs I got the command to work. The call ends up looking like:

$assetBankManager->modifyMedia( '0E242B12-0609-4310-90F58FD42E051771', [ 'metaproperty.A7D169BB-1289-4488-870F29BAC48888F3' => 'B8822941-8FB7-445E-9C72AD452D2067DD' ] );