Reputation: 147
I have the following cURL function:
function getReferalURL($userMail){
$dataToSend = array(
'key: kewbhfbi87324y3rb3r2837r3brikbfwef23ibwjkfbkjfwkjfb',
'email:[email protected]'
);
$curl = curl_init();
$curlOptions = array(
CURLOPT_URL => 'https://api.leaddyno.com/v1/affiliates/by_email',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_POST => false,
CURLOPT_HTTPHEADER => $dataToSend,
);
curl_setopt_array($curl, $curlOptions);
$afiliateData = curl_exec($curl);
if (!$afiliateData) {
return curl_error($curl);
} else {
return $afiliateData;
}
}
All that I'm getting as a response is that the email is missing.
I've read the documentation, all they have about this specific requisition is:
Definition: GET https://api.leaddyno.com/v1/affiliates/by_email
Curl:
$ curl https://api.leaddyno.com/v1/affiliates/by_email -G \
-d [email protected] \
-d key=[YOUR_PRIVATE_KEY]
That's a dummy private key, of course. I would appreciate any help.
Upvotes: 0
Views: 41
Reputation: 180024
This:
$dataToSend = array(
'key: kewbhfbi87324y3rb3r2837r3brikbfwef23ibwjkfbkjfwkjfb',
'email:[email protected]'
);
is not the sort of array it's expecting.
$dataToSend = array(
'key' => 'kewbhfbi87324y3rb3r2837r3brikbfwef23ibwjkfbkjfwkjfb',
'email' => '[email protected]'
);
is likely what you need.
Upvotes: 1