Error creating custom field on photo

You must Login before you can answer or comment on any questions.

I am trying to attach a custom string to a photo which a user uploads on the server. I use the following method:

Map<String, Object> data = new HashMap<String, Object>();
data.put("photo", f);
data.put("custom_fields", "{\"description\":" + "\"" + desc + "\"}");
'desc' is the string which i want to attach as 'description'.

I get the response as: {"message":"Failed to set custom_fields: 745: unexpected token at '%7B%22description%22%3A%22Moon%22%7D'","status":"fail","code":400}

(Moon was just a trial String)

Any help would be great. :)

1 Answer

I solved it myself:

It should be :

data.put("custom_string_description","Your String to Attach");

where 'description' is the name of string custom field. 'string' is the type of custom field you want to create.

Your Answer

Think you can help? Login to answer this question!