Skip to content

This sample demonstrates how to intercept responses from a hosted feature service. The incident management interceptor detects outgoing responses for add and query operations, applies value enrichment to designated fields, and forwards the modified response back to the client. Both PBF and JSON response formats are supported.

Supported ArcGIS Enterprise SDK Versions

  • 12.0 Windows/Linux

Configure the hosted feature service for this sample

Follow the steps below to create a hosted feature service using Portal for ArcGIS.

  1. Download the sample dataset from here.
  2. In Portal for ArcGIS, go to Content > My Content and click the New item.
  3. Drag or upload incidents.gdb (zipped) to the New item window. Adding the incident.gdb.zip as new item
  4. Under File type, select File geodatabase. Under How would you like to add this file? select Add incidents.gdb.zip and create a hosted feature layer. Click the Next. Set the file type as File geodatabase
  5. Ensure the Title for the hosted feature service is incidents and click the Save.
  6. Navigate to Content > My Content and ensure that the incidents hosted feature layer item is available.
  7. Make sure to enable the editing capabilities for hosted feature service. Enable the edit in the hosted feature service

Alternatively, you can also create the editing-enabled hosted feature service using ArcGIS Pro.

Download the sample code

The pre-built incident management interceptor sample is available here: Incident Management Interceptor

Deploy the Interceptor

Deploying the interceptor is done in two parts: upload and register.

Upload and Register

After downloading the interceptor sample, follow the steps below to deploy the interceptor.

  1. Unzip the Incident Management Interceptor sample into a directory of your choosing.
  2. Navigate to the ArcGIS Server Administrator Directory and sign in as an administrator.
  3. Click uploads > upload.
  4. On the Upload Item page, click the Choose Fileand select the IncidentManagement.interceptor file located in the IncidentManagement/target folder in the directory where you unzipped the sample in Step 1 above.
  5. Click the Upload. Once the file is uploaded, you will be directed to the Uploaded Item page. Copy the Item ID.
  6. Navigate to Home > system > interceptors. The corresponding URL is: <domain>/<server-web-adaptor>/admin/system/interceptors.
  7. Click register and paste the value of the Item ID obtained in Step 5 into the input field.
  8. Click the Register to complete the register.

Verify the result

Once the interceptor is registered, it is functioning immediately. To inspect the behavior of the response enrichment interceptor, follow the steps below.

  1. Add the incidents hosted feature service to a map in ArcGIS Map Viewer.

  2. Select any of the records on the map to see the information popup for that feature.

  3. Note that the following fields and their values are updated as shown below. The value for last_action_date will reflect the current timestamp.

    FieldValue
    agencyNYPD
    agency_nameNew York City Police Department
    statusIn Progress
    resolution_descriptionThis is a test resolution description
    last_action_date2025-08-18T11:45:59-07:00
  4. Create a new incident on the map by adding a new point feature. Choose the appropriate complaint type and location type and leave the remaining information blank in the editing widget.

  5. The incident management interceptor will also have the incident fields populated with address, street_name, city, zipcode, incident_id, agency, agency_name,resolution_description and last_action_date information is added.

Your browser is no longer supported. Please upgrade your browser for the best experience. See our browser deprecation post for more details.