Skip to main content
Returns a list of all conversations matching the search criteria along with the sort and filter options selected.
GET https://services.leadconnectorhq.com/conversations/search

Autorización

Authorization
string
required
Bearer token generado desde el portal Leadway. Ver Autenticación.
Version
string
default:"2021-07-28"
required
Versión de la API.

Query parameters

locationId
string
default:"ABCHkzuJQ8ZMd4Te84GK"
required
Account Id
contactId
string
default:"9VEmS0si86GW6gXWU89b"
Contact Id
assignedTo
string
default:"ABCHkzuJQ8ZMd4Te84GK,fGiae4CHkzoskh8thsik"
User IDs that conversations are assigned to. Multiple IDs can be provided as comma-separated values. Use “unassigned” to fetch conversations not assigned to any user.
followers
string
default:"ABCHkzuJQ8ZMd4Te84GK,fGiae4CHkzoskh8thsik"
User IDs of followers to filter conversations by. Multiple IDs can be provided as comma-separated values.
mentions
string
default:"ABCHkzuJQ8ZMd4Te84GK,fGiae4CHkzoskh8thsik"
User Id of the mention. Multiple values are comma separated.
query
string
default:"Search string"
Search paramater as a string
sort
string
default:"asc"
Sort paramater - asc or desc
startAfterDate
any
default:"1600854"
Search to begin after the specified date - should contain the sort value of the last document
id
string
default:"ABCHkzuJQ8ZMd4Te84GK"
Id of the conversation
limit
number
default:"20"
Limit of conversations - Default is 20
lastMessageType
string
default:"TYPE_SMS"
Type of the last message in the conversation as a string
lastMessageAction
string
default:"manual"
Action of the last outbound message in the conversation as string.
lastMessageDirection
string
default:"inbound"
Direction of the last message in the conversation as string.
status
string
default:"all"
The status of the conversation to be filtered - all, read, unread, starred
sortBy
string
default:"last_message_date"
The sorting of the conversation to be filtered as - manual messages or all messages
sortScoreProfile
string
default:"ABCHkzuJQ8ZMd4Te84GK"
Id of score profile on which sortBy.ScoreProfile should sort on
scoreProfile
string
default:"ABCHkzuJQ8ZMd4Te84GK"
Id of score profile on which conversations should get filtered out, works with scoreProfileMin & scoreProfileMax
scoreProfileMin
number
default:"ABCHkzuJQ8ZMd4Te84GK"
Minimum value for score
scoreProfileMax
number
default:"ABCHkzuJQ8ZMd4Te84GK"
Maximum value for score
startDate
number
default:"1640995200000"
Start date filter for dateAdded field (Unix timestamp in milliseconds)
endDate
number
default:"1672531199000"
End date filter for dateAdded field (Unix timestamp in milliseconds)

Respuestas

conversations
object[]
required
The list of all conversations found for the given query
total
number
default:"100"
required
Total Number of results found for the given query
{
  "conversations": [
    {
      "id": "ABCHkzuJQ8ZMd4Te84GK",
      "contactId": "ABCHkzuJQ8ZMd4Te84GK",
      "locationId": "ABCHkzuJQ8ZMd4Te84GK",
      "lastMessageBody": "This is a sample message body",
      "lastMessageType": "TYPE_SMS",
      "type": "TYPE_PHONE",
      "unreadCount": 1,
      "fullName": "John Doe",
      "contactName": "John Doe Company",
      "email": "johndoe@mailingdomain.com",
      "phone": "+15550001234"
    }
  ],
  "total": 100
}
{}
{}

Ejemplo

curl -X GET 'https://services.leadconnectorhq.com/conversations/search' \
  -H 'Authorization: Bearer YOUR_TOKEN' \
  -H 'Version: 2021-07-28'
const response = await fetch('https://services.leadconnectorhq.com/conversations/search', {
  method: 'GET',
  headers: {
    Authorization: `Bearer ${process.env.LEADWAY_TOKEN}`,
    Version: '2021-07-28',
  },
});
const data = await response.json();
import os, requests
response = requests.request(
    'GET',
    'https://services.leadconnectorhq.com/conversations/search',
    headers={
        'Authorization': f"Bearer {os.environ['LEADWAY_TOKEN']}",
        'Version': '2021-07-28',
    },
)
data = response.json()
<?php
$ch = curl_init('https://services.leadconnectorhq.com/conversations/search');
curl_setopt_array($ch, [
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'GET',
    CURLOPT_HTTPHEADER => [
        'Authorization: Bearer ' . getenv('LEADWAY_TOKEN'),
        'Version: 2021-07-28',
    ],
]);
$data = json_decode(curl_exec($ch), true);