Posts tagged with facebook-graph-api

After weeks of having a WhatsApp Cloud API up and running, suddenly all my phone numbers can no longer send messages. Keep getting (#200) You do not have the necessary permissions required to send messages on behalf of this WhatsApp Business Account.

I have already checked the Meta Token Debugger, and my token has all necessary permissions (whatsapp_business_management and whatsapp_business_messaging (and business_management just in case)), and have added (and re-added) (system)users to my WhatsApp accounts w/ new tokens, but no luck.

I already have a support case with Meta, but so far they've been radio-silent, and it's kinda business critical to make sure my bots are able to reply to any request, so trying here too.

I am trying to create a template from postman by sending this object:

{     "name": "listado_productos",     "language": "es",     "category": "TRANSACTIONAL",     "components": [         {             "type" : "HEADER",             "format": "document",             "example": {                 "header_handle": [                     "https://drive.google.com/file/d/1CcTpDZL3p0ltMFhIKU9Vhz1LWG0bQFpN/view?usp=share_link"                 ]}         },         {             "type": "BODY",             "text": "Buenas tardes, acá le enviamos el nuevo listado de precios. Muchas gracias"         },         {             "type": "FOOTER",             "text": "ABS."         }     ] } 

If I try an example from the official business-management-api guide, it also rejects it for non-compliance with terms and conditions.

"name": "promotional_message",   "language": "en_US",   "category": "TRANSACTIONAL",   "components": [{            "type":"BODY",            "text":"Hi {{1}}, get an extra 10% off every order above $300.",            "example":{"body_text":[["Sonia"]]}          },          {            "type":"HEADER",            "format":"TEXT",            "text": "Bonus Tuesday starts now!"          },          {            "type":"FOOTER",            "text":"Not interested? Tap Stop promotions"          },          {            "type":"BUTTONS",            "buttons":[{"type":"QUICK_REPLY", "text": "Shop now"},             {"type":"QUICK_REPLY", "text": "Stop promotions"}]          }]   

The response is that it is rejected for being duplicate or not complying with WhatsApp Busiess Api terms and services but it is not true, I read the terms and conditions and the file / message format complies. Does anyone identify the problem?

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) ) 

`

Our app already have business_management, whatsapp_business_messaging, whatsapp_business_management approval from facebook. The issue is when we try to subscribe to any business whatsapp number outside our business manager it gives us error of "error_user_title": "App not linked to a Business", "error_user_msg": "Your App is not linked to a Business or the Business doesn't have access to the WhatsApp Business Account.",

I have created a WhatsApp business App on https://developers.facebook.com/apps/

I am able to send messages using the API & Access Token

curl -X POST \   'https://graph.facebook.com/v15.0/FROM_PHONE_NUMBER_ID/messages' \   -H "Authorization: ACCESS_TOKEN" \   -d '{     "messaging_product": "whatsapp",     "to": "1650XXXXXXX",     "text": {"body" : "hi"}    }' 

I want to send the message in a WhatsApp group, any ways to achieve this?