agreeable-accountant-7248
02/18/2024, 10:28 AMlimited-pencil-78283
02/18/2024, 1:03 PMagreeable-accountant-7248
02/18/2024, 2:24 PMlimited-pencil-78283
02/18/2024, 3:11 PM["${{user.name}}"]
Refer to the image as the grave accent symbol is not shown in Discord
While the variable is set correctly and I am passing the value, it still will give me this error
[2906416d17] [dm] : An unexpected error occurred.
[Error, Failed to start Whatsapp conversation using template "sendhello1" and language "en_US" - Error: {"message":"(#132000) Number of parameters does not match the expected number of params","type":"OAuthException","code":132000,"error_data":{"messaging_product":"whatsapp","details":"header: number of localizable_params (0) does not match the expected number of params (1)"},"fbtrace_id":"A1T1WvbMLVKOcsbCQNPN6xf"}]
Expected params are 0 and received 1. This means in the body there were no parameters required and it received one
This problem is related Start Conversation Card of WhatsApp in Botpress, it cannot send variables to the header and footerlimited-pencil-78283
02/18/2024, 3:17 PMBearer ${bot.fbtoken}
,
'Content-Type': 'application/json'
}
axios
.post(url, data, { headers })
.then((response) => {
console.log('Message sent successfully:', response.data)
})
.catch((error) => {
console.error('Error sending message:', error.response.data)
})`
In this code, there is nothing passed to the body, but to the header parameter workflow.textvariable is passed into which Noemi was assigned at the very top
This works the message is sent successfully. Below is the log
Here is the Payload - from console.log('Payload', data)
Payload { messaging_product: 'whatsapp',
to: 'xxxxxxxxxxx',
recipient_type: 'individual',
type: 'template',
template:
{ name: 'sendhello1',
language: { code: 'en_US' },
components: [ [Object] ] } }
and here is the success message
Message sent successfully: { messaging_product: 'whatsapp',
contacts: [ { input: 'xxxxxxx', wa_id: 'xxxxxxxxxxxxx' } ],
messages:
[ { id: 'wamid.HBgMOTE5NzQxMzkxNzAwFQIAERgSMzIwRUEwNjYwQzg2QUU2MDZDAA==',
message_status: 'accepted' } ] }
You can use the code as is by replacing Phone_number_ID and bot.fbtoken with yourslimited-pencil-78283
02/18/2024, 3:24 PMlimited-pencil-78283
02/18/2024, 3:32 PMagreeable-accountant-7248
02/18/2024, 3:42 PMlimited-pencil-78283
02/18/2024, 3:56 PMlimited-pencil-78283
02/18/2024, 3:57 PMlimited-pencil-78283
02/18/2024, 3:59 PMagreeable-accountant-7248
02/18/2024, 4:56 PMagreeable-accountant-7248
02/18/2024, 5:25 PM