Forum Discussion

Inactive User's avatar
Inactive User
12 years ago

Retrieve user metrics by rank via REST API

Hi folks,

 

I was referring to this KB for retrieving metrics by community, by boards, by categories for a period of time.

http://lithosphere.lithium.com/t5/developers-knowledge-base/Retrieving-metrics-using-the-REST-API/ta-p/7671

 

I granted access to our internal staff to help doing the REST API called but still couldn't retrieve data succesfully. I followed what was suggested like below:

 

  • Allow user to make REST API calls with read access > Set to Grant
  • Allow user to access metrics > Set to Grant

 

Still got RequiredPermissions error.

 

Example of the Request URL was like this: 

http://sandbox.lithium.com/sandbox/restapi/vc/metrics/name/posts?date_start=2010-07-01&date_end=2010-07-08

 

However, how do i retrieve user metrics for different user ranks for a period of time? Any pointers?

6 Replies

  • Hey Cleolee,

    It seems like you need 'Update Communities' -> set to Grant permission as well. Try setting this permission and accessing the URL again.

    Hope this works.

    Thanks,
    Chhama

  • Inactive User's avatar
    Inactive User
    12 years ago

    Thanks Chhama! Finally fixed the problem! Bravo!

     

    Also, this tip maybe can be updated to the existing KB article that i mentioned above ;)

  • Inactive User's avatar
    Inactive User
    12 years ago
    Hi Chhama,

    Thanks for your help on the access granting and now our internal staff could use a specific Forum ID to get REST API metrics.

    In fact i have another question in the original post that has yet to get an answer.

    1) How do i retrieve user metrics for different user ranks for a period of time?

    2) Also, how do i retrieve metrics(login name, most recent login, email, language, IP,etc) that can also be generated using Metrics > User Reports in Community Admin?
  • ChhamaJ's avatar
    ChhamaJ
    Khoros Staff
    12 years ago
    Please find my responses below

    1). Unfortunately, you cannot get user metrics for different user ranks but only for a particular user using the following rest call
    http://community.lithium.com/community-name/restapi/vc/users/login/john_doe/metrics?date_start=2013-01-01&date_end=2013-02-01

    2). You can get these details by the following calls

    http://community.lithium.com/community-name/restapi/vc/users/id/43/metrics
    http://community.lithium.com/community-name/restapi/vc/users/login/john_doe/metrics

    Hope this helps.

    Thanks,
    Chhama
  • Inactive User's avatar
    Inactive User
    12 years ago
    Chhama,

    I appreciate your response.

    Nonetheless, i need to pull data for all the ranks so we can have an overview of performance by different ranks. The user report data is useful and sadly we have no way to retrieve them.

    Do you have other workaround?
  • ChhamaJ's avatar
    ChhamaJ
    Khoros Staff
    12 years ago

    The only way to do this is manually. You can get users for different ranks via the following call
    /restapi/vc/search/users?advanced=true&ranking=[rank number]&search_page_size=12&sort_by=login_sort

    (you can also get this information via the user search ability on the community).


    Then, get metrics for each user using the call 

    /restapi/vc/users/login/john_doe/metrics?date_start=2013-01-01&date_end=2013-02-01

     

    Also, please add your suggestion in the customer ideas so that we can look and implement feedbacks when provided.

     

    Thanks,
    Chhama