smvdbrink
Joined: 14-Jul-2017
Posts: 759
Posted: 4-Nov-2020, 21:04
#
Posted: 4-Nov-2020, 21:04
#
When I try to get my collection from the API, I get the following error:
"The remote server returned an error: (500) Internal Server Error."
I can get a coin by ID, but /users/{user_id}/collected_coins gives me an error. Anyone else having this problem?
They say "Pecunia non olet", but I know better...
smvdbrink
Joined: 14-Jul-2017
Posts: 759
Posted: 5-Nov-2020, 18:11
#
Posted: 5-Nov-2020, 18:11
#
I've been thinking about this. I think that the problem is that the json is too big to return. I have 15.704 coins in my collections, so the json must be huge. In .NET I have the option to increase the limit for json-strings using maxJsonLength in the web.config. I'm not sure if PHP has the same option, but I think it should be possible. Numista probably isn't the only community using an API to retrieve large amounts of data.
A way of preventing this, or at least decreasing the amount of data being fetched, is allowing a specific collection to be added as parameter to collected_coins. In my case, it would decrease the amount of coins from 15.704 to 4.300 (at this moment
).
They say "Pecunia non olet", but I know better...
Xavier
Site admin
Joined: 16-Jan-2007
Posts: 7773
Posted: 5-Nov-2020, 23:23
#
Posted: 5-Nov-2020, 23:23
#
Hello,
I just made a fix. Could you please confirm that you can now retrieve your coins?
I agree there should be a way to filter the results (by collection, by swap/no-swap, by pages, or something else), as the result can be very big. Could you please open a separate topic to request it?
Status changed to Started
(Xavier, 5-Nov-2020, 23:25)
smvdbrink
Joined: 14-Jul-2017
Posts: 759
Posted: 6-Nov-2020, 15:59
#
Posted: 6-Nov-2020, 15:59
#
Yes, I can confirm that collected_coins now retrieves the coins! I'll make a new topic for improving the API :)
Thanks Xavier!
They say "Pecunia non olet", but I know better...
Status changed to Solved
(Xavier, 6-Nov-2020, 16:18)
Used time zone is UTC+1:00.
Current time is 06:20.