batchblue / batchbook-api

Official API documentation for Batchbook
http://batchbook.com
12 stars 2 forks source link

Updating a custom field value #17

Open tracy-goalkeeper opened 7 years ago

tracy-goalkeeper commented 7 years ago

`I'm having trouble updating a custom field value.

According to the documentation, to update a nested field you just include the id. I've tried the following that return a status code 200 but doesn't update the boolean_value: var update_options = { url : 'https://goalkeeper.batchbook.com/api/v1/people/' + 592 + '.json?auth_token=redacted', method: 'PUT', json: {person: { id:592, cf_records:[{ id: 1999, custom_field_set_id:6, custom_field_values:[ { id: 3986, custom_field_definition_id:43, boolean_value :false }] }] } } }

m0dd3r commented 7 years ago

I'm guessing the false value is getting converted to 0 or something by whatever you're using to make the http request. Try using a string "false" instead. I just made exactly that request against using curl and had to make that change to get it to work.

tracy-goalkeeper commented 7 years ago

Using "false" fixed my issue, thanks!