Obter Conversa de Assinante
Esta API permite obter o histórico de conversas com um assinante específico através do WhatsApp.
Histórico de Conversas
O histórico de conversas permite visualizar todas as mensagens trocadas entre a sua conta do WhatsApp Business e um número de telefone específico. Isso é útil para análise de interações, suporte ao cliente e acompanhamento de conversas.
Endpoint da API
Parâmetros
Seu número de telefone do WhatsApp
Número de telefone do assinante
Buscar número da mensagem da conversa
Deslocamento de paginação
Exemplo de Solicitação
curl -X POST \
'https://app.wizebot.com.br/api/v1/whatsapp/get/conversation' \
-d 'apiToken=API-KEY' \
-d 'phone_number_id=PHONE-NUMBER-ID' \
-d 'phone_number=PHONE-NUMBER' \
-d 'limit=10' \
-d 'offset=1'
Exemplo de Resposta
{
"status" : "1" ,
"message" : [
{
"id" : 8443 ,
"whatsapp_bot_subscriber_subscriber_id" : "88017XXXXX-23" ,
"whatsapp_bot_id" : 23 ,
"sender" : "bot" ,
"agent_name" : null ,
"message_content" : "{ \" delay_in_reply \" :0, \" messaging_product \" : \" whatsapp \" , \" recipient_type \" : \" individual \" , \" to \" : \" 88017XXXX9003 \" , \" type \" : \" interactive \" , \" interactive \" :{ \" header \" :{ \" type \" : \" text \" , \" text \" : \" Order gateway \" }, \" body \" :{ \" text \" : \" How would you like to purchase it? \" }, \" type \" : \" button \" , \" action \" :{ \" buttons \" :[{ \" type \" : \" reply \" , \" reply \" :{ \" id \" : \" 5lvomLOuENXIe6D::gPeAiDDmVQR_jTR \" , \" title \" : \" Paypal pay \" }},{ \" type \" : \" reply \" , \" reply \" :{ \" id \" : \" YES_START_CHAT_WITH_HUMAN::CBaLoC4yTMyIljZ \" , \" title \" : \" COD \" }}]}}}" ,
"conversation_time" : "2024-07-28 13:21:03" ,
"wa_message_id" : "wamid.HBgNODgwMTcyMzMwOTAwMxUCABEYEjlGQkY3MEFEMEVGODhCNDkxNQA=" ,
"reaction_data" : null ,
"message_status" : null ,
"delivery_status_updated_at" : "2024-07-28 13:21:03" ,
"failed_reason" : ""
}
]
}
Teste a API
Para testar esta API, você precisará de sua chave API (apiToken) que pode ser encontrada no painel da WizeBot em Configurações > API.
curl -X POST \
'https://app.wizebot.com.br/api/v1/whatsapp/get/conversation' \
-d 'apiToken=SUA_API_KEY_AQUI' \
-d 'phone_number_id=SEU_PHONE_NUMBER_ID' \
-d 'phone_number=NUMERO_DO_ASSINANTE' \
-d 'limit=10' \
-d 'offset=0'
Sucesso
Erro - API Key Inválida
Erro - Parâmetros Inválidos
Erro - Assinante Não Encontrado
{
"status" : "1" ,
"message" : [
{
"id" : 8443 ,
"whatsapp_bot_subscriber_subscriber_id" : "88017XXXXX-23" ,
"whatsapp_bot_id" : 23 ,
"sender" : "bot" ,
"agent_name" : null ,
"message_content" : "{ \" delay_in_reply \" :0, \" messaging_product \" : \" whatsapp \" , \" recipient_type \" : \" individual \" , \" to \" : \" 88017XXXX9003 \" , \" type \" : \" interactive \" , \" interactive \" :{ \" header \" :{ \" type \" : \" text \" , \" text \" : \" Order gateway \" }, \" body \" :{ \" text \" : \" How would you like to purchase it? \" }, \" type \" : \" button \" , \" action \" :{ \" buttons \" :[{ \" type \" : \" reply \" , \" reply \" :{ \" id \" : \" 5lvomLOuENXIe6D::gPeAiDDmVQR_jTR \" , \" title \" : \" Paypal pay \" }},{ \" type \" : \" reply \" , \" reply \" :{ \" id \" : \" YES_START_CHAT_WITH_HUMAN::CBaLoC4yTMyIljZ \" , \" title \" : \" COD \" }}]}}}" ,
"conversation_time" : "2024-07-28 13:21:03" ,
"wa_message_id" : "wamid.HBgNODgwMTcyMzMwOTAwMxUCABEYEjlGQkY3MEFEMEVGODhCNDkxNQA=" ,
"reaction_data" : null ,
"message_status" : null ,
"delivery_status_updated_at" : "2024-07-28 13:21:03" ,
"failed_reason" : ""
}
]
}