Showing results for 
Search instead for 
Did you mean: 

Badge Icons through Gamification API

Former Member
0 Kudos

I'd like to show the badge icons for a player of the gamification system, but I'm facing a few issues:

- when I retrieve the player details, I get a list of badges and IDs for the images, but those are unique per player. Therefore, I cannot compare two badge IDs of two player to know whether they have the same badge or not. The ID of the badge itself would be more helpful instead of the per player ID (both for the badge and the image)

- when I then try to add the image to my public website through the GetPicture API, the image is not shown since it requires authentication. Since my website is public and I don't want to add any credentials in the HTML code, I cannot show the badge icons. The SCN people's bio pages use images that are hosted on amazon aws to deal with this issue, but those urls are not usable for me since they have no reference to the badge ID or anything alike.

- when I query the GetPicture API with a non existent image id, I do get a 404. However, since I would use this URL in an img tag in my html code, it would be better to get some blank or dummy image returned, not a 404 error. This way I would not see the browsers default "image not found" replacement, which looks like something broken immediately. A dummy image would be a more graceful fallback.

Can anybody give me some hints on how to deal with this? especially with the required authentication for the GetPicture API?

Thanks a lot!

Accepted Solutions (0)

Answers (1)

Answers (1)

0 Kudos

Hi Volker,

thanks for the valuable feedback. We will consider your feedback for an API redesign.

- Include badge ID in details to make badges comparable across players

- Return a dummy "not available" picture instead of 404, although this could also be implemented by the client easily

Regarding the authentication, things are a bit more complicated. Since we also use getPicture for Avatar images we cannot make them accessible without authentication/authorization. I fear we cannot change this easily. This would require using a separate "bagde storage". We though of using the HCP document service for this. But even the document service requires authentication, I think.

What you could do is implementing a small "proxy app" which exposes the pictures without authentication. The proxy app would use the tech endpoint for retrieving your pictures.

Doing so, only your badges would be public and not all pictures.