Forum Discussion

Kev_B's avatar
Kev_B
Advisor
6 years ago

user_badges blank?

Hi, I'm attempting to create a page to show off our Superusers, and I wanted to pull their yearly SU badges to show off how long they've been in the program. I'm using the API browser in Studio to ...
  • AndrewF's avatar
    6 years ago

    Hi Kev, I looked at this one for quite a while. This looks like an API browser issue, as the following API calls return the right data, even without credentials:

     

    • /api/2.0/search?q=SELECT+user_badges+FROM+users+WHERE+id+%3D%27238%27
    • /api/2.0/users/238

    You may also notice the API browser is showing the collection with type: "user" instead of type: "user_badge".

    Could you try putting the query in a simple component? Does the component get the right data when viewed by the user ("Lemmings")? How about other users?

    By design, we allow a user to learn about badges they haven't earned yet, but only when viewing their own badges. To make that work, the backend has different approaches for getting the data, depending on who is making the query & where. It's possible there could be an issue in just one of those approaches.