11-11-2016 07:53 AM
It sounds like you are underposting. In other words, you not passing all the fields that make up a contact.
A PUT operation should include *all* the contact fields that can be modified.
E.g. GET /contacts -> change field values -> PUT /contacts.
What you are trying to do is a partial update, also known as a PATCH operation. This is not yet supported.
11-13-2016 04:55 PM
So whats the recommended way to update only select fields?
I tried pulling down the contact record merging the fields i want to change and then sending the full contact record back but im getting an error about a custom field not allowed to be null even though thats was it was set as from the api.
It seems odd that this isn't supported.
How do you recommend i achieve this without explicitly defining every field as this will then just break as soon as another custom field is added?
11-14-2016 07:44 AM
The correct way to PUT a record is first to GET the record, modify only the fields that you need to change, then PUT the record. This ensures that other fields will return their data. You don't need to define every field up front, you simply need to know and modify the fields you care about on the model you received from a GET.
11-14-2016 03:57 PM
Thats exactly what i tried to do but my client has a calculated custom field and it appears im not permitted to set it so i get this error when trying to save the merged full contact record:
Custom Field cust_yearsinoperation_012243550 does not accept null values\r\nParameter name: model
Wat am i suppose to do here?
11-15-2016 03:11 PM
Yeah it does and thats whats im doing for now but i don't like that solution as in the future they may add another similar field and the integration will suddenly break.
Is there an ETA for when PATCH will be supported?
11-16-2016 07:06 AM
One option you may be able to do now, is get /metadata for contacts, enumerate those fields so that so you can dynamically find read-only fields, and exclude them from a PUT.
We could be more accepting of read-only fields on our end, and simply ignore them if you include them, which would be the easiest for you / others, and I tend to like that the best, but we need to make sure this doesn't have any other side effects to see if that's a good option.
No ETA on PATCH but it is on the backlog.