Post
Topic
Board Service Discussion
Re: Authentication failed with the Coinbase API
by
starmyc
on 31/03/2018, 08:06:47 UTC
Code:
$message = $timestamp . 'GET' . 'https://www.mysite.it' . $body;
$signature = hash_hmac('SHA256', $message, $API_SECRET);

I did only take a quick look, but this seems wrong to me. According to the documentation, the "message" string must contain the path + params of the request url (eg: "/v2/exchange-rates?currency=USD"), not the complete url. If your complete url is "http://www.mysite.it/", then the request path you need to use is only "/". If you are calling https://api.coinbase.com/v2/user then you need to use '/v2/user' in $message.