posit-dev / posit-sdk-py

Posit SDK for Python
https://posit-dev.github.io/posit-sdk-py/
MIT License
9 stars 4 forks source link

Get view information for a single piece of content. #181

Open tdstein opened 6 months ago

tdstein commented 6 months ago

Add a property to the ContentItem class that retrieves the view metrics for that piece of content. This can be accomplished by modifying the Views resource to optionally accepts a content identifier, and hooking that in as the property.

This could be content.views or content.metrics.views. Curently undecided on which makes the most sense for users.

nealrichardson commented 6 months ago

IMO:

class ContentItem(Resource):
    ...
    @property
    def views(self):
        ...
tdstein commented 6 months ago

I noticed the WebApp makes various calls to an undocumented __metrics__ API endpoint. We should do some digging to determine if those APIs logically go together with the views API. That might help determine if Views are at the "admin" level or the "user" level information.