Not getting OTP on verification of phone number for WhatsApp cloud API
Steps I took to reach the verification screen:
-> Whatsapp -> API setup -> Verify phone number.
Other messages are coming on my virtual number.
Tony-Marketing-API.cn is a vibrant community dedicated to Facebook, Meta,Google Ads api, app development, Instagram, and related technologies. It offers valuable bug solutions, troubleshooting cases, and problem-solving strategies shared by users. Stay updated with real-world solutions, development tips, and the latest trends in digital marketing and app development.
Steps I took to reach the verification screen:
-> Whatsapp -> API setup -> Verify phone number.
Other messages are coming on my virtual number.
I am trying to implement whatsapp embedded signup flow for integrating whatsapp . Followed the documentation : https://developers.facebook.com/docs/whatsapp/embedded-signup/embed-the-flow/
embedded a simple button as login in to facebook
and the javascript for that is as follows
window.fbAsyncInit = function () {
// JavaScript SDK configuration and setup
console.log(facebookMetaData.metaAPPID)
FB.init({
appId: facebookMetaData.metaAPPID, // Meta App ID
cookie: true, // enable cookies
xfbml: true, // parse social plugins on this page
version: 'v19.0' //Graph API version
});
};
// Load the JavaScript SDK asynchronously
(function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src = "https://connect.facebook.net/en_US/sdk.js";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
// Facebook Login with JavaScript SDK
function launchWhatsAppSignup() {
// Conversion tracking code
fbq && fbq('trackCustom', 'WhatsAppOnboardingStart', {appId: facebookMetaData.metaAPPID, feature: 'whatsapp_embedded_signup'});
// Launch Facebook login
FB.login(function (response) {
if (response.authResponse) {
const code = response.authResponse.code;
// The returned code must be transmitted to your backend,
// which will perform a server-to-server call from there to our servers for an access token
} else {
console.log('User cancelled login or did not fully authorize.');
}
}, {
config_id: facebookMetaData.configurationID, // configuration ID goes here
response_type: 'code', // must be set to 'code' for System User access token
override_default_response_type: true, // when true, any response types passed in the "response_type" will take precedence over the default types
// extras: {
// setup: {
// ... // Prefilled data can go here
// }
// }
});
}
}
For the above javascript variable like facebookMetaData.metaAPPID are replaced properly.
when clicking the button i am getting the error in console as
Uncaught ReferenceError: fbq is not defined
launchWhatsAppSignup
How to resolve the issue so that whatsapp embedded signup can be implemented?
I'm implementing a whatsapp like chat using whatsapp business api.
There is the 24 hours rule where, in order to send a message to a whatsapp number, you need to send an approved template first. Afterwards, as soon as the user reply, the business account can send free form messages for the next 24 hours.
When a free form message is sent, the api returns this type of json:
{ "messaging_product": "whatsapp", "contacts": [ { "input": "<WHATSAPP_USER_PHONE_NUMBER>", "wa_id": "<WHATSAPP_USER_ID>" } ], "messages": [ { "id": "<WHATSAPP_MESSAGE_ID>" } ] }
However, this json does not guarantee that the message was delivered if sent outside of 24 hours. This json is always returned whether the conversation is open or not, and this doesn't help much.
So do you know if there is an api call that can tell me if the conversation is still open with the user?
The API call below should show a message with a body and two buttons. However, this is not visualized correctly on the WhatsApp Desktop (Mac OS X). The buttons don't show at all, only the body is displayed. My version is 24.2.75 (560133088). If I check this same message on WhatsApp Web and on my iPhone, the buttons are there.
{
"messaging_product": "whatsapp",
"to": "{{testing_number}}",
"recipient_type": "individual",
"type": "interactive",
"interactive": {
"type": "button",
"body": {
"text": "This is the body"
},
"action": {
"buttons": [
{
"type": "reply",
"reply": {
"id": 0,
"title": "Button 1"
}
},
{
"type": "reply",
"reply": {
"id": 1,
"title": "Button 2"
}
}
]
}
}
}
I am currently writing a chatbot for WhatsApp. I use the node js and WhatsApp Business API to create my API that send messages to users.
When the client sends a image message, I see the following JSON object in the logs of my application:
{ "object": "whatsapp_business_account", "entry": [ { "id": "116591461526821", "changes": [ { "value": { "messaging_product": "whatsapp", "metadata": { "display_phone_number": "15550383872", "phone_number_id": "107615645766004" }, "contacts": [ { "profile": { "name": "TW🐯" }, "wa_id": "26657963470" } ], "messages": [ { "from": "26657963470", "id": "wamid.HBgLMjY2NTc5NjM0NzAVAgASGCAyQjlFNENGRkFENDk4MkRDQkU4QjVFOTlERUU3RUM4MgA=", "timestamp": "1707306273", "type": "image", "image": { "mime_type": "image/jpeg", "sha256": "iNUQ9GcXEvo/mqx2HYvGYmoX4/sgw3JLLjNe5y3cYHM=", "id": "1549548012254387" } } ] }, "field": "messages" } ] } ] }
can't find any information in the documentation about how to download this file. In my case, I want to upload this image file that the client sends to my file storage. Please tell me which URL method from the WhatsApp API is responsible for this mechanism?