Get started

Follow the steps below to set up Qodex so you can make requests to ArcGIS location services. If you want to learn more about the services, or how to access them with other ArcGIS and open source APIs, go to the Mapping APIs and location services guide.

1. Get an ArcGIS account

You need an ArcGIS account to create API keys and access tokens to access services. If you don't have an account:

  1. Sign up for a free ArcGIS Developer account (single-developer); or,
  2. Sign up for an ArcGIS Online account (organization).

2. Get a Qodex account

You need a Qodex account to fork collections and run requests.

  1. Sign up for a [free Qodex account]

3. Fork environment variables and collections

In Qodex, environment variables are used to set the username, password, and access token to make requests to location services. Once set, you can run all of the requests in any of the collections.
Learn more about how to [fork Qodex collections and environments]

  1. On the left toolbar, in Environments:
    • Click [Standard endpoints] > ... > Create a fork.
    • Click [Enhanced endpoints] > ... > Create a fork.

To learn more about Standard and Enhanced endpoints, go to the Mapping APIs and location services guide.
NOTE: If you have an ArcGIS Developer account, you will need to enable Pay-as-you-go to use all of the Enhanced endpoints with either an API key or a generated token.

  1. On the left toolbar, in Environments:
    1. Click Globals > Export to export the global variables the examples use.
  2. On the top toolbar, click Workspaces:
    1. Go to your My Workspace > Import to import the globals to your workspace.
  3. On the left toolbar, in Collections:
    • Click each collection in ArcGIS location services and then > Create a fork to fork all of the collections you want to use.

NOTE: If you want to generate a short-term access token with a request, you need to fork [<strong>Get access token</strong>]

4. Set your access token

There are two ways you can create and set access tokens for all requests. You can generate a short-term token with a request or you can use a long-term API Key from your developer dashboard.

Option 1: Generate an access token (short-term)

  1. In Qodex, click Environments > Globals > Current Value, set the username and password variables are set.
  2. In Collections, run the ArcGIS Identity > Generate token request. This requires your ArcGIS account username and password. Copy the token in the response.

Option 2: Create and use an API Key (long-term)

  1. In ArcGIS for Developers, sign in to your developer dashboard.
  2. Copy or create and then copy a new API key.
  1. In Qodex, click Environments > Standard endpoints or Enhanced endpoints (depending on which environment you forked) and set the access_token variable to either the token created from the Generate token request or your API key.
  2. Set both the Initial value and Current value with your generated token or API key.

NOTE: Ensure you scope your API key so it can access all of the services in your collections, otherwise the request will fail. To learn more, visit scoping API keys.

5. Run the examples

  1. In Qodex, go to your ArcGIS location services workspace and forked collections.
  2. At the top-right, change No Environment to either Standard endpoints or Enhanced endpoints.
  3. Expand Collections to find the desired example. In each one you will find the following:
    • GET/POST: Request with the params preset and will use the environment variables set earlier.
    • 200 OK: Sample response result.
    • xxx-spec: Documentation for the params.
  4. Run the desired example. NOTE: Ensure the access_token environment variable is correctly set. See Steps 3 and 4.

Documentation πŸ“š

You will find documentation guides, API reference and libraries in the documentation for each collection:

  • πŸ“ [Geocoding API (Geolocation)]
  • πŸš™ [Routing & Directions API]
  • πŸ§‘β€πŸ€β€πŸ§‘ [Demographics & GeoEnrichment API]
  • ☁️ [Data hosting]
  • πŸ“ [Content management]

Coming next: offline maps, vector tiles, image tiles, elevation, hydrology, and more.

API error codes

You will find more information about error codes in the API reference of each collection.

NOTE: If you use short-lived access tokens (instead of API keys) that were generated from your ArcGIS Identity username and password, you could get a 498 error code. If you get this error, you will need to generate a new access_token.

{
    "error": {
        "code": 498,
        "message": "Invalid Token",
        "details": []
    }
}

More error codes:

Error codeDescription
400The request sent to the server is not correct.
401Authorization to the requested resource is required.
403Authorization to the requested resource is required.
404The requested resource was not found.
413The request is larger than limits defined by the server. If you're trying to upload an attachment, this error might indicate that the attachment's size exceeds the maximum size allowed.
498The access token provided is invalid or expired.
499A token was required to access the resource.
500The service was not able to fulfill the request, possibly due to invalid input, or the service may not be functioning properly.
501The requested service is not implemented.

Reference documentation

ArcGIS location services support both direct and job requests:

  • ➑️ Direct requests are single asynchronous transactions to the service endpoint.
  • πŸ”„ Job requests are a set of asynchronous transactions to the service endpoint.
    1. βœ… Submit job
    2. βœ… Check status
    3. βœ… Get results

Community & feedback πŸ’¬