Error in Pagination while fetching Accounts: nextUrl is empty string

I receive an empty string while paginating through accounts:

GET: https://api.coinbase.com/v2/accounts?starting_after=57650dd4-b615-597b-a57f-d19921dbf723
Trace: 6056192224161351569

In the response the next url attribute is an empty string.

Can confirm this as well. It seems to have changed a few days ago. It used to return null if at the end of pagination. This is breaking my app because it’s expecting null to know when there’s no more results.

Lots of breakages for sure - can we escalate this? Its killing us !

2 Likes

@lioness - are you able to reply on this - its seems like quite an impactful problem.
Any use of starting_after parameter for example is being ignored and always returning first page of data - causing infinite loops and breaks in lots of things !

Get Accounts endpoint does not have starting_after parameter…

It does on sign in with coinbase API, are you on the wrong api forum ?

1 Like

You are right, sorry! Missed out both that it is v2 and in Sign in With Coinbase category…

I am also getting errors with this API Endpoint. Let me give you a history (btw - spoiler alert - this endpoint is not working for me at the moment.)

Originally I was restricting users to sign-in-to-coinbase using their USDC wallet, so when I returned the first account in the list of accounts the v2/accounts endpoint was returning, it was always returning USDC. A few days ago, I tried accessing the v2/accounts endpoint and it was returning VeChain information instead. I fixed this problem by calling v2/accounts/USDC.

Yesterday, I was suddenly getting a CORS error when I tried to work with the v2/accounts endpoint or the v2/accounts/usdc endpoint. This is really strange, as I never needed to do anything with CORS before AND the other endpoints I called were working properly.

There are ongoing issues with this endpoint. If someone can fix this ASAP that would be great. (If my app was live and this happened, this could be a big issue. I was planning on launching in Jan but this may push out the timeline.)

I am getting a similar error on this endpoint from listing an account with a limit of 1. This has worked for me for many months without any errors. Apparently, the resulting payload does not have the sort order applied if it is the default. This is an empty string which results in a serialization error.

Flurl.Http.FlurlParsingException: Response could not be deserialized to JSON: GET https://api.coinbase.com/v2/accounts?limit=1&order=desc
 ---> Newtonsoft.Json.JsonSerializationException: Error converting value "" to type 'Coinbase.Models.SortOrder'. Path 'pagination.order', line 1, position 103.
 ---> System.ArgumentException: Must specify valid information for parsing in the string.
   at Newtonsoft.Json.Utilities.EnumUtils.ParseEnum(Type enumType, NamingStrategy namingStrategy, String value, Boolean disallowNumber)
   at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)
   --- End of inner exception stack trace ---
   at Newtonsoft.Json.Converters.StringEnumConverter.ReadJson(JsonReader reader, Type objectType, Object existingValue, JsonSerializer serializer)

Related: Access Accessed Wallet - #11 by Mike-E

Thank you @bruuuh, @LaRisa, @Kevin.Dooley, & @Loop_11 for any assistance you can provide on this issue impacting users using your technology in a production environment.

Hi @fguru! Thank you for being part of the community. Apologies for the delay in response.
We will share this further with our team and will share an update here too as soon as we get to know anything about it. Appreciate your patience in this.

2 Likes

Thank you very much for your care and assistance, @Loop_11 :pray::pray::pray:

Thank you very much @Loop_11 :pray:

Hi @fguru! After reaching out to our internal team, we got to know that this is now an intentional behaviour because the team had to change how the response is encoded to a scheme where strings can’t be null.

We would request you to please update your code to handle all false values (e.g: empty and null). The team should soon share the details for this change.

We hope this answers your question.

1 Like

Thank you for your assistance @Loop_11. Ginormous issue of unannounced breaking changes aside (not even a blog post or forum post about this?), there appears to be another issue altogether now when specifying the sort order. When I do not specify a sort order (or explicitly set it to do desc), I get an empty account list. However, if I supply asc as the sort order, I get the wrong account (BTC always). Please note that I am supplying a limit of 1 for this call.

This worked perfectly fine before the unannounced breaking changes.

I would appreciate further assistance in this matter. Thank you for any that you can provide.

EDIT, as I see this issue has been solved, we can move my issue to here: