Example API Request: Applying Request Parameters to Limit Results

Before Getting Started

Additional documentation for the Agency Incidents API can be found here.

Example Code

    @ECHO OFF

    curl -v -X GET
    "https://data.emergencyreporting.com/agencyincidents/incidents?rowVersion={string}&limit={number}&offset={number}&filter={string}&orderby={string}"
    -H "Ocp-Apim-Subscription-Key: {subscription key}"
    -H "Authorization: {access token}"

    --data-ascii "{body}"

Limit Number of Records Returned from an Incident GET Request in Postman

In order to tell an API how you would like your results returned, Request Parameters can be applied to some API calls. Many times returning all values for a field like Incidents can add unnecessary bulk to your requests resulting in longer wait times. You can limit the number of records returned in your request by using the limit Request Parameter. Let's send a GET request with the Limit Request Parameter applied.

  1. Open Postman and request an Access token
        RESPONSE
        {
            "access_token": "YOUR_ACCESS_TOKEN",
            "expires_in": 3600,
            "token_type": "Bearer",
            "scope": null,
            "refresh_token": "YOUR_REFRESH_TOKEN"
        }
    
  2. Create a new Request in Postman
  3. Make sure the "GET" request type is selected
  4. New Postman Get Request
  5. In the request URL field, update to the following
    • https://data.emergencyreporting.com/agencyincidents/incidents
  6. At the end of the URL, add a ? followed by limit, then = (equals) and finally 10 to limit the total number of incidents returned to 10
        https://data.emergencyreporting.com/agencyincidents/incidents?limit=10
    
    Limit Incidents
  7. Tap/click the Headers tab and populate with the following information
    KEY VALUE
    Content-Type application/json
    Ocp-Apim-Subscription-Key YOUR_PRODUCT_SUBSCRIPTION_PRIMARY_KEY
    Authorization YOUR_ACCESS_TOKEN
    Authentication Header with Access Token
  8. Tap/click Send
  9. Review results in Body section of Postman
    • Verify that results have been limited to 10 results
  10. Limit Incidents Results

Back to Top