This is driving me crazy.
I am trying to generate a signature as suggested here: https://www.reed.co.uk/developers/SignatureTest
This way:
function createSignature($queryUrl, $timestamp, $apiKey, $http = "GET", $agent = "Mozilla/4.0 (compatible; MSIE 7.0; Windows NT 6.0)"){
$signature = $http . $agent . $queryUrl . "www.reed.co.uk" . $timestamp;
$signature = base64_encode(hash_hmac("sha1", $signature, $apiKey, true));
return $signature;
}
$clientId = 1;
$timestamp = "2016-05-13T09:22:50Z";
$apiKey = "bacd2d2d-8b69-43c8-94c5-4a24c0269b79";
$queryUrl = "https://www.reed.co.uk/recruiter/api/1.0/cvsearch";
$reedQuery = \Httpful\Request::get($queryUrl)
->addHeaders(array(
"X-ApiSignature" => createSignature($queryUrl, $timestamp, $apiKey),
"X-ApiClientId" => $clientId,
"X-TimeStamp" => $timestamp
))
->expectsJson()
->send();
print_r($reedQuery);
Now for some reasons it returns this on my server: WRTjqQKfyEQyLJEzWWuT3SWgGPk=
While the expected result is: JUgvCh5oeFYe1HDmfiMObOu1+nQ=
I tried everything, even swapping from little endian to big endian. Nothing.
What is wrong??? :(