0

我的代码中有错误 400 Invalid endpoint:

    $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>";

请帮我解决这个问题

4

1 回答 1

0

您是否使用您的 API 帐户凭据尝试过 curl 示例?我的猜测是你没有使用正确的并且得到 400 错误。

一旦你让 CURL 示例工作,那么你应该能够修改你的 PHP 代码以匹配。

您可以在此处找到有关身份验证的更多信息 https://developer.clevertap.com/docs/authentication

于 2020-06-11T19:57:37.333 回答