1MSG
ReferenceInbox API

Buscar conversas

GET
/api/v1/inbox/conversations/search

Busca por nome do contato, telefone e texto das mensagens em um canal. channelId é obrigatório. query precisa ter pelo menos 3 caracteres; uma busca mais curta retorna duas listas vazias.

Authorization

bearer
headerAuthorizationBearer <token>

Chave gerada em Settings → Developer → API key. Os métodos do Inbox precisam do escopo Inbox. Os métodos de Campaigns precisam do escopo Campaigns.

Query Parameters

query*string

Pelo menos 3 caracteres.

channelId?string

Canal onde buscar. Obrigatório.

Response Body

application/json
  1. response
contacts*array<>

Conversas encontradas pelo nome ou telefone do contato.

messages*array<>

Conversas encontradas pelo texto das mensagens. Uma conversa que já está em contacts não se repete aqui.

curl -X GET 'https://api.1msg.io/api/v1/inbox/conversations/search?query=7900'
{  "contacts": [    {      "id": "string",      "channelId": "string",      "contactId": "string",      "status": "OPEN",      "assignedTo": "string",      "assignedUser": {        "id": "b2bb82f0-2253-4e05-b955-a21f3d699caa",        "name": "QA Stage",        "avatar": null      },      "lastMessageAt": "2019-08-24T14:15:22Z",      "isUnread": true,      "tags": [        "string"      ],      "lastMessagePreview": "string",      "lastMessageType": "string",      "lastMessageDirection": "INBOUND",      "lastMessageStatus": "string",      "unreadCount": 0,      "isBlocked": true,      "title": "string",      "lastCustomerMessageAt": "2019-08-24T14:15:22Z",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "contact": {        "id": "string",        "phoneNumber": "79001234567",        "name": "string",        "avatar": "string"      },      "channelType": "WABA",      "customerPhone": "string"    }  ],  "messages": [    {      "id": "string",      "channelId": "string",      "contactId": "string",      "status": "OPEN",      "assignedTo": "string",      "assignedUser": {        "id": "b2bb82f0-2253-4e05-b955-a21f3d699caa",        "name": "QA Stage",        "avatar": null      },      "lastMessageAt": "2019-08-24T14:15:22Z",      "isUnread": true,      "tags": [        "string"      ],      "lastMessagePreview": "string",      "lastMessageType": "string",      "lastMessageDirection": "INBOUND",      "lastMessageStatus": "string",      "unreadCount": 0,      "isBlocked": true,      "title": "string",      "lastCustomerMessageAt": "2019-08-24T14:15:22Z",      "createdAt": "2019-08-24T14:15:22Z",      "updatedAt": "2019-08-24T14:15:22Z",      "contact": {        "id": "string",        "phoneNumber": "79001234567",        "name": "string",        "avatar": "string"      },      "channelType": "WABA",      "customerPhone": "string"    }  ]}