Hello! I am trying to add the ESRI subscription terrain layer using an API Key generated in our ArcGIS Online organizational account.
https://esri.maps.arcgis.com/home/item.html?id=58a541efc59545e6b7137f961d7de883
I am attempting to add a portal item to a web map using the Javascript API and using the 'apiKey' parameter in the constructor and using the API Key. No matter what I try I still get a login prompt when the layer tries to load. Is it possible to use layers marked with 'Subscriber' and API keys?
Any help would be great!
Thanks!
Hey @MichaelSnook
Here's some documentation regarding the subscriber content: https://doc.arcgis.com/en/dashboards/latest/create-and-share/secured-and-subscriber-content.htm
In my mind, after reading this I would believe that the API key you're using and site you're creating is believing that you're signing in anonymously and it is requesting credentials because of that. Along with that, an idea would be anything used with the API will require credentials because someone may be able to link the map via the API, and circumvent the sign-in requirements by using an authorized API key. I would review the documentation and possible reach out to ESRI support to see if there's a way to get a key like this!
Cody