Whatsapp business api permanent token not working on an app in developement mode
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) )
`
recipient_type is not required, preview_url should be one less scope. Can you try that?
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.