[Beginner] Proper way to use tokens with ArcGIS MapServers

1053
2
06-24-2021 02:31 AM
MorozovAS
New Contributor II

Well, I develop commercial application which exports selected rectangle of map as image. On frontend I use Leaflet (with esri-leaflet), and on backend I do simple C++ get requests to REST API export services. I mostly use arcgisonline public services like 

Of course, I registered and generated the token for all API calls. But it seems like token was never used. On frontend apiKey has been never seen neither in query nor in headers. And on backend i get 498 Invalid Token when i use token={token} but receive desired image when i don't.
 
So, the question is Am i doing it right? Legally speaking, of course. Because the least thing i want is sue.
If it's OK, what do i need the token for?
If it's not OK, what's the proper way? Learn-gis tries to feed me with Hawaii volcanos and storytelling, but i don't need them. Neither i want 750Mb of Qt Gis just for that simple API call. 
Tags (3)
0 Kudos
2 Replies
MorozovAS
New Contributor II

Why do you find the answer right after you ask a question? Oh, because Search is awful but Related can save the day, huh.

https://enterprise.arcgis.com/en/server/latest/administer/windows/about-arcgis-tokens.htm

Anyway, still waiting for a proper answer.

0 Kudos
MorozovAS
New Contributor II

 

 

Turns out, to export images you should use (for Export) variants of base maps. Like this:

ArcGIS search

Did they mention it somewhere? Nope. How did I found? A wild @esri appeared and replied on random comment. 

 

0 Kudos