Posts tagged with whatsapi

Hey There Developers I am Trying to Integrate What's App Cloud Api from Meta for Developers Console and I am trying to Retrieve The Messages Templates using the api's .Reading it from there documentation i had created the api to retrive the templates but it shows me this error

"error": {         "message": "(#100) Tried accessing nonexisting field (message_templates) on node type (WhatsAppBusinessPhoneNumber)",         "type": "OAuthException",         "code": 100,         "fbtrace_id": "AHUox6aJYuhq3S7NnNDSE03"     } 

It would be a great help if you can help me solve this problem I have been Researching on the same for over a week now .....Thank You in advance

I am looking this api to retrieve all my available templates on the developers console
Meta For Developers

I'm facing an error when creating a media template with sample image file. I'm following the developer facebook documentation: "https://developers.facebook.com/docs/whatsapp/business-management-api/message-templates/#message--media----interactive-templates" and the section is "Example Media Template Request".

I'm trying the following code.

My component code is :

[{"type":"header","format":"IMAGE","example":{"header_handle":["https://edailyshopping.com/images/download.jpg"]}},{"type":"body","text":"Wishing you all Ramadan Mubarak."}] 

API URL: https://graph.facebook.com/v16.0/{whatsapp-business-account-ID}/message_template

response is getting success.

**The problem is template is created but the sample media file is not uploaded. **

Can anyone any idea about it why the sample image is not uploaded?

I have created a media template in what's app business API. But I cannot send the template message where the media file is attached in the header.

My media template object.

{     "name": "business_five",     "components": [         {             "type": "HEADER",             "format": "IMAGE",             "example": {                 "header_handle": [                     "https://scontent.whatsapp.net/v/t61.29466-34/323170987_1239753446972881_6537482729362490175_n.jpg?ccb=1-7&_nc_sid=57045b&_nc_ohc=24dzgQb3Xc8AX9Nllk_&_nc_ht=scontent.whatsapp.net&edm=AH51TzQEAAAA&oh=01_AdRx0hLfUqy4nKvgGz1cf23Em9ElezWo1o4UPrfwPGeVgg&oe=64336E79"                 ]             }         },         {             "type": "BODY",             "text": "Dear All,\nWishing you ramadan mubarak."         }     ],     "language": "en_US",     "status": "APPROVED",     "category": "MARKETING",     "id": "1235769690704590" } 

When I'm sending this template message to others using the API https://graph.facebook.com/{{version}}/{{phone_number_id}}/messages
it's showing the error :

(#132012) Parameter format does not match format in the created template

Can anyone help me with how can I send a media template message? My post field was

$message = [     "messaging_product" => "whatsapp",     "to" => "8801704158504",     "type" => "template",     "template" => [         "name" => $template->name,         "language" => [             "code" => $template->language         ],         "components" => [             [                 "type" => "header",                 "parameters" => [                     'type' => 'image',                     'image' => [                         'link' => 'https://imgur.com/a/wu3BP6R'                     ]                 ]             ]         ]     ] ]; 

Whatsapp (business) cloud API expires your chat session after 24 hours of inactivity. I developed a mini-app to use the API to send server alarms about the state of my machines, but when the (user-initiated) session is aging more than 24 hours the cloud API disables my notifications, it just silently drops all the messages (that I am sending via API) without any error code. Of course an alarm system can't be so unreliable so I need to keep the session with business test account (which sends all the messages) active before the API expires it.

How can I do it? I can't send messages on behalf of myself using the API, so how can you make the conversation active all the time programmatically so it never becomes inactive?

Or if there are any other methods to send Whatsapp messages programmatically all the time without manually initiating conversation with business account I would like to hear your suggestions.

I'm using WhatsApp Cloud API Integration for our company use case and all functionality will be server-to-server API call and I have to generate a Permanent token to call the WhatsApp API to send the message. I have submitted a request to get advance access to whatsapp_business_messaging but it got rejected as we do not have any frontend UI to showcase the implementation. Facebook support team said I do not need advance access if we are implementing WhatsApp API for our own use case. We have also generated the permanent key by creating a system user from the Facebook Business dashboard but the API throws an error that this key does not have permission.

Please guide me on how can a get approval or get a permanent access token to use the WhatsApp Cloud API Integration.

Thank you in advance