ReferenceInbox API
Buscar conversas
GET
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.
bearerheader
AuthorizationBearer <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*stringPelo menos 3 caracteres.
channelId?stringCanal onde buscar. Obrigatório.
application/json- 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" } ]}