With the ArcWeb Services implementation of REST, you make direct calls to the API through a Web browser. Create a URL that contains all the mapping criteria you want and get back a map. See Parameters for descriptions of the parameters you can use to make your map request.
To start using REST with ArcWeb Services, you need an active subscription to ArcWeb Services. Then, you need an authentication token to verify you are authorized to access ArcWeb Services. There are two ways to request an authentication token, using getToken or using getUserID. Most ArcWeb requests, whether using a UserID or a token, consume credits from a user account. See Understanding credits and costs for more information.
UserIDs do not expire and they are not bound to the IP address of a client machine. This allows a REST request containing a UserID to be shared between multiple users. Every request with a UserID will be charged to the account that issued the UserID regardless of who sends the request. You can only have one UserID per account. ESRI recommends using UserIDs only during phases of development and testing, when they offer more flexibility and convenience. We recommend that you change your account password which invalidates any existing UserIDs, and switch to using tokens before making an application public.
It is highly recommended that you use the getToken request since the returned token has an expiration (default 60 minutes) while a token from a getUserID request does not expire. An expiration helps minimize the negative impact of a malicious client stealing and trying to reuse the authentication token to access ArcWeb Services. Also note that a UserID changes when the password is changed.
https://www.arcwebservices.com/services/v2006/restmap?actn=getToken&usr=<username>&pswd=<password>
http://www.arcwebservices.com/services/v2006/restmap?actn=getMap&tkn=<token generated in step 1>&ds=ArcWeb:TA.Streets.NA&c=-117.1817|34.0556&sf=52500
See Sample requests for a variety of URL sample requests you can use to help you create REST maps.
Warning: If a token from a getUserID request is hacked and hijacked, it can be used to consume your ArcWeb credits. This can be stopped by changing your password, which changes your UserID, invalidating the previous one, or you can disable the UserID feature on the ArcWeb UserID account page.
https://arcwebservices.com/services/v2006/restmap?actn=getUserID&usr=<username>&pswd=<password>
http://www.arcwebservices.com/services/v2006/restmap?actn=getMap&usrid=<UserID generated in step 1>&ds=ArcWeb:TA.Streets.NA&c=-117.1817|34.0556&sf=52500
See Sample requests for a variety of URL sample requests you can use to help you create REST maps.
The following tables describe the required and optional parameters you can use in your REST URLs.
Authentication and Map are the main parameters for REST mapping URLs and are required.
| Authentication (actn=getToken) | ||
|---|---|---|
|
Parameter |
Description |
Valid Values |
|
usr |
ArcWeb Services account user name. |
String containing valid user name. Case sensitive. |
| pswd (required) |
ArcWeb Services account password. |
String containing valid password. Case sensitive. |
| tout (optional) |
Expiration time of token, in minutes. |
Minutes to expiration. Default value is 60. Maximum value is 1440. |
|
ip |
IP address of client application viewing ArcWeb maps. Only use if the client machine getting the token is different from the machine requesting the maps. Use the IP utility to view the IP address seen by ArcWeb. |
IP address in format xxx.xxx.xx.xxx such as 198.102.62.126. |
| Map (actn=getMap) | ||
|---|---|---|
|
Parameter |
Description |
Valid Values |
|
Authentication token returned from a getToken request |
Returned string from getToken request. Average
length of string is 72–80
characters. Recommended authentication
method. |
|
|
usrid |
Authentication token returned from a getUserID request |
Returned string from getUserID request. Average length of string is 50–70 characters. To enable and disable UserIDs, visit the ArcWeb UserID account page. ArcWeb recommends using UserIDs only during phases of development and testing, when they offer more flexibility and convenience. ESRI recommends that you change your account password, which invalidates any existing UserIDs, and switch to using tokens before making an application public. |
|
Map center point in x|y coordinates |
The x-coordinate of the center point and the y-coordinate of the center point in geographic coordinates (longitude/latitude), separated by a pipeline (|), for example, -117.1817|34.0556. See Samples for details on using the c parameter to pan a map. |
|
|
sf |
Geographical scale of the map |
The distance ratio between two geographic locations and those two points represented on the map. The distance measured on the map can be any units, and that multiplied by the scale factor will give the actual distance in the measured units. For example, if the distance between two points on the map is 3 cm, for sf=100000, the geographic distance between the two points is 300,000 cm (3 multiplied by 100,000). |
|
Data source |
Valid values are bam (best available map) |
|
|
w |
Map image width in pixels |
Default value is 400. Maximum width is 8192. |
|
h |
Map image height in pixels |
Default value is 400. Maximum height is 8192. |
|
a |
Angle to rotate the map |
Default value is 0. Values less than 360 rotate the map through that many degrees. Negative values are rotated in the opposite direction. |
|
fmt |
Map image format |
Valid values are: svg, swf, jpg, or png. Default value is swf. |
|
stl |
Style sheet used in the map |
Style sheets are specific to a data source (ds). The default style for a data source is nt (Neutral). Other options are ce (Classic European), cs (Cool Steel), gs (Gray Scale), or tg (Tangerine). You can set a style for the following data sources: ArcWeb:AND.Roads.World uses nt, gs, or tg; ArcWeb:TA.Streets.EU uses nt, gs, tg, or ce; ArcWeb:TA.Streets.US uses nt, cs, gs, tg, or ce; and ArcWeb:TA.Streets.NA uses nt, gs, or tg. Use the Map Image Web Service Live Sample to preview style sheets in a map. |
You may use the following optional parameters in a REST mapping URL:
|
|
| Acetate point | ||
|---|---|---|
|
Note: You must use the acetate point parameters p and pl. |
||
|
Parameter |
Description |
Valid Values |
|
p |
Point location in x|y coordinates. |
To display a point, set p=-117.1817|34.0556, where -117.1817 is the x-coordinate and 34.0556 is the y-coordinate of the center point, separated by a pipeline (|). Use with the pl and/or pi parameter. |
|
pl |
Label for the point. Font format is Verdana, normal, 10 point. Label location is set by the point parameter. |
Sets a label value for each point or icon on your map. Use with the p parameter. |
|
pi |
Icon to use with the point. Icon location is set by the point parameter. |
See REST icons for a list of valid values. For example, to display a red pushpin icon, set pi=pushpin_red.gif. Note that for SVG and SWF images to display, you must add pi to your URL so that it is not the last parameter listed. Use with the p parameter. |
See Projections for map projection parameters and information.
Visit the Feedback page to give comments or suggestions about the ArcWeb Developer's Guide.