je t'ente déséspérément utiliser une api qui demande curl. Or , je ne connais pas du tout. J'ai donc teter de me documenter, mais je ne comprends pas tout.
Voici ce que dit l'api :
All requests must be provided with unique API keys, which you can generate in dashboard. You have to pass API keys with each request in headers as X-API-ID (public) and X-API-KEY (private) parameters. For example:
curl -L http://www.coinimp.com/api/v2/hashes -H 'X-API-ID:7e26bb94aa2ce44e6e16aca6ae6d28c7f0157b5ccd7a82f86bbbe8d835effd71' -H 'X-API-KEY:5112486af64b2f97bd3742c4153cee32452549491480cfd164b336720b82a84d'
Voici ce que j'ai fait :
$curl = curl_init();
$opts = array(
CURLOPT_URL => 'http://www.coinimp.com/api/v2/hashes',
CURLOPT_HEADER => array(
'X-API-ID:0cd6929b8e34e2cc686eb50bef6a909c4898125b5105221fbfe48a43b038d9ff',
'X-API-KEY:61dbf2d44abd138bad67c7876dcac0f58b2f08c8bbb91108c7c0984fe7b5f207',
)
);
curl_setopt_array($curl, $opts);
$response = json_decode(curl_exec($curl), true);
print_r($response);
Et voici le résultat :
HTTP/1.1 301 Moved Permanently Date: Sat, 16 Feb 2019 19:48:02 GMT Transfer-Encoding: chunked Connection: keep-alive Cache-Control: max-age=3600 Expires: Sat, 16 Feb 2019 20:48:02 GMT Location: https://www.coinimp.com/api/v2/hashes Server: cloudflare CF-RAY: 4aa2878c992dc773-AMS 1
Qu'est ce que j'ai mal fait? merci de votre aide.