ultramsg / csharp-whatsapp-chatbot

Make WhatsApp Chatbot and use WhatsApp API to send the WhatsApp messages in c# .

Home Page:https://ultramsg.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ultramsg.com csharp-whatsapp-chatbot

Demo WhatsApp API ChatBot using Ultramsg API with c#.

by Ultramsg.com

Dependencies

for local development purposes, a tunneling service is required. This example uses ngrok , You can download ngrok from here.

Set the instance ID and token

Set the instance ID and token in appsettings.json file.

run project

dotnet watch

Start ngrok

Run ngrok For Windows :

ngrok http https://localhost:6000

Run ngrok For mac :

./ngrok http https://localhost:6000

Set Webhook URL

Go to your ultramsg account for set Webhook URL after copying the ngrok url and add /api/ Route like this :

https://61-44-136-9.ngrok.io/api/

and enable this option "Webhook on Received" .

Alt text

receive WhatsApp messages and command processing

Congratulations.. Now you can try sending to WhatsApp number and testing the chatbot.

This is all you need to receive and read messages from users, and then respond to them. You can develop the list and add more complex commands such as querying from Database and updating records in the database ..etc.

Support

Use Issues to contact me

About

Make WhatsApp Chatbot and use WhatsApp API to send the WhatsApp messages in c# .

https://ultramsg.com


Languages

Language:C# 100.0%