Forum Discussion

antoniolicon's avatar
antoniolicon
Contributor
12 years ago

I'm looking for a way to get the Page Views, Unique Visitors, and Posts for a specific date or date

I'm looking for a way to get the Page Views, Unique Visitors, and Posts for a specific date or date range via the REST API.  I have been reading through the docs and trying different methods, including this: http://lithosphere.lithium.com/t5/developers-discussion/quot-Realtime-quot-metric-amp-for-a-certain-period-via-REST-API/m-p/53904/highlight/true#M1779
 
...but can't quite seem to get what I need.
 
Help!  (Please and Thank You)
 
Tony

5 Replies

  • AdamN's avatar
    AdamN
    Khoros Oracle
    12 years ago

    Hi Tony,

     

    Have you checked out the Metrics object available via the REST API:

    http://lithosphere.lithium.com/t5/rest-api/bd-p/developers-rest-api?branch=Metrics

     

    Via that object, you should be able to access various metrics for a given date range. This TKB article has an attachment that lists all of the metrics available:

    http://lithosphere.lithium.com/t5/admin-and-cic-analytics/Admin-Metrics-Definitions/ta-p/5923

     

    This article should help you get started as well:

    http://lithosphere.lithium.com/t5/admin-and-cic-analytics/Retrieving-metrics-using-the-REST-API/ta-p/7671

     

    If this doesn't help, please let us know what you've tried and what issues you're running into.

  • antoniolicon's avatar
    antoniolicon
    Contributor
    12 years ago
    Hi AdamN-

    Thank you for the quick reply. I had looked at the Metrics object, but did not find how to get it to do what I want.

    Your second and third links give me an access denied error. Is it possible I need a higher level of access to get this part of the API to work? I have REST API access and am able to use other parts of the API without issue.

    Thanks,

    Tony
  • antoniolicon's avatar
    antoniolicon
    Contributor
    12 years ago

    From this: 

    http://forums.autodesk.com/restapi/vc/categories/id/3012/metrics/name/visitors

     

    I get this response:

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <response status="error">
    <error code="303">
    <message>
    Permission Denied
    </message>
    </error>
    </response>

     

    I've just guessed at 'visitors' being one of the metric names avaiable.  Is there list of available metrics in the documentation somewhere?

     

    community, source, and id all show reasonable output. metrics/metrics shows 'success' but is blank:

    <?xml version="1.0" encoding="utf-8" standalone="yes"?>
    <response status="success">
    <metrics/>
    </response>

     

     

    Thanks,

     

    Tony

     

  • AdamN's avatar
    AdamN
    Khoros Oracle
    12 years ago

    Hi Tony,

     

    If you don't think you have the right access, please check out this TKB article for information on how to get access:

    https://lithosphere.lithium.com/t5/lithosphere-knowledge-base/Do-you-have-the-right-access-to-Lithosphere/ta-p/50421

     

    Once you have access, the second link in my original post has documentation for the metrics available and their corresponding IDs.

     

    The error you're showing looks like you don't have sufficient permissions. You might want to try first logging in with an admin account or some other account that has permission to view metrics.

  • antoniolicon's avatar
    antoniolicon
    Contributor
    12 years ago
    It's strange and confusing to have access to one part of the API (and docs) but not the others. Particularly when the docs aren't organized in a way that indicates various levels of access. What's more: why don't I just have an API key? Maybe there is a place to get the key that I've somehow missed. As it is, I need to visit the Forum in my browser to authenticate, and then I can access (some of) the API calls from a tool like Postman. I'd really love to have tools to easily tap the REST API for automated reporting. This workflow is not particularly useful so far.