Toutes nos excuses, cette page n'a pas encore été traduite. L'équipe Localization d' Emarsys est en train d'y remédier et souhaite vous proposer toute la documentation en Français!
Generates a list of contacts with values for a specific field. For example, field_id 1
returns the first names of all contacts. Both the values and the contact IDs are returned.
Endpoint
GET https://api.emarsys.net/api/v2/contact/query/?return=<field_id>
Parameters
Required parameters
Name | Type | Description | Comments |
---|---|---|---|
return | int | Field ID used to generate the list. |
Optional parameters
Name | Type | Description | Comments |
---|---|---|---|
<field_id> | mixed | Value determines if a contact should be returned or not, [field_value] | Can be an empty string as that will also match to cells with NULL value. |
limit | int | Specifies the maximum number of contacts to return | Default is 10.000, which is also the maximum number of contacts that can be returned (you cannot specify more). |
offset | int | Specifies an offset for pagination (like in SQL) | |
excludeempty | boolean | If set to true, then all contacts with a null or empty value in the requested field are not returned. Any value except for true will be interpreted as false. |
URI Example
https://api.emarsys.net/api/v2/contact/query/?return=3&limit=100&offset=200&1=FirstNameHere&excludeempty=true
Result Example
Normal Result
{ "replyCode": 0, "replyText": "OK", "data": { "result": [ { "id": 3, "3": "loki@example.com" }, { "id": 5, "3": "thor@example.com" } ] } }
Error Condition
{ "replyCode": 2014, "replyText": "No field specified to return", "data": "" }
Errors
HTTP Code | Reply Code | Message | Description |
---|---|---|---|
400 | 2006 | Invalid field id: <field_id> | The id of a provided field is invalid. |
400 | 2014 | No field specified to return | Parameter return is required. |
400 | 2015 | No index on column | Filtering is enabled only for the indexed columns. |
400 | 2016 | Invalid limit | Limit should be between 1 and 10,000. |
500 | 2011 | (depends on the error) | An internal error occurred. |