JetBrains / teamcity-achievements

TeamCity achievements plugin
Apache License 2.0
18 stars 6 forks source link

REST API for retrieving users' achievements #2

Open borismod opened 9 years ago

borismod commented 9 years ago

Please expose REST API that returns achievements of a given user.

TomerAdmon commented 9 years ago

Good idea! It could be helpful to create graphs and statistics :+1:

borismod commented 8 years ago

Guys, can you give us a hint on how I can add REST API by myself? Some tutorial would be fine

pavelsher commented 8 years ago

Achievements plugin stores granted achievements in user properties. And REST API already allows retrieving of these properties, using REST API like this: /app/rest/users/id:{user id}/properties

You can look for properties with names similar to this: plugin:achievements:achievements:achievement.granted.debugger plugin:achievements:achievements:achievement.granted.nightOwl

If these properties exist, then debugger and nightOwl achievements are granted. It's a bit hard to get data for many users, but if performance is not a big issue it is possible.

See also: https://confluence.jetbrains.com/display/TCD9/REST+API#RESTAPI-Users

borismod commented 8 years ago

@pavelsher Thanks, it's a good place to start! In understand that unlocked achievements have "true" in their value.

What does this number mean?

borismod commented 8 years ago

@pavelsher How can I get the images of the achievements?

pavelsher commented 8 years ago

Value is just a timestamp when achievement was unlocked. As to images, there are no images at all. I used Font awesome for all of the icons, see: https://fortawesome.github.io/Font-Awesome/icons/

ddzy commented 8 months ago

How to get it through graphql?