So payload needs to be included? And if there is no payload? Looks like I might need to have a second routine if there is one. I guess I could check to see if there is a value for payload (there isn’t for GET requests) and add it if necessary, or include a blank payload.
Does that sound right?
UPDATE: Thanks for the tip. I created a second auth routine for requests that have a payload. It worked! I just have to pass that payload into the auth routine.
So I think they are going with arbitrary “conventional” RESTful routing. Basically if you can put the data in a short string in the url, do that. So GET, and DELETE requests normally use a url string and no payload, since the route, url, and the string are effectively the payload object where ={delete: this_thing}. 3 things. While PUT and POST generally need at least 4. The thing to change/post, what to change, and if you are putting or posting if that makes sense. So you need an object with the data where POST = {this: value}. There’s no performance gain to doing it, it’s just convention. And that’s more nonsensical information than you asked for lol.
The one difference I see is that to cancel orders we use and array of IDs, but the endpoint is /batch_cancel, so potentially there will be a single delete route coming, although it’s easy enough to just send an array of one ID.
I just hope they get it all down more solidly soon. I had a whole app that handled five different strategies in Pro, each with its own portfolio. Now I’m working out how to do “portfolios” on my end by keeping track of things in my own database since it appears that portfolios are not coming to Advanced Trading anytime soon.
I know they want to sunset Pro, but if we can’t mostly duplicate the functions there, it’s gonna be a lot of coding.
Indeed. Although I gotta say, if if you ignore what’s missing, what they do have so far (that works) is great and I love it.
Best example I can think of being canceled orders. In the Pro/Exchange API, if you cancelled an order it would just disappear. And sometimes, orders would get cancelled automatically for whatever reason. And sometimes when GETting an order, you would get a 404 if Coinbase was having problems or high volumes etc. Synchronization was a nightmare because if you got a 404, you never knew if it was canceled, or just needed to check back in a few seconds before reordering it. Checking multiple times used up you rate limit and wasted time. Now if you get a 404 you know to just check back later because canceled orders return a canceled status.
That alone allowed me to delete like 1/3 of my code because there was way less error handling. I just finished migrating my app (just one strat) to the new API today and the whole thing a whole lot faster and cleaner.
I am not a Java guy, so I’m not sure I understand how you’re getting the timestamp. It seems like you’re doing some manipulation of it other than just converting it to a string. Perhaps that is the issue? The timestamps between your end and Coinbase need to be within 30 secs of each other.
Thanks for your help!
I figured out the authentication issue. I find out the IP from Texas is banned by Coinbase. After changing to a NewJesersy IP, the code worked well.
The accounts endpoint I think is either buggy, or not what I would expect from it. I haven’t seen that response, but unless I have my api account permissions set to ‘All’, I don’t get anything back.
It seems to only return the wallets that Coinbase auto generates when you either deposit or buy something on there. Definitely not like the accounts endpoint on PRO. They should have named it /wallets instead.
Interesting, thanks for the replies. The keys I am testing with have all permissions and still no luck. Might be something to do with what @Rainner has suggested.
I have something similar where all my endpoints are working accept list_orders, yey for beta. In your example you appear to just be requesting all accounts, what is the relevance of AVAX ??