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.
Returns the values of specified fields for contacts. The contacts can be specified by using either the internal IDs or by using another column value.
Endpoint
POST https://api.emarsys.net/api/v2/contact/getdata
Parameters
Required parameters
Name | Type | Description | Comments |
---|---|---|---|
keyId | mixed | Key which identifies the contacts | This can be a field id, id or uid. |
keyValues | array | Value of the keyId | Must be expressed as an array containing contact IDs or values of the column used to select contacts. |
Optional parameters
Name | Type | Description | Comments |
---|---|---|---|
fields | array | Define which system fields to include in the output. | If empty, all fields will be returned. |
Request Example
{ "keyId": "3", "keyValues": [ "steve.rogers@example.com", "peter.parker@example.com" ], "fields": [ "1", "2", "3" ] }
Result Example
{ "replyCode": 0, "replyText": "OK", "data": { "errors": [], "result": [ { "1": "Steve", "2": "Rogers", "3": "steve.rogers@example.com", "id": "714688341", "uid": "pSwx0RBr0r" }, { "1": "Peter", "2": "Parker", "3": "peter.parker@example.com", "id": "714721808", "uid": "iamz9MyOhc" } ] } }
Result Example Details
Name | Description |
---|---|
uid | User ID, a random string |
Error Condition
{ "replyCode":0, "replyText":"OK", "data":{ "errors":[ { "key":"ironman@example.com", "errorCode":"2008", "errorMsg":"No contact found with the external id: 3" }, { "key":"hulk@example.com", "errorCode":"2008", "errorMsg":"No contact found with the external id: 3" } ] } }
Errors
HTTP Code | Reply Code | Message | Description |
---|---|---|---|
400 | 2002 | The list of external ids exceeds the maximum size. | Too many contacts were requested; number of contacts is limited to 1,000. |
400 | 2003 | Invalid data format. Array expected | keyValues must be an array. |
400 | 2004 | Invalid key field id: [field_id] | The given field id is not valid or it cannot be used as an external ID. |
200 | 2005 | No value provided for key field: [field_id] | The value of the key field has not been provided or is empty. |
400 | 2006 | Invalid field id: [field_id] | The requested field was not found. |
200 | 2007 | <MESSAGE BASED ON FIELD TYPE> | The provided field value is invalid (e.g. it is not numeric or a valid date format). |
200 | 2008 | No contact found with the external ID: [field_id] | Contact was not found. |
200 | 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. |