Lo sentimos. Esta página no ha aún traducida. No se preocupe, el equipo localización de Emarsys está trabajando duro para proporcionarle toda la documentación en su idioma!
Updates a single contact using their external ID as reference, or it creates the contact if it does not exist in the database. Please note that single and multiple contact updating are combined in the demo page and can’t be tested separately.
Note: Read-only fields, which are listed in System Fields, cannot be updated.
Endpoint
PUT https://api.emarsys.net/api/v2/contact
Parameters
Required Parameters
Key-value pairs which identify the contact fields which will be updated.
Optional parameters
Name | Type | Description | Comments |
---|---|---|---|
key_id | mixed | Key which identifies the contacts | This can be a field id, id, uid or eid. If left empty, the email address (field ID 3) will be used by default. |
source_id | int | ID assigned to a customer’s external application, and is used to identify contacts created or modified by the external (3rd party) applications, [source_id] | |
create_if_not_exists | int | Part of the URI. When enabled, if the contact does not exist in the database, it is created automatically. | Possible values of the parameter are “0” and “1”, the latter enables it. |
Note: The value provided for the key_id field identifies the contact which will be updated. The other fields contain the changes requested for the contact. If more than one contact with the requested ID is found, an error message is returned.
See Creating a new contact for further information.
URI Example
https://api.emarsys.net/api/v2/contact/?create_if_not_exists=1
Request Example
{ "3": "erik.selvig@example.com", "key_id": "3" }
Response Example
{ "replyCode": 0, "replyText": "OK", "data": { "id": 112035628 } }
Errors
HTTP Code | Reply Code | Message | Description |
---|---|---|---|
400 | 2010 | More contacts found with the external ID: [field_id] – [value] | More than one contact with the provided key field value exists in the database. A unique external key must be provided. Please note that using multiple identifiers is not possible via the API. If you need multiple identifiers, you need to use the Import page. |
400 | 2008 | No contact found with the external ID: [field_id] – [value] | No contact with the provided key field value exists in the database. The contact must be created; see Create a Contact. |
400 | 2004 | Cannot use id or uid as key on contact creation | IDs cannot be specified manually. |
400 | 2007 | Cannot set id or uid on contact creation | IDs cannot be specified manually. |