Guys,
Any idea what im missing. Im using
https://www.bitfinex.com/pages/api. unfortunately there authentication doesnt have any sample. I tried google but not too much .php example.
<?php
$apiUrl = 'https://api.bitfinex.com/v1/margin_infos';
$keyId = 'xxxx';
$keySecret = 'xxxxxx';
$payload = array(
'request' => '/v1/margin_infos',
'nonce' => time() * 100000,
);
$payload = base64_encode(json_encode($payload));
$signature = hash_hmac('sha384', $payload, $keySecret);
$headers = array(
"X-BFX-APIKEY : " . $keyId,
"X-BFX-PAYLOAD : " . $payload,
"X-BFX-SIGNATURE : " . $signature,
);
$curl = curl_init();
curl_setopt($curl, CURLOPT_HTTPHEADER, $headers);
curl_setopt ($curl, CURLOPT_URL, $apiUrl);
curl_setopt($curl, CURLOPT_FOLLOWLOCATION, 1);
curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
$curlResult = curl_exec ($curl);
curl_close($curl);
echo $curlResult;
Result/Error
{"message":"Could not find a key matching the given X-BFX-APIKEY."}
But i did pass X-BFX-APIKEY as header
TIA,
Mike