Select to view content in your preferred language

Searching for items marked as authoritative

160
3
a month ago
RobGordon1
Emerging Contributor

I am using the ArcGIS python API as I would like to count items in my agol that are marked as authoritative. I have been able to search by owner and type but I cannot get the contentStatus search term to work at all. I have read the documentation over and over and I just can't figure out what is wrong. 

auth_items = gis.content.search(query='contentStatus:public_authoritative', max_items=100)
 
auth_no = len(auth_items)
print(auth_no)
 
Thanks!
0 Kudos
3 Replies
CodyPatterson
Frequent Contributor

Hey @RobGordon1 

Could you try to search for this here:

auth_items = gis.content.search(query='contentStatus:authoritative', max_items=100)

I think it falls into a general category of authoritative, I've seen this here too:

CodyPatterson_0-1731070192253.png

 

Cody

0 Kudos
RobGordon1
Emerging Contributor

Thanks @CodyPatterson but... I have answered my own question.... 

So this page Search reference | ArcGIS REST APIs | ArcGIS Developers has the term contentStatus which does not work. But this non python page on advanced search has the term contentstatus . This does work! 😂😭

To add to the confusion I have to use contentstatus:public_authoritative (or org_authoritative) as authoritative alone is not a recognised value. This is as written on the API page next to contentStatus.

My status is now: 😑

CodyPatterson
Frequent Contributor

Hey @RobGordon1 

Definitely quite a lot of strangeness! I seem to be left as that status quite often when attempting to read through some of the documentation unfortunately.

Cody

0 Kudos