Select to view content in your preferred language

403 error with presumably valid token

1235
2
05-06-2021 11:06 AM
AlexanderStukanov
New Contributor

Hi All I am trying to access my customly styled base map layer, with OpenLayers. 

I am using ol-mapbox-style for it. 

Unfortunately I receive a 403 response with follwoing url:

https://basemaps-api.arcgis.com/arcgis/rest/services/styles/<MY_STYLE_ID>?apiKey=<MY_API_KEY>

Api Key should have basemaps permission (or at least the ui tells me so) 

codesnippet: 

this.map = new Map(...magic...)
olms(this.map, <URL_AS_ABOVE>);

Thanks for your help

Tags (1)
0 Kudos
2 Replies
GeoJosh
Esri Regular Contributor

Alexander,

Try using "token" instead of "apiKey". For example:

https://basemaps-api.arcgis.com/arcgis/rest/services/styles/<MY_STYLE_ID>?token=<token>
0 Kudos
Matthias234615
Emerging Contributor

I am using `apiKey` successfully instead of `token`. Not sure which is correct...

Things to check:

  • Any referer restrictions on the API key? Do they match the page's domain?
  • Is the API key configured to have access to your content item (the style)? If you want, you can make the content item public.

After you change the settings, the page says "it can take 15 minutes to propagate these updates". So, grab some coffee and check back later I guess 🙂

0 Kudos