我想在whatsapp云api中发送参数。我怎样才能做到这一点。
$messageData = array(
'messaging_product' => "whatsapp",
'to' => "123456789",
'type' => "template",
'template' => array("name"=> "hello_world",'language'=>array("code"=>"en_Us")),
);
Run Code Online (Sandbox Code Playgroud)
我想要这样的
{
type: 'template',
messaging_product: 'whatsapp',
to: e.recipient_number,
template: {
name: WHATSAPP_TEMPLATE_NAME,
language: { code: LANGUAGE_CODE },
components: [
{
type: 'body',
parameters: [
{ type: 'text', text: e.customer_name },
{ type: 'text', text: e.item_name },
{ type: 'text', text: e.delivery_date },
],
},
],
},
}
Run Code Online (Sandbox Code Playgroud)
我收到的错误
{“error”:{“message”:“(#132000)参数数量与预期参数数量不匹配”,“type”:“OAuthException”,“code”:132000,“error_data”:{“messaging_product” :"whatsapp","details":"body: localized_params 的数量 (0) 与预期的参数数量 (3) 不匹配"},"error_subcode":2494073,"fbtrace_id":"Abab9mTp_dJ9Ryd4ytHPl7Y"}}