RAWeb icon indicating copy to clipboard operation
RAWeb copied to clipboard

Image icon and title for site award badges missing via API_GetUserAwards endpoint

Open DFelten opened this issue 11 months ago • 5 comments

Describe the bug

When getting a list of badges for a user the title and image icon for site awards are missing.

Endpoint: API_GetUserAwards.php?y={{key}}&u={{username}}

To Reproduce

Fetch badges of a user via API and check the response:

...
"VisibleUserAwards": [
        {
            "AwardedAt": "2025-01-25T21:08:30+00:00",
            "AwardType": "Patreon Supporter",
            "AwardData": 0,
            "AwardDataExtra": 0,
            "DisplayOrder": 0,
            "Title": null,
            "ConsoleID": null,
            "ConsoleName": null,
            "Flags": null,
            "ImageIcon": null
        }
    ]
...

Or an other example

        {
            "AwardedAt": "2024-12-22T21:43:11+00:00",
            "AwardType": "Certified Legend",
            "AwardData": 0,
            "AwardDataExtra": 0,
            "DisplayOrder": 786,
            "Title": null,
            "ConsoleID": null,
            "ConsoleName": null,
            "Flags": null,
            "ImageIcon": null
        },

Expected behavior

Title and image icon exists.

DFelten avatar Jan 26 '25 11:01 DFelten

@DFelten Could you confirm if this particular data is for a non-game or event award?

bhimbho avatar Feb 01 '25 21:02 bhimbho

Yes, these are awards for non game awards and events.

DFelten avatar Feb 01 '25 22:02 DFelten

from what I can see here, non game awards and events do not come with title and icons. @wescopeland if there an intention for this to change?

bhimbho avatar Feb 01 '25 22:02 bhimbho

I don't think we've settled on how we'll handle those awards in the long-term.

They're usually granted by things like developer actions or subscribing to our Patreon. You can directly observe a few of these on my profile at https://retroachievements.org/user/WCopeland:

Image

4 of these 5 probably exhibit the issue. It may be reasonable in the API to detect these cases and return the correct asset URL, we just need to be sure that if the API is adjusted to do this, if we ever change the URL, we don't need to remember to update the API (try to limit hardcoding if possible).

wescopeland avatar Feb 01 '25 22:02 wescopeland

Exactly the images and titles of these awards are missing via the api.

So in the app I'm working on it looks like this because of the missing data:

image

DFelten avatar Feb 01 '25 23:02 DFelten