Somewhere in conversation, I came across a json url which gives me the number of views on the particular item be it a webmap, app, kml.
Have lost it .Can someone point me out correctly?
Is it something that only an admin can do?
Each item in portal has a property "numViews":
See an example using Python to get the items sorted by the number of views (at the bottom of the page):
I guess you will need to have access to the items to be able to retrieve the properties.
That's near to what I wanted. We have few items not worth running a script.
Can you give me the Url that returns me the number of items in html , json formats? You know something like <portal>.arcgis.com\sharing\rest\....\....\ where I can view the output
Anything you're looking at in the Portal home app is driven from an API...
Anyway, you can use the home app to find the number of views:
Or users content within Sharing API that the home app is getting its information from:
Or by searching in the home app:
Or by searching in the Sharing API, which is what searching in the Sharing API is giving you:
Using the ArcGIS API for Python you can do the following:
import arcgis from arcgis.gis import GIS # Org URL url = "https://nation.maps.arcgis.com" # Make a connection to the portal gis = GIS(url=url) # Item ID # Using a public story map for this example # https://nation.maps.arcgis.com/apps/Cascade/index.html?appid=e4ae5b57cf9045288909a93cc31cde7c item = "e4ae5b57cf9045288909a93cc31cde7c" i = gis.content.get(item) print(i['numViews'])
I found a bug/error in ESRI REST API, please fix the bug in code or update doc either way:
the api reads:
also give example at bottom
You actually will NOT get any info by use above link format. Only a blank page
You must add
by define format to get something
This is a working example:
esri staff, please fix the rest api code, by define 'f=json' format by default.
or update the rest api doc above, by put a NOTE: * remind user must append ?f=json at the url end
Is there any workflow to reset the numviews property without connecting to the portal postgres database?
I cannot find the way to update the property in sharing/rest.