Definition
Updates an existing Kulea Contact record based on ID. You cannot update the email address of an existing contact, but can modify all other fields. The Payload (body) must be in JSON and should only have valid fields.
REST API URL
- Update contact with id=:id (with given JSON Payload in body) - POST: https://{{MA2ID}}.prod.kulea.marketing:8089/rest/api/users/:id
Headers
- Authorization (Mandatory String <API-KEY>) - Example: afeWER£4q3
Body/Payload - JSON
This must be JSON format where fields must correspond to Kulea fields (which you can get from /rest/api/users/fields API). Also, the field types must be correct otherwise validation may fail. You only need to supply the fields that you want to update in the Payload. NOTE: You cannot update email for a given Contact.
{
"forename":"junaid9",
"surname":"bakali9",
"unsubscribe":true,
}
NOTE: Here that setting 'unsubscribe' to true will unsubscribe the contact.
NOTE: All new contacts by default are set to subscribed (without the need to set this field). You can update this status by calling using this API method by setting 'unsubscribe' to true.
NOTE: Once a record has been updated with 'unsubscribe' set to true, then you will not be able to set them to 'subscribed' again via the API.
NOTE: You cannot archive a contact from using this API method. For archive please use the DELETE contact API method.
NOTE: If a contact has been archived the update will not update the record. No errors will be reported, but the response will highlight that the record is 'archived' (see below).
Response (application/json)
Response will be a json object with the following fields:
- success - if true then request was successful; otherwise failed.
- archived - if true then this indicates that the updates were not committed as the record is set to archived (in this instance success might still be true). If however the record is not archived this field may not be present in the response.
- reason - only shown if success is false and indicates the reason of failure. Examples of failure might be invalid fields, Json format invalid, invalid contact id to update etc.
- crm_id - If success then returns the crm_id that was updated.
Example:
{
"success": true,
"crm_id": 4294967668
}