jeudi 18 février 2016

POST request to Clevertap using GuzzleHttp

I am using Laravel 5.1 and Guzzlehttp 6.1 to make post request to clevertap.

$client = new \GuzzleHttp\Client(['headers' => ['X-CleverTap-Account-Id' => '**********','X-CleverTap-Passcode'=>'*************8']]);



$result = $client->request('POST','http://ift.tt/1PSFXLd',["d"=>[
    "identity"=>"1189549",
      "ts"=>1419421212,
      "type"=>"profile",
      "profileData"=>[
        "Name"=>"Jack Montana",
        "Email"=>"jack@gmail.com",
        "Phone"=>"+14155551234",
        "Gender"=>"M",
        "Employed"=>"Y",
        "Education"=>"Graduate",
        "Married"=>"Y",
        "Age"=>28,
        "Customer Type"=>"Platinum",
      ]]]);

I am getting following Error.

Client error: POST http://ift.tt/1PSFXLd resulted in a 400 Bad Request response: { "status" : "fail" , "error" : "Payload is mandatory"}



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire