Issue with updating `set` field in Persons

As per documentation, I should be allowed to update a custom set field to add a new value by passing everything existing (using both label and id then add a new field with label only.

Here is the options I passed:

{
  "options":[
    {"id":63,"label":"Existing1"},
    {"id":64,"label":"Existing2"},
    {"label":"Impossible one!"}
  ]
}

The error I get is Options on update must use the label & id (if it is an update) key.

If I provide [{"label": "Impossible one!"}] it’s getting created but all others values are being deleted.
Any help will be appreciated

1 Like

I do not see cleary in the documentation, but I needed to add the headers Content-Type with the value application/x-www-form-urlencoded.
And so since I am in JS, I needed to JSON.stringify the options to make it work with header

Maybe a room for improving the documentation about the headers to make then more visible!

I hope my self answer will help others!

2 Likes