- URL:
- https://<root>/services/<ServiceName>.<ServiceType>/webhooks/create
- Methods:
POST
- Required Capability:
- Access allowed with either the "Feature layer" or "Geoprocessing" privileges, or the Publisher role
- Version Introduced:
- 11.1
Description
The create
operation allows administrators to create a webhook for either an asynchronous geoprocessing service or a feature service. Once the webhook is invoked, it will deliver a payload to the configured payload URL. For geoprocessing services, the webhook is triggered when the geoprocessing job is successfully completed, canceled, or fails to complete. For feature services, administrators can specify the event triggers for the webhook, which range from all possible feature service event triggers to being notified if a single event occurs, such as a feature being created. To configure webhooks for a feature service, the feature service must include the editing capability and have change tracking enabled without sync. These properties can be modified using the Update Definition operation, which can be accessed in the ArcGIS REST Admin Services Directory by modifying the hosting or federated server's services directory URL as shown below, where <folder>
and <service
are changed to reflect the location of the feature service that will be updated:
https://organization.domain.com/context/rest/admin/services/<folder>/<serviceName>/FeatureServer/updateDefinition
To configure webhooks for non-hosted feature services, the data the service references from the enterprise geodatabase must be nonversioned and have archiving enabled. At this time, webhooks do not support services with branch versioned data.
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 signature
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-esri
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
Parameter | Details |
---|---|
(Required) | The webhook name. Example
|
(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: Example
|
(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 Example
|
(Required) | The payload URL where the payload will be delivered once the webhook is invoked. Example
|
(Optional) | Specifies the media type of the resource. The media type is a string sent with the file indicating the file's format. Values: |
(Optional) | Specifies the response payload format. The default value is Values: |
(Optional) | Specifies whether callbacks will be enabled ( Values: |
(Optional for feature service webhooks) | The window for cataloging event triggers for a feature service. The modifiable values for this parameter are the Example
|
| The response format. The default format is Values: |
Feature service event triggers
The table below lists the supported event triggers for feature services:
Event | Details |
---|---|
| Any event is triggered. |
| A feature is created. |
| A feature is updated. |
| A feature is deleted. |
| A feature is edited (e.g., insert, update, or delete). |
| A new attachment is added to a feature. |
| A feature attachment is updated. |
| A feature attachment is deleted. |
| A feature layer's schema is changed. |
| A feature layer's definition is changed. |
| A feature service's definition is changed. |
Example usage
The following is a sample POST request for the create
operation, demonstrating a geoprocessing service webhook:
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/b688528a36e246279dc050f936e5eb&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 create
operation, demonstrating a feature service webhook:
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&signatureKey=123456789ABCDE&hookUrl=https://app.logic.azure.com:443/workflows/b688528a36e246279dc050f936e5eb&payloadFormat=pjson&active=true&f=pjson&token=m7zGSezM7znt6ZuIwr827imJxOTSDsjYujVdd7SiAQLYG1HmesG8EbSnTwCbiekEh0QwRdmeyp1hP63M60TPrdZQ2NzIg5G7qFaQh40MdiOCfh60-6oPKC2MNoqwdVDZ3srzreVZb66QofWXws8GMrKWkgP45A-2an5crKvReUo-pwvkzm68W87Q0yPJFA2Kww39UnMYNw-5qd2-Bt04VmkrqKI-lCbA-jFZY_UGzeGzNqnBGrjKuVB_q17HogMw
JSON Response syntax
{
"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 a newly created geoprocessing service webhook:
{
"id": "9b9073a2-5569-4873-96d5-b46ebfe07ecb",
"folderName": "System",
"serviceName": "CachingTools",
"serviceType": "GPServer",
"name": "TestGPWebhook",
"changeTypes": ["*"],
"signatureKey": "",
"hookUrl": "https://app.logic.azure.com:443/workflows/...",
"active": true,
"contentType": "application/json",
"scheduleInfo": {},
"payloadFormat": "pjson",
"created": 1670456295297,
"modified": 1670456295297,
"ownerId": "webhooksAdmin",
"modifiedId": "webhooksAdmin",
"status": "success"
}
The following is a sample JSON response for a newly created feature service webhook:
{
"id": "e871defd-b339-43eb-aeeb-d500184820c6",
"folderName": "Hosted",
"serviceName": "Test",
"serviceType": "FeatureServer",
"name": "TestWebhook",
"signatureKey": "12345ABCDEF",
"hookUrl": "https://app.logic.azure.com:443/workflows/...",
"active": true,
"contentType": "application/json",
"scheduleInfo": {
"name": "Every20Seconds",
"state": "enabled",
"startAt": 1670521784506,
"recurrenceInfo": {
"interval": 20,
"frequency": "second"
}
},
"payloadFormat": "json",
"created": 1670521908014,
"modified": 1670521908014,
"ownerId": "webhookAdmin",
"modifiedId": "webhookAdmin",
"changeTypes": ["*"],
"status": "success"
}