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!
Creates multiple new contacts all at once.
Endpoint
POST https://api.emarsys.net/api/v2/contact
Parameters
Name | Type | Description | Comments |
---|---|---|---|
key_id | mixed | Key which identifies the contacts | This can be a field id, id or uid. If left empty, the internal ID will be used by default. |
field_id | int | ID of the field, [field_value] | |
source_id | int | ID assigned to the customer’s application, used to differentiate contacts created or modified by the external applications, [source_id] |
Notes:
- If the key_id is omitted, the key field ID value defaults to using ID 3 (email).
- The optional key_id must be provided once.
- The parameters of the different contacts must be sent in an array (see example below).
- The maximum size of the array is 8MB, therefore the maximum number of new contacts per call depends on the amount of data per contact. 1,000 contacts per call a good benchmark to use, though this can rise as high as 10,000.
Request Example
{ "key_id": "3", "contacts": [ { "3": "erik.selvig@example.com", "2": "Selvig", "source_id": "1234" }, { "3": "ian.boothby@example.com", "2": "Boothby" }, { "3": "james.rhodes@example.com", "2": "Rhodes", "source_id": "5678" }, { "3": "pepper.potts@example.com", "2": "Potts" } ] }
Result Example
{ "replyCode": 0, "replyText": "OK", "data": { "ids": [ 123, 456 ], "errors": { "james.rhodes@example.com": { "2009": "Contact with the external id already exists: 3" }, "pepper.potts@example.com": { "2009": "Contact with the external id already exists: 3" } } } }
Result example details
Name | Description |
---|---|
ids | List of the IDs of successfully-created contacts (returned as an array). |
errors | Indicates that an error occurred during the creation of a contact, and the error message returns the value of the key_id. |
Errors
HTTP Code | Reply Code | Message | Description |
---|---|---|---|
400 | 1000 | The request exceeded the maximum batch size of 1,000 | Too many contacts were requested. |
400 | 2004 | Cannot use internal ID as key on contact creation. | |
400 | 2009 | Contact with external ID: [id] already exists. |