Es tut uns leid, aber diese Seite wurde leider noch nicht übersetzt. Doch keine Sorge, das Emarsys Lokalisierungsteam arbeitet eifrig daran, unsere gesamte Dokumentation in Ihrer Sprache bereitzustellen.
Adds new contacts to an existing contact list.
Endpoint
POST https://api.emarsys.net/api/v2/contactlist/<list_id>/add
Parameters
Name | Type | Description | Comments |
---|---|---|---|
list_id | int | ID of the contact list, part of the URI | |
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. |
external_ids | array | List of contact IDs to be inserted |
Request Example
Simple values
{ "key_id": "3", "external_ids": [ "thor@example.com", "odin@example.com", "loki@example.com" ] }
Multi-choice values
{ "key_id": "123", "external_ids": [ [1,2,3], [2,3], [1,4] ] }
Result Example
{ "replyCode": 0, "replyText": "OK", "data": { "inserted_contacts": 2, "errors": { "loki@example.com": { "2008": "No contact found with the external id: 3 - loki@example.com" } } } }
Result example details
Name | Description |
---|---|
inserted_contacts | Number of contacts successfully added to the list. |
errors | Details any contacts not added to the list, expressed as an array which contains the ID and the reason for the error. |
Errors
HTTP Code | Reply Code | Message | Description |
---|---|---|---|
200 | Invalid key field id | The ID of the field storing the key is invalid or does not exist. | |
400 | 3005 | Contact list with the requested name already exists. | |
400 | 3003 | Invalid datatype for the list of external IDs. Array expected. | |
400 | 3002 | The list of external IDs exceeds the maximum size. | The number of contacts is limited to 10,000. |
400 | 3004 | Invalid contact list id: [id] | The list ID has an invalid format or it does not exist. |
400 | 2008 | No contact found with the external ID: [field_id]. |