When I try to Create a Limit Order I get <Response [401]> Unauthorized.
I can Create Other Endpoints such as accounts and they work using the
same Keys and Credentials.
The Code can be found here.
I need to be able to Place and Cancel Orders on Coinbase Advanced Trade before they Sunset Coinbase PRO. Any Help will be appreciated.
Yes,
I have the following but not limited to:
wallet:buys:create
wallet:sells:create
wallet:buys:read
wallet:sells:read
wallet:orders:create
wallet:orders:read
wallet:trades:create
wallet:trades:read
I am still unable to Create an Order using either approach.
Thank you for the Working Code you provided. However it will only work in Python 3.1+
I have a lot of Code written for a CryptoBot using the Coinbase Pro API that uses
Python 27 so I am always looking for Python code that is compatible for both 2.7 & 3.0+
and the requests module is compatible to both.
We’ve referred this to our internal teams and yet to get an update. We will get back to you soon after we get an update. Please stay in touch and have a good day ahead.
Thank you for your patience. Having to dive deep on your code further, we have identified the following:
The POST request did not happen to work because the body parameter was not included in the signature.
body is the request body string – it is omitted if there is no request body (typically for GET requests)
What you have in the code is this: message= timestamp + method + endpoint
But what is required as per the document is this: Create a signature string by concatenating the values of these query parameters: timestamp + method + requestPath + body
Please add the body parameter in the signature for the code to work. We hope this helps. Please let us know if you have any further questions.
The missing body in the generation of my signature was indeed the problem. In case some
others have ran across the same issue, I have posted my working code below that uses the requests module. The Python code is compatible with both Python 2.7 and Python 3.0+.