Skip to content

Response Enrichment Interceptor Sample

This sample demonstrates how to intercept the response of query operation of a feature service. The response format can be PBF or JSON. This response enrichment interceptor detects the outgoing response for query operation, intercepts it to add sample values for select fields, and sends a modified response to client.

Supported ArcGIS Enterprise SDK Versions

  • 11.5 Closed Beta; 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 button.
  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 button. Set the file type as File geodatabase
  5. Ensure the Title for the hosted feature service is “incidents” and click the Save button. Name the hosted feature service as incidents
  6. Navigate to Content > My Content and ensure that the incidents hosted feature layer item is available.
  7. Open the incidents hosted feature layer in ArcGIS Map Viewer and select any of the point features.
  8. Inspect the popup and note that the fields agency, agency_name, status, resolution_description, and last_action_date do not have values.

Download the sample code

The pre-built audit log interceptor sample is available here: Response enrichment interceptor

Deploy the Interceptor

Deploying the interceptor is done in two parts: uploading and registering.

Upload and Register

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

  1. Unzip the Response enrichment interceptor sample into a directory of your choosing.
  2. In a web browser, 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 File button and select the ResponseEnrichment.interceptor file located in the ResponseEnrichment/target folder in the directory where you unzipped the sample in Step 1 above.
  5. Click the Upload button. Once the file is uploaded, you will be directed to the Uploaded Item page. Copy the Item ID.
  6. Browse to Home > system.
  7. If you do not see a navigation link to interceptors on the page, append /interceptors to the URL in the browser, i.e., <domain>/<server-web-adaptor>/admin/system/interceptors.
  8. Click the register link and paste the value of the Item ID from Step 5 above into the input box. Click the Register button.

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. Repeat clicking on any other records to ensure the results are the same.

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