Get an Access Token (Password Grant Type)

In order to generate an Access Token to make calls to ERS API Portal endpoints, you'll need to perform a POST request. An example cURL token request using the OAuth 2.0 Password Grant Type would look similar to the following (replacing values for Ocp-Apim-Subscription-Key, client_id, client_secret, username and password).

    curl -X POST \
        https://data.emergencyreporting.com/authtoken/Token.php \
        -H 'Content-Type: application/json' \
        -H 'Ocp-Apim-Subscription-Key: YOUR_SUBSCRIPTION_KEY' \
        -d '{
        "grant_type": "password",
        "client_id": "YOUR_CLIENT_ID",
        "client_secret" : "YOUR_CLIENT_SECRET",
        "username" : "ERS_ACCOUNT_USERNAME",
        "password" : "ERS_ACCOUNT_PASSWORD"
    }'

Locate a Subscription Key

Alongside a ClientID and ClientSecret, Emergency Reporting API endpoints use a Subscription Key ("Ocp-Apim-Subscription-Key") as an additional form of authentication. Whether it's a Developer Subscription Key used to make sample API requests or a Subscription Key granted to an Agency, a Subscription Key is needed for all API requests made through the ERS API Developer Portal.

To locate a Subscription Key ("Ocp-Apim-Subscription-Key"), Sign In to the Emergency Reporting API Developer Portal and perform the following steps:

  1. Navigate to your Profile
  2. Locate a Product subscription and tap/click "Show" next to Primary Key
    • Note: Subscription Keys for both development and for associated Customers/Agencies are available within a Developer Account Profile Dashboard automatically
  3. Replace the "Ocp-Apim-Subscription-Key" value ("YOUR_SUBSCRIPTION_KEY") in your request with the Subscription Key from your Developer Profile Dashboard

Generate an Access Token Using Postman

Follow these steps to generate an Access Token in Postman:

  1. Create a new request in Postman and configure the Headers tab
    KEY VALUE
    Content-Type application/json
    Ocp-Apim-Subscription-Key YOUR_SUBSCRIPTION_KEY
    Postman Header Configuration
  2. Set the request type to POST and add https://data.emergencyreporting.com/authtoken/Token.php in the URL field
  3. In the Body tab, select "raw" and enter the following code (replacing values for client_id, client_secret, username and password)
        {
            "grant_type": "password",
            "client_id": "YOUR_CLIENT_ID",
            "client_secret": "YOUR_CLIENT_SECRET",
            "username": "ERS_ACCOUNT_USERNAME",
            "password": "ERS_ACCOUNT_PASSWORD"
        }
    
  4. Send the Request and review the API Response. If the response was successful, your Access Token will be displayed in the "access_token" value in the Body response. Postman Complete Password Authentication Configuration

Back to Top