Search Omnichannel Contacts
- Print
- DarkLight
- PDF
Search Omnichannel Contacts
- Print
- DarkLight
- PDF
Article summary
Did you find this summary helpful?
Thank you for your feedback
Get
/api/v1/omnichannel/contact.search
Find Omnichannel contacts by name, email, phone number, or any custom field values stored in the database. Permission required: view-l-room
- Encode values having characters like @,+, /and * to avoid breaking the endpoint.
- To find contacts using custom fields, use the custom query parameter. The custom query parameter must be encoded by URLSearchParams. For example, to search contacts with premium subscription, the request is as follows:
curl --location --globoff 'http://localhost:3000/api/v1/omnichannel/contact.search?custom={%20%22Subscription%22%3A%20%22premium%22%20}' \
--header 'X-Auth-Token: b5BKhblglC5OU0AfB_Tl9dKmOb0zXUvWK-nhNT_aE8V' \
--header 'X-User-Id: CkCPNcvsvCDfmWLqC'
Header parameters
X-Auth-Token
stringRequired
The authToken
of the authenticated user.
ExampleRScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f
X-User-Id
stringRequired
The userId
of the authenticated user.
ExamplerbAXPnMktTFbNpwtJ
Query parameters
email
string
The contact's email address.
phone
string
The contact's phone number.
Example+1367895436
custom
string
The defined custom fields.
ExamplefieldName=value
Responses
200
OK
Success Example
{
"contact": {
"_id": "62fbed6d337291dc9a68ff89",
"username": "guest-16",
"status": "online",
"ts": "2022-08-16T19:18:05.380Z",
"_updatedAt": "2022-08-23T17:58:37.254Z",
"department": "MgzoccgEFHZ856i97",
"name": "Kev",
"token": "969X86icKLRduGAKK",
"visitorEmails": [
{
"address": "[email protected]"
}
],
"lastChat": {
"_id": "CT5bru2WjJ2EsmGbH",
"ts": "2022-08-16T19:24:35.916Z"
},
"livechatData": {
"hobby": "gaming"
}
},
"success": true
}
object
contact
object
_id
string
username
string
status
string
ts
string
_updatedAt
string
department
string
name
string
token
string
visitorEmails
Array of object
object
address
string
lastChat
object
_id
string
ts
string
livechatData
object
hobby
string
success
boolean
400
Forbidden
Example 1
{
"success": false,
"error": "User does not have the permissions required for this action [error-unauthorized]"
}
Example 2
{
"success": false,
"error": "unauthorized"
}
object
success
boolean
error
string
401
Unauthorized
Authorization Error
{
"status": "error",
"message": "You must be logged in to do this."
}
object
status
string
message
string
Was this article helpful?