API3
daniel at April 17th, 2023 18:44 — #1
In OnePageCRM, a contact has two addresses. Using the API, I want to use remove one of these addresses, so I send a PUT request to /contacts/{contact_id}. The request includes an address list containing exactly one address. The call completes successfully (other fields in OnePageCRM are updated), but the address list in OnePageCRM is not updated. I'm able to create new addresses, but not delete old ones.
victor at April 18th, 2023 04:34 — #2
Hi @daniel!
To cleanup all addresses - send an empty array:
PUT https://app.onepagecrm.com/api/v3/contacts/641a9e8b7c55713b1c95be80?partial=1
{
"first_name": "example",
"address_list": []
}
To remove only one - keep one you need and use empty {} to remove the another:
PUT https://app.onepagecrm.com/api/v3/contacts/641a9e8b7c55713b1c95be80?partial=1
{
"first_name": "example",
"address_list": [{"city": "NY"}, {}]
}
Hope this will help
Thanks,
Victor
daniel at April 18th, 2023 10:33 — #3
Thank you @victor! Would you mind updating the docs for PUT /contacts/{contact_id} to include this detail?
vladimir at May 9th, 2023 10:23 — #4
@Daniel documentation is updated https://developer.onepagecrm.com/api/#/Contacts. See PUT /contacts/:id action
Powered by Discourse, best viewed with JavaScript enabled