Craig Gingell Posted April 5, 2021 Share Posted April 5, 2021 Hello, I have read the REST API documentation here: https://invisioncommunity.com/developers/rest-api?endpoint=core/members/POSTitem I am trying to update a custom field value, but cannot fathom the syntax for the customFields value. The docs state: customFields object Array of custom fields as fieldId => fieldValue but can someone please provide an example? Let's say I have a custom field number 10, and I want to set it's value to "XYZ123" what should I be posting in the customFields value? I tried [{'fieldId':'10','fieldValue':'XYZ123'}] but the field value didn't update. Any ideas? Link to comment Share on other sites More sharing options...
Daniel F Posted April 5, 2021 Share Posted April 5, 2021 it's an array with the id as key and value as value, not fieldID => X , fieldvalue=> Y 😉 $data = array( 'customFields' => array( 1 => 'FOO', 2 => 'BAR', 10 => 'BAZINGA' ) ); Link to comment Share on other sites More sharing options...
Craig Gingell Posted April 5, 2021 Author Share Posted April 5, 2021 Thank you Daniel for your help. I should have said, I am working in Javascript and attempting to submit this as an HTML <form> Have you got a sample that will work with Javascript? Cheers! Link to comment Share on other sites More sharing options...
Solution Craig Gingell Posted April 5, 2021 Author Solution Share Posted April 5, 2021 Ok, after a bit more trial and error testing, I worked it out: Quote <input name="customFields[10]" value="XYZ123"> Link to comment Share on other sites More sharing options...
Recommended Posts