Skip To Content ArcGIS for Developers Sign In Dashboard

Create (Feature Service)

  • URL:https://<WebHooks-url>/create(POST only)
  • Version Introduced:June, 2020

Description

The create operation allows administrators to create a new webhook. Administrators will specify the trigger events for this webhook, and the URL to which payloads are delivered when the webhook is invoked. For additional security, the signature key parameter can be used to send a specific string that can be verified by the application listening on the payload URL. During the operation, the payload URL will be queried to confirm a connection to the webhook is successful. A Feature service can have multiple web hooks. Multiple webhooks can share the same callback URL.

Note:

The same callback URL with overlapping events are not supported/allowed.

Request parameters

ParameterDetails
name

(Required)

Specifies the webhook's name.

Syntax: String

changeTypes ("Events")

Defines the events that will trigger the webhook. The default is ["*"] if no value is specified. For more information on the values listed below, see the Trigger event values section below.

Syntax: Array

Values: * | FeaturesCreated | FeaturesUpdated | FeaturesDeleted | FeaturesEdited | AttachmentsCreated | AttachmentsUpdated | AttachmentsDeleted | LayerSchemaChanged | LayerDefinitionChanged | FeatureServiceDefinitionChanged

signatureKey

(Optional)

If specified, the secret key will be used in generating the HMAC hex digest of value using sha256 hash function and is returned in the x-esriHook-Signature header.

Syntax: String

Example

x-esriHook-Signature="sha256=x0mYd8goestNaiaMleQQseoJJelseim9BRse2lgisekvis"
hookUrl

(Required)

Identifies the payload URL.

Syntax: String

"https://webhookURL"
active

(Optional)

Enable or disable call backs when the web hook is triggered. The default is false.

Values: true | false

scheduleInfo

(Optional)

Sets the schedule properties of a webhook.

Note:
The interval value minimum is 30 seconds.

Syntax: JSON Object

Example

{
  "name":"Every-30seconds",
  "start":"1478280677536",
  "state":"enabled",
  "recurrenceInfo": {
    "frequency":"second",
    "interval":30
  }
}
payloadFormat

The response pay load format. The default format is json.

Values: json | pjson

f

The response format. The default format is html.

Values: html | json | pjson

Trigger event values

Listed below are the accepted values, and their descriptions, for the changeTypes parameter.

ValuesDescription
*

Wildcard event. Any time any event is triggered.

FeaturesCreated

A new feature is created.

FeaturesUpdated

A feature is updated.

FeaturesDeleted

A feature is deleted.

FeaturesEdited

A feature is edited (insert or update or delete)

AttachmentsCreated

A new attachment is added to a feature.

AttachmentsUpdated

A feature attachment is updated.

AttachmentsDeleted

A feature attachment is deleted.

LayerSchemaChanged

A schema is changed in a layer.

LayerDefinitionChanged

A layer definition is changed.

FeatureServiceDefinitionChanged

A feature service is changed.

Example usage

Below is a sample request URL for create:

https://myserver.domain.com/myTenant/ArcGIS/rest/admin/services/states/FeatureServer/WebHooks/create

Example 1: Here's how you can create a webhook that posts payloads in JSON format:

{
  "name": "WebHooks",
  "active": true,
  "changeTypes": [
    "FeaturesCreated",
    "LayerSchemaChanged"
  ],
  "hookUrl": "https://example.com/webhook"
}

JSON Response examples

{
  "id": 1,
  "url": "https://myserver.domain.com/myTenant/ArcGIS/rest/admin/services/states/FeatureServer/WebHooks/1",
  "name": "WebHooks",
  "changeTypes": [
    "FeaturesCreated",
    "LayerSchemaChanged"
  ],
  "active": true,
  "hookUrl": "https://callBackServerUrl/webhook",
  "createdTime": "1526405454399",
  "lastUpdatedTime": "1526405454399"
}
[
  {
    "name": "WebHooks", 
    "owner": "webhook", 
    "id": 9, 
    "globalId": "c740ae24-92a1-4fd2-9a3b-8sdf4332239", 
    "tenantId": 01, 
    "serviceId": 5602321, 
    "active": true, 
    "hookUrl": "https://webhookURL", 
    "serviceUrl": "https://myserver.domain.com/myTenant/ArcGIS/rest/services/WebHooks/FeatureServer", 
    "signatureKey": "", 
    "format": "json", 
    "serverGen": 8108706, 
    "createdTime": 1589773034742, 
    "lastUpdatedTime": 1589773034742, 
    "changeTypes": [
      "All"
    ], 
    "scheduleInfo": {
      "name": "", 
      "state": "enabled", 
      "recurrenceInfo": {
        "frequency": "second", 
        "interval": 5
      }
    }
  }
]