Posts tagged with whatsapi

If anyone has worked with Twilio's WhatsApp Business API you may be able to help.

Can you please confirm this: we purchased a UK number from Twilio but we are based and operate in Kuwait. So we will be using the UK number to send WhatsApp messages to users' in Kuwait. Is that fine? Additionally, as we were waiting for Twilio to approve our number we received the attached image and not sure what it means.

We've contacted Twilio support but they're taking a while to respond. Image:

  • Note: we've been approved and Twilio is linked to our Facebook manager. So on the FB side we're good to go, but just waiting for Twilio to approve our sender number so we can use the WhatsApp API.

I have deployed a multiconnect setup of the WhatsApp Business API client in Production Kubernetes enviroment, using the documentation for Minikube Developer Setup: Multiconnect on Minikube as referece.

But when doing the first login, in order to get the auth token, i get the following error on Postman:

{     "meta": {         "version": "v2.37.1",         "api_status": "stable"     },     "errors": [         {             "code": 1006,             "title": "Resource not found",             "details": "URL path not found"         }     ] } 

All the containers are running:

NAME                                           READY   STATUS      RESTARTS   AGE mysql-dev-6cdc47979f-6f6t5                     1/1     Running     0          2d23h whatsapp-coreapp-deployment-7bb4c6b8bc-qw946   1/1     Running     0          24m whatsapp-coreapp-deployment-7bb4c6b8bc-zkj5z   1/1     Running     0          24m whatsapp-master-deployment-84ffbdd48d-4rw8w    1/1     Running     0          24m whatsapp-master-deployment-84ffbdd48d-zwvlq    1/1     Running     0          24m whatsapp-web-deployment-74b99f4579-s44lp       1/1     Running     1          25m whatsapp-web-deployment-74b99f4579-sn55t       1/1     Running     0          25m 

And the given error happens on every call on Postman, not only when logging in (check health, get users, login, login admin, etc), all of them gives the same error:

"code": 1006, "title": "Resource not found", "details": "URL path not found" 

I've checked the container logs and i'ts returning 404 for every path called:

[2021-12-20 12:40:57.546610] app.INFO: [dd610cd0d21e431fafafc737c323565e] Response:  {"meta":{"version":"v2.37.1","api_status":"stable"},"errors":[{"code":1006,"title":"Resource not found","details":"URL path not found"}]} [] [2021-12-20 12:40:57.548893] app.INFO: [dd610cd0d21e431fafafc737c323565e] Request POST_//v1/users/login returns 404 in 530.65 ms [] [] [2021-12-20 12:45:18.556704] app.ERROR: [4018a09ea0084f9fa82f843905de2b00] Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET //v1/stats/app" (uncaught exception) at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php line 2 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET //v1/stats/app\" at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php:2, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0): No routes found for \"//v1/stats/app\". at /var/www/html/vendor/symfony/routing/Matcher/UrlMatcher.php:2)"} [] [2021-12-20 12:45:18.557154] app.INFO: [4018a09ea0084f9fa82f843905de2b00] Response:  {"meta":{"version":"v2.37.1","api_status":"stable"},"errors":[{"code":1006,"title":"Resource not found","details":"URL path not found"}]} [] [2021-12-20 12:45:18.557462] app.INFO: [4018a09ea0084f9fa82f843905de2b00] Request GET_//v1/stats/app returns 404 in 84.57 ms [] [] [2021-12-20 12:52:11.890507] app.ERROR: [5a84217237cc49e8bb9df953ac32c799] Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /auth/v1/login/" (uncaught exception) at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php line 2 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /auth/v1/login/\" at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php:2, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0): No routes found for \"/auth/v1/login/\". at /var/www/html/vendor/symfony/routing/Matcher/UrlMatcher.php:2)"} [] [2021-12-20 12:52:11.890825] app.INFO: [5a84217237cc49e8bb9df953ac32c799] Response:  {"meta":{"version":"v2.37.1","api_status":"stable"},"errors":[{"code":1006,"title":"Resource not found","details":"URL path not found"}]} [] [2021-12-20 12:52:11.891043] app.INFO: [5a84217237cc49e8bb9df953ac32c799] Request GET_/auth/v1/login/ returns 404 in 84.07 ms [] [] [2021-12-20 12:52:12.088612] app.ERROR: [2b26c43f700640f190977bb797ec4448] Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /favicon.ico" (from "https://192.168.88.80:31599/auth/v1/login/") (uncaught exception) at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php line 2 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /favicon.ico\" (from \"https://192.168.88.80:31599/auth/v1/login/\") at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php:2, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0): No routes found for \"/favicon.ico\". at /var/www/html/vendor/symfony/routing/Matcher/UrlMatcher.php:2)"} [] [2021-12-20 12:52:12.088863] app.INFO: [2b26c43f700640f190977bb797ec4448] Response:  {"meta":{"version":"v2.37.1","api_status":"stable"},"errors":[{"code":1006,"title":"Resource not found","details":"URL path not found"}]} [] [2021-12-20 12:52:12.089117] app.INFO: [2b26c43f700640f190977bb797ec4448] Request GET_/favicon.ico returns 404 in 82.22 ms [] [] 

Edit: Here's also the logs for the second replica of the webapp deployment

Web server started Starting web monitor loop ... ==> /var/log/lighttpd/error.log <== 2021-12-20 12:38:05: (server.c.1488) server started (lighttpd/1.4.55) tail: cannot open '/var/log/whatsapp/web.log' for reading: No such file or directory Setting up watches. Watches established. tail: '/var/log/whatsapp/web.log' has appeared;  following new file [2021-12-20 12:52:24.295383] app.ERROR: [7c73b15c0a6c488fb5ac7703a4b337ec] Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /teste/" (uncaught exception) at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php line 2 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /teste/\" at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php:2, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0): No routes found for \"/teste/\". at /var/www/html/vendor/symfony/routing/Matcher/UrlMatcher.php:2)"} [] [2021-12-20 12:52:24.302930] app.INFO: [7c73b15c0a6c488fb5ac7703a4b337ec] Response:  {"meta":{"version":"v2.37.1","api_status":"stable"},"errors":[{"code":1006,"title":"Resource not found","details":"URL path not found"}]} [] [2021-12-20 12:52:24.307525] app.INFO: [7c73b15c0a6c488fb5ac7703a4b337ec] Request GET_/teste/ returns 404 in 201.72 ms [] [] [2021-12-21 11:04:28.642518] app.ERROR: [7181dfea9e7b4e51adb41fc41571253f] Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "POST //v1/users/login" (uncaught exception) at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php line 2 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"POST //v1/users/login\" at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php:2, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0): No routes found for \"//v1/users/login\". at /var/www/html/vendor/symfony/routing/Matcher/UrlMatcher.php:2)"} [] [2021-12-21 11:04:28.644938] app.INFO: [7181dfea9e7b4e51adb41fc41571253f] Response:  {"meta":{"version":"v2.37.1","api_status":"stable"},"errors":[{"code":1006,"title":"Resource not found","details":"URL path not found"}]} [] [2021-12-21 11:04:28.645501] app.INFO: [7181dfea9e7b4e51adb41fc41571253f] Request POST_//v1/users/login returns 404 in 87.15 ms [] [] [2021-12-21 11:05:29.180215] app.ERROR: [8ce236970e404d7b90d86ad53e774105] Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /auth/v1/login/" (uncaught exception) at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php line 2 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /auth/v1/login/\" at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php:2, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0): No routes found for \"/auth/v1/login/\". at /var/www/html/vendor/symfony/routing/Matcher/UrlMatcher.php:2)"} [] [2021-12-21 11:05:29.180746] app.INFO: [8ce236970e404d7b90d86ad53e774105] Response:  {"meta":{"version":"v2.37.1","api_status":"stable"},"errors":[{"code":1006,"title":"Resource not found","details":"URL path not found"}]} [] [2021-12-21 11:05:29.181257] app.INFO: [8ce236970e404d7b90d86ad53e774105] Request GET_/auth/v1/login/ returns 404 in 26.28 ms [] [] [2021-12-21 11:05:29.332427] app.ERROR: [feb8c3253624422383421e253fc8ce73] Symfony\Component\HttpKernel\Exception\NotFoundHttpException: No route found for "GET /favicon.ico" (from "https://192.168.88.80:31599/auth/v1/login/") (uncaught exception) at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php line 2 {"exception":"[object] (Symfony\\Component\\HttpKernel\\Exception\\NotFoundHttpException(code: 0): No route found for \"GET /favicon.ico\" (from \"https://192.168.88.80:31599/auth/v1/login/\") at /var/www/html/vendor/symfony/http-kernel/EventListener/RouterListener.php:2, Symfony\\Component\\Routing\\Exception\\ResourceNotFoundException(code: 0): No routes found for \"/favicon.ico\". at /var/www/html/vendor/symfony/routing/Matcher/UrlMatcher.php:2)"} [] [2021-12-21 11:05:29.332971] app.INFO: [feb8c3253624422383421e253fc8ce73] Response:  {"meta":{"version":"v2.37.1","api_status":"stable"},"errors":[{"code":1006,"title":"Resource not found","details":"URL path not found"}]} [] [2021-12-21 11:05:29.333465] app.INFO: [feb8c3253624422383421e253fc8ce73] Request GET_/favicon.ico returns 404 in 21.29 ms [] [] 

And here is the service that got created for webapp:

NAME                       TYPE           CLUSTER-IP      EXTERNAL-IP      PORT(S)                               AGE whatsapp-web-service       NodePort       10.110.67.166   <none>           443:31599/TCP                         22h 

What could this be?

I use Whatsapp Business API and started 3 docker images to do it. But I don't know url to make requests. I tried 0.0.0.0:9090, 127.0.0.1:9090, localhost:9090 but nothing works. How can I know right url?

Under docker containers I add attach image. And as stackoverflow restricts me to post question I need add some text "water".

Here is a file with settings docker-compose.yml version: '3'

volumes:   whatsappMedia:     driver: local   mysqlData:     driver: local services:    db:      image: mysql:5.7.35      restart: always      environment:         MYSQL_ROOT_PASSWORD: testpass         MYSQL_USER: testuser         MYSQL_PASSWORD: testpass      expose:         - "33060"     ports:     - "33060:3306" volumes:  - mysqlData:/var/lib/mysql network_mode: bridge cap_drop:   - MKNOD wacore:  image: docker.whatsapp.biz/coreapp:v${WA_API_VERSION:-2.35.5?Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.37.1 docker-compose <command> <options>)} command: ["/opt/whatsapp/bin/wait_on_mysql.sh", "/opt/whatsapp/bin/launch_within_docker.sh"] volumes:  - whatsappMedia:/usr/local/wamedia env_file:   - db.env environment:   # This is the version of the docker templates being used to run WhatsApp Business API   WA_RUNNING_ENV_VERSION: v2.2.3   ORCHESTRATION: DOCKER-COMPOSE depends_on:   - "db" network_mode: bridge links:   - db cap_drop:   - MKNOD waweb: image: docker.whatsapp.biz/web:v${WA_API_VERSION:-2.35.4?Run docker-compose with env var WA_API_VERSION (ex. WA_API_VERSION=2.37.1 docker-compose <command> <options>)} command: ["/opt/whatsapp/bin/wait_on_mysql.sh", "/opt/whatsapp/bin/launch_within_docker.sh"] ports:  - "9090:443" volumes:  - whatsappMedia:/usr/local/wamedia env_file:   - db.env environment:   WACORE_HOSTNAME: wacore   # This is the version of the docker templates being used to run WhatsApp Business API   WA_RUNNING_ENV_VERSION: v2.2.3   ORCHESTRATION: DOCKER-COMPOSE depends_on:   - "db"   - "wacore" links:   - db   - wacore network_mode: bridge cap_drop:   - MKNOD 

I was tring to configure and setup the developer environment of a single instance of the WhatsApp Business API.I had finished #Step 5 https://developers.facebook.com/docs/whatsapp/installation/dev-single-instance#step-5--verify-containers-are-running and the docker is running. enter image description here

Whenever I try to call https://localhost:9090 in browser but the error is "This site can’t be reached". then i used the command docker-compose logs,the error is MySQL is not up yet - sleeping and getaddrinfo for host "db" port 3306: Name or service not known enter image description here Here is db.env code

WA_DB_ENGINE=MYSQL WA_DB_HOSTNAME=db WA_DB_PORT=3306 WA_DB_USERNAME=root WA_DB_PASSWORD=testpass WA_DB_CONNECTION_IDLE_TIMEOUT=180000 

So anyone have idea please, thanks a lot.

I am trying to send a pdf through WhatsApp Business API that is stored in google drive, but I am receiving an error " 12300 - Invalid Content-Type " can you help me where am I going wrong also, I want to know how to send a pdf in MediaUrl from my local storage. I tried using Twilio Assets but it's also not working. Here is my code:

 static void Main(string[] args) {     var accountSid = " ";     var authToken = " ";     TwilioClient.Init(accountSid, authToken);     ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;     var mediaUrl = new[] {         new Uri("google drive link")     }.ToList();          var messageOptions = new CreateMessageOptions(         new PhoneNumber("whatsapp:+91XXXXXX"));     messageOptions.From = new PhoneNumber("whatsapp:+XXXXXXXX");     messageOptions.Body = "Hello how are you?";     messageOptions.MediaUrl = mediaUrl;     var message = MessageResource.Create(messageOptions);     Console.WriteLine(message.Body);     Console.ReadLine(); }