Posts tagged with whatsapp

Is it possible to use the WhatsApp business API to communicate with users and also allow them to forward content from WhatsApp directly to our application. For example enabling Web-hooks for different WhatsApp channels to receive the messages from those channels. If yes, can someone guide me how can we implement this feature? and how can we authorize those channels with our WA business account

Finding sources/documentation for developing needed feature

I am building an application using the WhatsApp Business Cloud API. Essentially I want to know if it's possible to build an application that collects all the messages from the day and downloads it. Specifically the media attached to it using the API. As far as I know you can use webhooks to get incoming messages. But in order to do this the application has to be run forever, and my cousin has a problem with this as it could cause problems to run an application forever vs just run it once a day. I'm able to send messages using the API and a python wrapper but that's much more simple than what I'm trying to do. Aditionally, there is an option of using selenium but that's not really an automated solution to what we're trying to do because everytime selenium executes the browser we'd need to log in using the QR code. If anyone has any idea if this is possible (or not possible) I'd be very appreciative!

from heyoo import WhatsApp import logging import requests from dotenv import load_dotenv from flask import Flask, request, make_response app = Flask(__name__) token = 'EAAVk5rqOCsABAAcPPrZC6GnlZAJuykdFIQd4DhkuRVNeGntfFOU5jaK4jG2yCZBS6i7kFQGk3kRvDP0fExBXRsFyqWUqfVVJsSxeQdcA9XHWpRuUsnnuwqLcZAQpwTiuoZCXv4ixCcHYlPEe6NGHupCalHvWw9NQRoZAVnegU5ZCBvX6eO9E8vyum1lQ2SSt7OuUpdpIkmkyBK8tiEL8rpGwM8RrqZA3A10ZD' messenger = WhatsApp(token,  phone_number_id='100398242927044') messenger.send_message('Hey its JJ ', '1xxxxxxxx') logging.basicConfig(     level=logging.INFO, format="%(asctime)s - %(name)s - %(levelname)s - %(message)s" ) print("hello") @app.route("/", methods=["GET", "POST"]) def hook(): 

//some code that isn't working yet

I'm new to all of this stuff so I don't really know how to set up a webhook either but my cousin who's business I'm building this app for doesn't ideally want to use a webhook.

We are using an integration with whatsapp business API and it is working great, but we need to check if we have a new message or if the user have replied, we try it to use the whatsapp business app, but we can't access to the app and it seems like that whatsapp doesn't allow to use the App and API with the same number, then is there any way to check the messages like an app or dashboard?

I have been investigating in internet but I cannot find any solutions for that

When doing an api call, I'm getting the response 400 with reason

"Unsupported post request. Object with ID '###############' does not exist, cannot be loaded due to missing permissions, or does not support this operation".

Though the permissions for whatsapp_business_messaging and whatsapp_business_management was given and token was generated for an admin user.

Is it that permanent tokens does not work on apps with apps in development mode? Because the temporary token was working with the same code and messages were being sent correctly.

I'm trying this for Odoo 16 in python 3.8 `

recipient_phone_number = rec.owner_id.partner_id.mobile url = f"https://graph.facebook.com/v15.0/{phone_number_id}/messages" headers = {     "Authorization": f"Bearer {access_token}",     'Content-Type': 'application/json' } # Code for sending text message in whatsapp. text_data = {     'messaging_product': 'whatsapp',     "recipient_type": "individual",     'to': recipient_phone_number,     'type': 'text',     "text": {         "preview_url": False,         "body": "Dear %s, this message is to remind that document %s will expire on %s."                 % (rec.owner_id.name, rec.name, rec.expiry_date)     } } text_response = requests.post(     url,     headers=headers,     data=json.dumps(text_data) ) 

`