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:
is it possible to retrieve the numviews property filtered by user? I mean, is there any log where I could find the items viewed by a user?
Thanks in advance.
Hello @BorjaParés_Fuente ,
I came across your comment and this is exactly one of the things I am currently trying to achieve! This was three years ago, but maybe you remember how you solved this? Thanks for any tip you might have.
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