Edit (Webhook)

URL:
https://<root>/services/<ServiceName>.<ServiceType>/<webhookID>/edit
Methods:
POST
Required Capability:
Access allowed with either the "Feature layer" or "Geoprocessing" privileges, or the Publisher role
Version Introduced:
11.1

Description

The edit operation allows administrators to update a previously configured geoprocessing or feature service webhook. Once updated, the changes will be applied immediately. If the payload URL for a webhook has changed or if the event trigger for a feature service webhook has been updated, the new trigger or payload URL will be used when the webhook is next invoked.

Webhook security

Starting at ArcGIS Enterprise 11.2 on Kubernetes, service webhooks use signature verification to ensure the integrity and security of webhook payloads sent from ArcGIS Enterprise on Kubernetes to a webhook receiver. The input for the signatureKey parameter acts as a shared secret key between both ArcGIS Enterprise on Kubernetes and the webhook receiver, which is known, and stored independently by, both ArcGIS Enterprise on Kubernetes and the webhook receiver and used to determined if the payload is trusted. When a webhooks event is triggered, the secret key and the payload are hashed using a HMAC-SHA256 algorithm, creating the signature. The signature is then passed in the webhook request as the x-esriHook-Signature header value. When the webhook payload is delivered to the receiver, the receiver uses the secret key and payload to create a signature of its own using the same HMAC-SHA256 algorithm that ArcGIS Enterprise on Kubernetes used. If the signature included in the request header matches the recalculated value created by the webhook receiver, the webhook payload can be trusted by the receiver. Otherwise, the receiver may choose to reject the incoming webhook payload.

Request parameters

ParameterDetails

name

(Required)

The webhook name.

Example
Use dark colors for code blocksCopy
1
name=Microsoft Flow

changeTypes

(Required for feature service webhooks)

Specifies the event triggers that will invoke the webhook. For more information about the supported event triggers listed below, see the Feature service event triggers section. The values for this parameter can be submitted as a string or as an array.

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

Examples
Use dark colors for code blocksCopy
1
2
3
4
5
//String example
changeTypes=FeaturesDeleted, FeaturesEdited, FeaturesUpdated

//Array example
changeTypes=["FeaturesDeleted", "FeaturesEdited", "FeaturesUpdated"]

signatureKey

(Optional)

A user-defined string that is sent in the payload to help the webhook receiver authenticate the payload. Starting at 11.2, the value provided for signatureKey is used by both ArcGIS Enterprise on Kubernetes and the webhook receiver to ensure the authenticity of outgoing webhook requests.

Example
Use dark colors for code blocksCopy
1
signatureKey=123456789ABCDE

hookUrl

(Required)

The payload URL where the payload will be delivered once the webhook is invoked.

Example
Use dark colors for code blocksCopy
1
hookUrl=https://app.logic.azure.com:443/workflows/...

contentType

(Optional)

Specifies the media type of the resource. The media type is a string sent with the file indicating the file's format.

Values: application/json | application/x-www-form-urlencoded

payloadFormat

(Optional)

Specifies the response payload format. The default value is json.

Values: json | pjson

active

(Optional)

Specifies whether callbacks will be enabled (true) or disabled (false) when a webhook is triggered. The default value is true.

Values: true | false

scheduleInfo

(Optional for feature service webhooks)

The window for cataloging event triggers for a feature service. The modifiable values for this parameter are the name property, which allows you to provide a name of the schedule type, and the interval property, which sets the value for how frequently payloads will be delivered. For feature services that receive frequent updates, the schedule for its webhook can be modified to send more frequent payloads containing less information by reducing the interval value. For feature services that receive less frequent updates, the interval value can be raised to send less frequent webhooks that include more event information. The default, and minimum, value for the interval property is 20 seconds.

Example
Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
scheduleInfo={
  "name": "Every20Seconds",
  "state": "enabled",
  "startAt": 1670521784506,
  "recurrenceInfo": {
    "interval": 20,
    "frequency": "second"
  }
}

f

The response format. The default format is html.

Values: html | json | pjson

Feature service event triggers

The table below lists the supported event triggers for feature services:

EventDetails

*

Any event is triggered.

FeaturesCreated

A feature is created.

FeaturesUpdated

A feature is updated.

FeaturesDeleted

A feature is deleted.

FeaturesEdited

A feature is edited (e.g., insert, 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 feature layer's schema is changed.

LayerDefinitionChanged

A feature layer's definition is changed.

FeatureServiceDefinitionChanged

A feature service's definition is changed.

Example usage

The following is a sample POST request for the edit operation, editing a geoprocessing service webhook to use a new payload URL:

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST /context/admin/services/myService.GPServer/webhooks/create HTTPS/1.1
Host: organization.domain.com
Content-type: application/x-www-form-urlencoded
Content-Length: []

name=Microsoft Flow&signatureKey=123456789ABCDE&hookUrl=https://app.logic.azure.com:443/workflows/80fd5c68fcd84b3491b25330680ef1&payloadFormat=pjson&active=true&f=pjson&token=m7zGSezM7znt6ZuIwr827imJxOTSDsjYujVdd7SiAQLYG1HmesG8EbSnTwCbiekEh0QwRdmeyp1hP63M60TPrdZQ2NzIg5G7qFaQh40MdiOCfh60-6oPKC2MNoqwdVDZ3srzreVZb66QofWXws8GMrKWkgP45A-2an5crKvReUo-pwvkzm68W87Q0yPJFA2Kww39UnMYNw-5qd2-Bt04VmkrqKI-lCbA-jFZY_UGzeGzNqnBGrjKuVB_q17HogMw

The following is a sample POST request for the edit operation, editing a feature service to subscribe to an additional event trigger (FeaturesUpdated) and use a new payload URL:

Use dark colors for code blocksCopy
1
2
3
4
5
6
POST /context/admin/services/myService.FeatureServer/webhooks/create HTTPS/1.1
Host: organization.domain.com
Content-type: application/x-www-form-urlencoded
Content-Length: []

name=Microsoft Flow&changeTypes=FeaturesCreated,FeaturesUpdated&signatureKey=123456789ABCDE&hookUrl=https://app.logic.azure.com:443/workflows/80fd5c68fcd84b3491b25330680ef1&payloadFormat=pjson&active=true&f=pjson&token=m7zGSezM7znt6ZuIwr827imJxOTSDsjYujVdd7SiAQLYG1HmesG8EbSnTwCbiekEh0QwRdmeyp1hP63M60TPrdZQ2NzIg5G7qFaQh40MdiOCfh60-6oPKC2MNoqwdVDZ3srzreVZb66QofWXws8GMrKWkgP45A-2an5crKvReUo-pwvkzm68W87Q0yPJFA2Kww39UnMYNw-5qd2-Bt04VmkrqKI-lCbA-jFZY_UGzeGzNqnBGrjKuVB_q17HogMw

JSON Response syntax

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
  "id": "<webhook ID>",
  "folderName": "<the service's root folder name>",
  "serviceName": "<the service name>",
  "serviceType": "<the service type>",
  "name": "<user provided webhook name>",
  "signatureKey": "<user-defined signature key>",
  "hookUrl": "<payload URL>",
  "active": <true | false>,
  "contentType": "<application/json | application/x-www-form-urlencoded",
  "scheduleInfo": { //The following object is only returned when creating a feature service webhook, as scheduling info is not applicable to geoprocessing webhooks
    "name": "<user provided schedule name>",
    "state": "enabled",
    "startAt": <time in Epoch>,
    "recurrenceInfo": {
      "interval": <integer value>,
      "frequency": "second"
    }
  },
  "payloadFormat": "<json | pjson>",
  "created": <time in Epoch when the webhook was created>,
  "modified": <time in Epoch when the webhook was last modified. If just created, this value will be the same as the value above>,
  "ownerId": "<username of the webhook's owner>",
  "modifiedId": "<username of the user to last modify the webhook. If just created, this value will be the same as the value above>",
  "changeTypes": ["user-defined event triggers"],
  "status": "<success message>"
}

JSON Response example

The following is a sample JSON Response for an updated geoprocessing service webhook:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
  "id": "91ece443-746b-43eb-9ba4-d4055b771017",
  "folderName": "System",
  "serviceName": "CachingTools",
  "serviceType": "GPServer",
  "name": "UpdatedWebhook",
  "changeTypes": ["*"],
  "signatureKey": "12345ABCDEF",
  "hookUrl": "https://app.logic.azure.com:443/workflows/...",
  "active": true,
  "contentType": "application/json",
  "scheduleInfo": {},
  "payloadFormat": "json",
  "created": 1670878247288,
  "modified": 1670878267973,
  "ownerId": "webhookAdmin",
  "modifiedId": "webhookAdmin",
  "status": "success"
}

The following is a sample JSON Response for an updated feature service webhook:

Use dark colors for code blocksCopy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
{
  "id": "e871defd-b339-43eb-aeeb-d500184820c6",
  "folderName": "Hosted",
  "serviceName": "Test",
  "serviceType": "FeatureServer",
  "name": "UpdatedWebhook",
  "signatureKey": "12345ABCDEF",
  "hookUrl": "https://app.logic.azure.com:443/workflows/...",
  "active": true,
  "contentType": "application/json",
  "scheduleInfo": {
    "name": "Every60Seconds",
    "state": "enabled",
    "startAt": 1670521784506,
    "recurrenceInfo": {
      "interval": 60,
      "frequency": "second"
    }
  },
  "payloadFormat": "json",
  "created": 1670878247288,
  "modified": 1670878267973,
  "ownerId": "webhookAdmin",
  "modifiedId": "webhookAdmin",
  "changeTypes": ["FeaturesUpdated"],
  "status": "success"
}

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