Posts tagged with facebook-graph-api

{     "error": {         "message": "(#132001) Template name does not exist in the translation",         "type": "OAuthException",         "code": 132001,         "error_data": {             "messaging_product": "whatsapp",             "details": "template name (message_request) does not exist in en_US"         },         "fbtrace_id": "A_EjJh2lU36b3yKxpX9q8WD"     } } 

We have successfully created a message template having 2 buttons in WhatsApp manager under meta business settings.

Name of the template: message_request  Language: English (US) Status: Active – Quality pending 

While trying the graph API to send message to user, we get error.

Request:

{   "messaging_product": "whatsapp",   "recipient_type": "individual",   "to": "913456666661",   "type": "template",   "template": {         "name": "message_request",         "language": {             "code": "en_US"         }   } } 

Response:

{     "error": {         "message": "(#132001) Template name does not exist in the translation",         "type": "OAuthException",         "code": 132001,         "error_data": {             "messaging_product": "whatsapp",             "details": "template name (message_request) does not exist in en_US"         },         "fbtrace_id": "A_EjJh2lU36b3yKxpX9q8WD"     } } 

What is causing this issue?

Facebook has the following API -

https://graph.facebook.com/API_VERSION/me?fields=FIELDS&access_token=ACCESS_TOKEN 

Does WhatsApp have a similar API where I can get all account information, such as phone number ID and business account ID, by using only the access token and nothing else? I have searched the official documentation and all the APIs I have come across either use the business account ID or the phone number ID to retrieve account information.

I would really appreciate any suggestions provided. Thank you.

I am trying to send WhatsApp message, using WhatsApp Business API and GraphQL.

But I am getting this error:

Failed to send message to :  {     "error":{         "message":"(#132012) Parameter format does not match format in the created template",         "type":"OAuthException",         "code":132012,         "error_data": {             "messaging_product":"whatsapp",             "details":"header: Format mismatch, expected IMAGE, received UNKNOWN"         },         "fbtrace_id":"AyPLLsvyikPmg66DWF_ZfYU"     } } 

This is the code I have written. And also I am sharing the message structure.

import requests import openpyxl access_token = "" template_name = "healthy_sports_b2s_2"  # Replace with your template name language_code = "en" wb = openpyxl.load_workbook("numbers.xlsx") sheet = wb.active for row in sheet.iter_rows(min_row=2, values_only=True):     customer_number = row[0]     url = f"https://graph.facebook.com/v17.0/XXXXXXXXXXXXXXX/messages"     headers = {         "Authorization": f"Bearer {access_token}",         "Content-Type": "application/json",     }     message_payload = {         "messaging_product": "whatsapp",         "to": customer_number,         "type": "template",         "template": {"name": template_name, "language": {"code": language_code}},         "components": [             {                 "parameters": [                     {                         "type": "template",                         "image": {                             "link": "https://res.cloudinary.com/dapnrioqr/image/upload/v1691648851/02_wgucrp.jpg"                         },                     }                 ]             }         ],     }     response = requests.post(url, json=message_payload, headers=headers)     if response.status_code == 200:         print(f"Message sent to {customer_number}")     else:         print(f"Failed to send message to {customer_number}: {response.text}") 

What can I do to solve this

This is the actual message

I am using Whatsapp's Business API through Meta's Graph API. One of my end user claimed he didn't receive a business-initiated message however on my end I received (through webhooks) both sent and delivered confirmation.

I then gave him the chatbot's number and when he tried to send a text, he was prompted to accept Whatsapp's Chatbot Privacy Policy (or something like that).

So are we not able to start business-initiated conversations to users that never had prior interaction with a chatbot?