I have error 400 Invalid endpoint in my code :
$this->load->library('PHPRequests');
$headers = array(
'X-CleverTap-Account-Id' => 'xxxx-xxx-xxx-xxxx',
'X-CleverTap-Passcode' => 'xxx-xxx-xxx',
'Content-Type' => 'application/json; charset=utf-8'
);
$data = '{ "d": [ { "FBID": "34322423", "ts": 1468308340, "type": "event", "evtName": "Product viewed", "evtData": { "Product name": "Casio Chronograph Watch", "Category": "Mens Watch", "Price": 59.99, "Currency": "USD" } } ] }';
$response = Requests::post('https://api.clevertap.com/1/upload', $headers, $data);
echo "<pre>";
print_r($response);
echo "</pre>";
please help me solve this problem
Have you tried the curl example using your API account credentials? My guess is you are not using the correct ones and getting the 400 error.
Once you get the CURL example working then you should be able to modify your PHP code to match.
You can find out more about the authentication here https://developer.clevertap.com/docs/authentication