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 2013-10-04 11:19:07

ohilton
Member
Registered: 2013-10-04
Posts: 12

API Uploads and meta data

I'm not sure if this is a bug to be solved or a 'feature' but it's not documented and a bit of a sticking point.  Basically I'm writing automated scripts to upload a large collection of images to our account via the JSON API, along with these images we're sending a fair amount of meta data for each one. 

The first hurdle and one that could most certainly be better pointed out in the documentation is that no meta data will be accepted in the 'AddFilesToUpload' request unless it was specified in the 'editablemetadata' parameter of the initial 'CreateUpload' function, annoying but not a killer.

The real problem is the API won't accept any custom metadata field that has a space or apparently even an underscore replacement in it.  If you have a field named 'House Number' and try to add that to the editablemetadata param it is rejected with an 'unknown metadata field' error unless you remove all the spaces, even if you do that and then pass the data in a similarly modified field the data will not be accepted anyway.  Also worth noting it would seem if you edit an existing custom metadata field with spaces in to one without spaces it still will not work with the API unless you create a whole new metadata field from scratch, I assume thats probably so data doesn't get lost in the background when you rename them but it's a bit annoying not to be able to use existing fields with data already in them because we can't use them in the API.

Offline

#2 2013-10-04 16:05:39

steve
Third Light Staff
Registered: 2013-06-06
Posts: 105

Re: API Uploads and meta data

Hi Oli,

I will run this past our team and will be back in touch to let you know our thoughts.

Offline

#3 2013-10-04 17:46:44

steve
Third Light Staff
Registered: 2013-06-06
Posts: 105

Re: API Uploads and meta data

Hi Oli,

When you create a new metadata field, the name you give the field is automatically converted into a lower camel case keyname and the latter is what you need to specifiy in the editablemetadata parameter.

e.g. A metadata field name of 'House number' will be converted to the form 'houseNumber'.

Compare these pages through the IMS GUI when editing the metadata field to see the relationship:

Settings > Field name
and
Mappings > Metadata key name

Offline

Board footer