I have test code in javascript (for node) that works. I’m able to make requests and sign messages for various endpoints with no problem.
However, every time I try to request the product candles endpoint, I always get an Unauthorized 401 response.
My full url is this: https://api.coinbase.com/api/v3/brokerage/products/BTC-USD/candles?start=1606039200&end=1607115600&granularity=ONE_HOUR
I’ve read over the docs and tried numerous permutations. Changed the granularity to seconds, changed the start and end times to use iso8601 format - nothing works.
Fetching the product info itself via
https://api.coinbase.com/api/v3/brokerage/products/BTC-USD/
works fine every time. So I know my request and signing mechanism work.
Is there a bug in the product candles endpoint? If so, can you please share when this will be fixed? I am writing a library for the Advanced Trade API and so I cannot use the old exchange/Pro endpoints.
Also, the api endpoint docs are ambiguous. For the start/end query parameters description is says
Timestamp for starting range of aggregations, in UNIX time.
But, there’s no example and there are no format types for the Advanced Trade endpoints. So, is it unix epoch seconds, millis, iso8601 format?
The same for the granularity - is it seconds or the actual value ONE_HOUR
?
Hopefully this can be fixed and cleared up soon. When something isn’t working, the documentation specifics matter. (Also, the response examples json don’t look correct either.)
Thank you.