Select to view content in your preferred language

ArcGIS Online API Key scoped to feature service returns zero features

125
1
2 weeks ago
Labels (1)
Jay_Gregory
Frequent Contributor

I used ArcGIS Online to create an API Key developer credential, and accepted all the default opens, except that I scoped it to a survey123 feature service when providing item access.  However, when I use the API key as a token to query the feature service, it returns zero features.  This is apparently as designed according to: https://support.esri.com/en-us/bug/api-key-scoped-to-a-hosted-feature-service-with-allowan-bug-00016...

My question is - is there anyway to allow my developers to query a feature service without resorting to system accounts (everyone logs in through SAML) and using API keys?  This current prevents any kind of automation process from outside the system (e.g. a script that periodically queries the feature service). 

0 Kudos
1 Reply
CodyPatterson
MVP Regular Contributor

Hey @Jay_Gregory 

It may be that the scope of the API key may not be defined to the right permissions that accessing the feature layers would need. You could either setup an OAuth 2.0 app for the automation scripts by getting a Client ID and Client Secret from ArcGIS Online, and then use the credentials to request a token through the REST API. Or possibly you could use a service account to do this as well with the ArcGIS API for Python.

Cody

0 Kudos