Forum Discussion

andreaduerme's avatar
andreaduerme
Contributor
12 years ago

API codes?

Hi,

 

Trying to embed the rest apis to show the following metrics:

 

member count

accepted solutions count

total thread count

 

Could I have the codes for these APIs please?

 

Thanks, hoping to get a quick response.

 

1 Reply

  • AdamA's avatar
    AdamA
    Khoros Oracle
    12 years ago

    Hello andreaduerme, welcome to the community!

     

    In order to get the metric counts via the REST API, you will want to use the following call format:

     

    restapi/vc/metrics/name/name

    Where the last "name" is the name of the metric that you want to get the count for. One way to find the name of the metric you are interested in, is to use the Metrics tab in the Admin (if you have access). When you click on a metric in the left hand side tree navigation, the URL of the subsequent page will contain a metric query parameter whose value is the name of the metric.

     

    For member count, there are multiple metrics you might be interested in: registrations, completed_registrations, logins, and many more. My guess is that you are probably after completed_registrations, the REST API call would look like this:

     

    restapi/vc/metrics/name/completed_registrations

    For the accepted solutions count, there are one again many different metrics, but my guess is you are after accepted_solutions:

     

    restapi/vc/metrics/name/accepted_solutions

     For the total thread count you will want to use threads:

     

    restapi/vc/metrics/name/threads

    You can find more information here: http://lithosphere.lithium.com/t5/rest-api/bd-p/developers-rest-api?branch=Metrics