Skip to content

Instantly share code, notes, and snippets.

@yuryalencar
Last active February 25, 2023 02:48
Show Gist options
  • Save yuryalencar/51c24b12a934ace80daa5ba31fabc662 to your computer and use it in GitHub Desktop.
Save yuryalencar/51c24b12a934ace80daa5ba31fabc662 to your computer and use it in GitHub Desktop.
Teasy Bot Webhook: Step-by-step to code

Teasy Bot Webhook: Step-by-step to code

Summary

How it works ? 🇺🇸

Explanation

Teasy Bot Webhook is a feature to provide you receipt of every message sent to your Whatsapp. Using Teasy Bot and Webhook, you can create personalized conversations and collect your customers data sent to you through Whatsapp.

Limitations

Teasy Bot Webhook only receives incoming texts. Images, documents or videos are not supported in this version. But if your image, document or video is sent with text, you will only receive the text of the message.

What do i need to use Teasy Bot Webhook ?

  1. Contact the Teasy Solutions company using the WhatsApp[+55 (48) 99205-1362] or E-mail[contact@teasy.solutions]
  2. Hire Teasy Bot (You can try it for free for 14 days)
  3. Connect your Whatsapp with Teasy Bot
    • In this step you will receive your access_key
  4. Implement your webhook using this Gist
  5. Send the webhook URL to Teasy Solutions

How you need code your Webhook

  1. Your webhook needs to receive the access_key parameter in the headers of the request
  2. Your webhook go to receive a payload with phoneNumber, dateTime and, a message
    • phoneNumber: Number of the sent the message
    • dateTime: Date and time of the message was received
    • message: Text with message received
  3. Your request must be of type POST
  4. The URL naming is free, you can implement: https://my-domain.com/teasy-bot-webhook (suggestion)

Your request needs to work with this example of the request using cURL

curl --request POST \
  --url https://my-domain.com/teasy-bot-webhook \
  --header 'Content-Type: application/json' \
  --header 'access_key: example-of-the-access-key' \
  --data '{
	"phoneNumber": "5548900000000",
	"dateTime": "2023-02-24 10:00:00",
	"message": "example of the message"
}'

Como funciona ? 🇧🇷

Explicação

Teasy Bot Webhook é um recurso para fornecer o recebimento de todas as mensagens enviadas para o seu Whatsapp. Usando Teasy Bot e Webhook, você pode criar conversas personalizadas e coletar dados de seus clientes enviados a você pelo Whatsapp.

Limitações

Teasy Bot Webhook recebe apenas textos recebidos. Imagens, documentos ou vídeos não são suportados nesta versão. Mas se sua imagem, documento ou vídeo for enviado com texto, você receberá apenas o texto da mensagem.

O que eu preciso para usar o Teasy Bot Webhook?

  1. Entre em contato com a empresa Teasy Solutions usando o WhatsApp [+55 (48) 99205-1362] ou E-mail [contact@teasy.solutions]
  2. Contrate o Teasy Bot (você pode experimentá-lo gratuitamente por 14 dias)
  3. Conecte seu Whatsapp com o Teasy Bot
    • Nesta etapa você receberá sua access_key
  4. Implemente seu webhook usando este Gist
  5. Envie a URL do webhook para a Teasy Solutions

Como você precisa codificar seu Webhook

  1. Seu webhook precisa receber o parâmetro access_key nos headers da requisição
  2. Seu webhook vai receber um payload com phoneNumber, dateTime e uma message
    • phoneNumber: Número de quem enviou a mensagem
    • dateTime: Data e hora em que a mensagem foi recebida
    • mensagem: Texto com mensagem recebida
  3. Sua requisição deve ser do tipo POST
  4. A nomenclatura do URL é livre, uma sugestão seria: https://my-domain.com/teasy-bot-webhook

Sua requisição precisa funcionar com este exemplo de requisição usando cURL

curl --request POST \
  --url https://my-domain.com/teasy-bot-webhook \
  --header 'Content-Type: application/json' \
  --header 'access_key: example-of-the-access-key' \
  --data '{
	"phoneNumber": "5548900000000",
	"dateTime": "2023-02-24 10:00:00",
	"message": "example of the message"
}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment