Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
DFelten opened this issue Jan 26, 2025 · 5 comments
Labels
area/api-web Web API good first issue kind/bug Something isn't working php Pull requests that update Php code

Comments

@DFelten
Copy link

DFelten commented Jan 26, 2025

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 DFelten changed the title Image icon and title for site award badges missing via API Image icon and title for site award badges missing via API_GetUserAwards endpoint Jan 26, 2025
@wescopeland wescopeland added kind/bug Something isn't working area/api-web Web API good first issue php Pull requests that update Php code labels Jan 29, 2025
@bhimbho
Copy link
Contributor

bhimbho commented Feb 1, 2025

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

@DFelten
Copy link
Author

DFelten commented Feb 1, 2025

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

@bhimbho
Copy link
Contributor

bhimbho commented Feb 1, 2025

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?

@wescopeland
Copy link
Member

wescopeland commented Feb 1, 2025

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).

@DFelten
Copy link
Author

DFelten commented Feb 1, 2025

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/api-web Web API good first issue kind/bug Something isn't working php Pull requests that update Php code
Projects
None yet
Development

No branches or pull requests

3 participants