I want to get the id from the response when I use postman it works fine but when I try to do in vs code with php curl it shows,
{
"error": {
"message": "(#100) The parameter messaging_product is required.",
"type": "OAuthException",
"code": 100,
"fbtrace_id": "An1nMSXpHU5KfaQ1vn5xo8s"
}
}
my code is,
'https://graph.facebook.com/v16.0/*******/media',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'POST',
CURLOPT_POSTFIELDS => array('file'=> new CURLFILE('/C:/xaamp/htdocs/mdu_child_app/app/uploads/TrueConnect Platform (1).png'),'messaging_product' => 'whatsapp'),
CURLOPT_HTTPHEADER => array(
'********',
'Content-Type: image/png'
),
));
$response = curl_exec($curl);
curl_close($curl);
echo $response;
What I have tried:
I have also tried to upload the image file on the server and get the destination to the 'file' request.
still receiving the same output. what changes should I do?