Forum Discussion

jasim's avatar
jasim
Helper
12 years ago
Solved

Can we get list of user ranks in order using rest api

Hello,

 

We are trying to compare the user ranks based on the rank index.

We need to know whether the current user's rank is higher than a particular rank in the community.

Is there any way we can get the list of ranks in the community.

 

Your help would be highly appreciated.

 

Thanks,

Jasim

  • Hey Jasim,

     

    After checking furthen and a hint from AdamN it turns out that you can't currently get the order and that using the id will not always get you the proper order.

     

    Can you please add an idea to the Customer Idea Exchange to add a way to get the rank order.

     

    Thank you,

     

    Yuri

2 Replies

  • YuriK's avatar
    YuriK
    Khoros Expert
    12 years ago
    Hey Jasim,

    If you're looking to compare 2 user's ranks, you can do it using the ranking calls:

    users/id/{user1.id}/ranking/id
    users/id/{user2.id}/ranking/id

    The one with the lower id returned has the higher rank.

    There is currently no easy way to get all the ranks in the community via rest api, but you can do the brute force approach:

    restapi/vc/rankings/id/1
    restapi/vc/rankings/id/2
    etc. until you get an error.

    Note that the ids correspond to the index of the rank in the community.

    Hope this helps,

    Yuri
  • YuriK's avatar
    YuriK
    Khoros Expert
    12 years ago

    Hey Jasim,

     

    After checking furthen and a hint from AdamN it turns out that you can't currently get the order and that using the id will not always get you the proper order.

     

    Can you please add an idea to the Customer Idea Exchange to add a way to get the rank order.

     

    Thank you,

     

    Yuri