使用GuzzleHttp的CleverTap中的错误发布请求

时间:2020-05-05 01:13:40

标签: php laravel api clevertap

这是我的密码

 $client = new \GuzzleHttp\Client();

        $profile = [
            "identity"=>"jorem34.like@gmail.com",
              "ts"=>1419421212,
              "type"=>"profile",
              "profileData"=>[
                "Name"=>"Jorem",
                "Email"=>"jorem@gmail.com",
                "Phone"=>"+14153412312",
                "Gender"=>"M",
                "Employed"=>"Y",
                "Age"=>21,
                "Customer Type"=>"Silver",
              ]];

         $body = json_encode([
                'd' => [
                    $profile
                ]
            ]);
        $response = $client->request(
            'POST',
            self::API_URL,
            ['headers' => [
                    'X-CleverTap-Account-Id' => '*****************',
                    'X-CleverTap-Passcode' => '************',
                    'Content-Type' => 'application/json'
            ],
            'body' => $body
            ]
        );

这是我的错误

客户端错误:POST https://api.clevertap.com/1/upload导致400 Bad Request响应: {“状态”:“失败”,“错误”:“无效的端点”,“代码”:400}

我已经尝试过此链接 POST request to Clevertap using GuzzleHttp 但不能解决我的问题。

0 个答案:

没有答案