403 error with presumably valid token

106
1
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
1 Reply
GeoJosh
Esri 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