I need to add BODY content with some filters in my PHP CODE of APi curl How can i do it
I need to be added in my API call
Here is API CAll Code
$chn = curl_init();
curl_setopt($chn, CURLOPT_POST, true);
curl_setopt($chn, CURLOPT_URL, 'https://api.livechatinc.com/v3.4/agent/action/list_archives');
curl_setopt($chn, CURLOPT_RETURNTRANSFER, true);
curl_setopt($chn, CURLOPT_POSTFIELDS, '{}');
curl_setopt($chn, CURLOPT_HTTPHEADER, array(
'Content-Type: application/json',
'Authorization: Bearer ' . $token
)
);
2
Answers
You can add a request body to your API call by passing the data as a string in the CURLOPT_POSTFIELDS option.