Posts under category Meta & Facebook

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 have been using a Twilio phone number connected to a WhatsApp Business Account.

As far as I understand, for each conversation started, WhatsApp gives me a 24-hour window where I can send and receive any number of messages without additional charges (WhatsApp Conversation - Free Tier). However, it seems that I am somehow incurring in additional charges for each message sent and received (Messaging Channels Inbound Message and Messaging Channels Outbound Message where each costs $0.005).

I configured the WhatsApp sender to work with a webhook redirecting to an Azure Function App running Python Flask. Despite I can answer an incoming message via a Python Flask, I chose answering via the Twilio REST API (from twilio.rest import Client), since the webhook method gives me only 15 seconds to send an answer or it cuts the connection throwing error 11200, and some of my processes take longer than that.

Are this extra costs because I am using the Twilio REST API or is this a normal behavior of Twilio WhatsApp?

I am working on implementing a custom WhatsApp API integration to send verification codes to users on WhatsApp. I have already been approved for access to the WhatsApp Business API and obtained the necessary credentials.

Now, I want to send verification codes to users through WhatsApp using my custom integration. But I don't have any idea that how to do that?

I just wanna know How do I generate a random verification code in my application without getting any bugs?

And also I wanna know Which WhatsApp API endpoints should I use to send the verification code as a text message?

I was expecting a the most suitable way to do these things without getting any bugs

How can I integrate my WhatsApp for business (not using any 3rd party tools like Pabbly, WANotifier, etc.) to send a pdf document (Purchase Order details) to the customers without having to send a welcome text message and the customer not having to reply back with anything to receive the pdf document (Purchase Order details)?.

Note: if this is not possible then how does MakeMyTrip and book my show works where in which when we book tickets or shows we receive a pdf file (booking details) without we in person initiating the conversation of asking the booking details.

Went through the official MetaforDevelopers document https://developers.facebook.com/docs/whatsapp/cloud-api but couldn't find any solutions.

If somebody finds something out of the document link attached above related to my requirement, please let me know! Thanks in advance!