Contact Filter
curl --request POST \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/contacts/filter \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"payload": [
{
"attribute_key": "name",
"filter_operator": "equal_to",
"values": [
"en"
],
"query_operator": "AND"
},
{
"attribute_key": "country_code",
"filter_operator": "equal_to",
"values": [
"us"
],
"query_operator": null
}
]
}
'const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payload: [
{
attribute_key: 'name',
filter_operator: 'equal_to',
values: ['en'],
query_operator: 'AND'
},
{
attribute_key: 'country_code',
filter_operator: 'equal_to',
values: ['us'],
query_operator: null
}
]
})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/contacts/filter', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/contacts/filter"
payload = { "payload": [
{
"attribute_key": "name",
"filter_operator": "equal_to",
"values": ["en"],
"query_operator": "AND"
},
{
"attribute_key": "country_code",
"filter_operator": "equal_to",
"values": ["us"],
"query_operator": None
}
] }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"meta": {
"count": 123,
"current_page": "<string>"
},
"payload": [
{
"additional_attributes": {
"city": "<string>",
"country": "<string>",
"country_code": "<string>",
"created_at_ip": "<string>"
},
"availability_status": "online",
"email": "<string>",
"id": 123,
"name": "<string>",
"phone_number": "<string>",
"blocked": true,
"identifier": "<string>",
"thumbnail": "<string>",
"custom_attributes": {},
"last_activity_at": 123,
"created_at": 123,
"contact_inboxes": [
{
"source_id": "<string>",
"inbox": {
"id": 123,
"avatar_url": "<string>",
"channel_id": 123,
"name": "<string>",
"channel_type": "<string>",
"provider": "<string>"
}
}
]
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Contacts
Contact Filter
Filter contacts with custom filter options and pagination
POST
/
api
/
v1
/
accounts
/
{account_id}
/
contacts
/
filter
Contact Filter
curl --request POST \
--url https://app.yampi.ai/api/v1/accounts/{account_id}/contacts/filter \
--header 'Content-Type: application/json' \
--header 'api_access_token: <api-key>' \
--data '
{
"payload": [
{
"attribute_key": "name",
"filter_operator": "equal_to",
"values": [
"en"
],
"query_operator": "AND"
},
{
"attribute_key": "country_code",
"filter_operator": "equal_to",
"values": [
"us"
],
"query_operator": null
}
]
}
'const options = {
method: 'POST',
headers: {api_access_token: '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
payload: [
{
attribute_key: 'name',
filter_operator: 'equal_to',
values: ['en'],
query_operator: 'AND'
},
{
attribute_key: 'country_code',
filter_operator: 'equal_to',
values: ['us'],
query_operator: null
}
]
})
};
fetch('https://app.yampi.ai/api/v1/accounts/{account_id}/contacts/filter', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));import requests
url = "https://app.yampi.ai/api/v1/accounts/{account_id}/contacts/filter"
payload = { "payload": [
{
"attribute_key": "name",
"filter_operator": "equal_to",
"values": ["en"],
"query_operator": "AND"
},
{
"attribute_key": "country_code",
"filter_operator": "equal_to",
"values": ["us"],
"query_operator": None
}
] }
headers = {
"api_access_token": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text){
"meta": {
"count": 123,
"current_page": "<string>"
},
"payload": [
{
"additional_attributes": {
"city": "<string>",
"country": "<string>",
"country_code": "<string>",
"created_at_ip": "<string>"
},
"availability_status": "online",
"email": "<string>",
"id": 123,
"name": "<string>",
"phone_number": "<string>",
"blocked": true,
"identifier": "<string>",
"thumbnail": "<string>",
"custom_attributes": {},
"last_activity_at": 123,
"created_at": 123,
"contact_inboxes": [
{
"source_id": "<string>",
"inbox": {
"id": 123,
"avatar_url": "<string>",
"channel_id": 123,
"name": "<string>",
"channel_type": "<string>",
"provider": "<string>"
}
}
]
}
]
}{
"description": "<string>",
"errors": [
{
"field": "<string>",
"message": "<string>",
"code": "<string>"
}
]
}Authorizations
Token de usuario. Envía el valor en el header api_access_token. Lo obtienes en el perfil (GET /api/v1/profile) o al regenerarlo.
Path Parameters
The numeric ID of the account
Query Parameters
Body
application/json
Show child attributes
Show child attributes
Example:
[
{
"attribute_key": "name",
"filter_operator": "equal_to",
"values": ["en"],
"query_operator": "AND"
},
{
"attribute_key": "country_code",
"filter_operator": "equal_to",
"values": ["us"],
"query_operator": null
}
]