Contacts
List contacts by custom field
Find contacts by custom field value. It will return maximum 100 contacts. The results are sorted by the last custom field value update for a contact.
GET
/
v1
/
contacts
/
find-by-custom-field
List contacts by custom field
curl --request GET \
--url https://app.chatbotx.io/api/v1/contacts/find-by-custom-field \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.chatbotx.io/api/v1/contacts/find-by-custom-field"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.chatbotx.io/api/v1/contacts/find-by-custom-field', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.chatbotx.io/api/v1/contacts/find-by-custom-field",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.chatbotx.io/api/v1/contacts/find-by-custom-field"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.chatbotx.io/api/v1/contacts/find-by-custom-field")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.chatbotx.io/api/v1/contacts/find-by-custom-field")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"avatar": "<string>",
"phoneNumber": "<string>",
"email": "<string>",
"emailVerified": true,
"emailOptIn": true,
"firstName": "<string>",
"lastName": "<string>",
"fullName": "<string>",
"lastReadAt": "2023-11-07T05:31:56Z",
"ref": "<string>",
"country": "<string>",
"state": "<string>",
"city": "<string>",
"location": "<string>",
"locale": "<string>",
"timezone": "<string>",
"subscribedAt": "2023-11-07T05:31:56Z",
"broadcastSubscribedAt": "2023-11-07T05:31:56Z",
"blockedAt": "2023-11-07T05:31:56Z",
"workspaceId": "<string>",
"contactCustomFields": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"value": "<string>",
"contactId": "<string>",
"customFieldId": "<string>"
}
],
"tags": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"deletedAt": "2023-11-07T05:31:56Z",
"folderId": "<string>",
"workspaceId": "<string>"
}
],
"contactNotes": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"text": "<string>",
"contactId": "<string>",
"createdById": "<string>"
}
],
"contactInboxes": [
{
"id": "<string>",
"contactId": "<string>",
"inboxId": "<string>",
"channel": "<string>",
"inbox": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"channel": "<string>",
"sourceId": "<string>",
"workspaceId": "<string>",
"status": "<string>"
}
}
],
"conversation": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"botEnabled": true,
"botResumeAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z",
"additionalAttributes": "<string>",
"contactLastReadAt": "2023-11-07T05:31:56Z",
"agentLastReadAt": "2023-11-07T05:31:56Z",
"lastActivityAt": "2023-11-07T05:31:56Z",
"followed": true,
"workspaceId": "<string>",
"contactId": "<string>",
"adminRepliedAt": "2023-11-07T05:31:56Z",
"contactRepliedAt": "2023-11-07T05:31:56Z",
"aiContextLastMessageId": null,
"assignedUserId": null,
"assignedInboxTeamId": null,
"assignedUser": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"email": "<string>",
"emailVerified": true,
"image": "<string>",
"isAnonymous": true
},
"assignedInboxTeam": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"workspaceId": "<string>",
"name": "<string>"
},
"inbox": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"channel": "<string>",
"sourceId": "<string>",
"workspaceId": "<string>",
"status": "<string>"
}
}
}
]
}Authorizations
developerAccessTokentokenInSearchParams
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Response
200 - application/json
OK
Show child attributes
Show child attributes
Was this page helpful?
⌘I
List contacts by custom field
curl --request GET \
--url https://app.chatbotx.io/api/v1/contacts/find-by-custom-field \
--header 'Authorization: Bearer <token>'import requests
url = "https://app.chatbotx.io/api/v1/contacts/find-by-custom-field"
headers = {"Authorization": "Bearer <token>"}
response = requests.get(url, headers=headers)
print(response.text)const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
fetch('https://app.chatbotx.io/api/v1/contacts/find-by-custom-field', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.chatbotx.io/api/v1/contacts/find-by-custom-field",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "GET",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.chatbotx.io/api/v1/contacts/find-by-custom-field"
req, _ := http.NewRequest("GET", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.get("https://app.chatbotx.io/api/v1/contacts/find-by-custom-field")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.chatbotx.io/api/v1/contacts/find-by-custom-field")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Get.new(url)
request["Authorization"] = 'Bearer <token>'
response = http.request(request)
puts response.read_body{
"data": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"avatar": "<string>",
"phoneNumber": "<string>",
"email": "<string>",
"emailVerified": true,
"emailOptIn": true,
"firstName": "<string>",
"lastName": "<string>",
"fullName": "<string>",
"lastReadAt": "2023-11-07T05:31:56Z",
"ref": "<string>",
"country": "<string>",
"state": "<string>",
"city": "<string>",
"location": "<string>",
"locale": "<string>",
"timezone": "<string>",
"subscribedAt": "2023-11-07T05:31:56Z",
"broadcastSubscribedAt": "2023-11-07T05:31:56Z",
"blockedAt": "2023-11-07T05:31:56Z",
"workspaceId": "<string>",
"contactCustomFields": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"value": "<string>",
"contactId": "<string>",
"customFieldId": "<string>"
}
],
"tags": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"deletedAt": "2023-11-07T05:31:56Z",
"folderId": "<string>",
"workspaceId": "<string>"
}
],
"contactNotes": [
{
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"text": "<string>",
"contactId": "<string>",
"createdById": "<string>"
}
],
"contactInboxes": [
{
"id": "<string>",
"contactId": "<string>",
"inboxId": "<string>",
"channel": "<string>",
"inbox": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"channel": "<string>",
"sourceId": "<string>",
"workspaceId": "<string>",
"status": "<string>"
}
}
],
"conversation": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"botEnabled": true,
"botResumeAt": "2023-11-07T05:31:56Z",
"archivedAt": "2023-11-07T05:31:56Z",
"additionalAttributes": "<string>",
"contactLastReadAt": "2023-11-07T05:31:56Z",
"agentLastReadAt": "2023-11-07T05:31:56Z",
"lastActivityAt": "2023-11-07T05:31:56Z",
"followed": true,
"workspaceId": "<string>",
"contactId": "<string>",
"adminRepliedAt": "2023-11-07T05:31:56Z",
"contactRepliedAt": "2023-11-07T05:31:56Z",
"aiContextLastMessageId": null,
"assignedUserId": null,
"assignedInboxTeamId": null,
"assignedUser": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"email": "<string>",
"emailVerified": true,
"image": "<string>",
"isAnonymous": true
},
"assignedInboxTeam": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"workspaceId": "<string>",
"name": "<string>"
},
"inbox": {
"id": "<string>",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"name": "<string>",
"channel": "<string>",
"sourceId": "<string>",
"workspaceId": "<string>",
"status": "<string>"
}
}
}
]
}