POST
/{orgId}/{itemId}/webhookConnectionsCreates a webhook connection in Workflow Manager for a service webhook and optionally creates the service webhook for the specified service item.
Note:
- If the service webhook creation attempt fails, a partial failure will be returned with additional error details.
- See Webhooks in ArcGIS Online for the privileges required to create and manage service webhooks.
Webhook Connection Parameters:
| Parameter | Description | Data Type |
|---|---|---|
| connectionName | Required. Define the webhook connection name to be created. | String |
| itemId | Required. The service item ID for the webhook to be created. It must be accessible by the webhook connection creator, as well as the user designated to perform the action triggered by the webhook. | String |
| webhookType | Required. The webhook type to be created. Only FeatureService is accepted. | String |
| secret | Required. A secret key to be used when executing the service webhook. | String |
| enabled | Required. If enabled is set to true, incoming webhooks will be processed by Workflow Manager. If enabled is set to false, Workflow Manager will not process incoming webhooks. Additionally, if manageWebhook is true and the service webhook can be managed, the service webhook is activated or deactivated to match the value of enabled. | Boolean |
| manageWebhook | Required. If true, Workflow Manager will attempt to create the webhook on the service item specified by the itemId. | Boolean |
| webhookChangeTypes | Optional. Specifies the events that will trigger the webhook to be created if manageWebhook is set to true. The accepted webhook events are FeaturesUpdated and FeaturesEdited. The webhookChangeTypes cannot be empty if manageWebhook is set to true. | Array[String] |
| username | Optional. The username of the user who will be performing the action triggered by the webhook. If not provided, the action will be performed as the requesting user. The user must agree to their credentials being used for webhook execution by providing their token at the time of the request. | String |
| userToken | Optional. Access token for the user as whom automated actions triggered by webhooks will be executed. If other webhook connections exist in the workflow item where the same user provided their token, then the user no longer needs to provide their token. | String |
| fallbackUsername | Optional. Alternate user for webhook execution. | String |
| fallbackUserToken | Optional. Access token for the fallback user. Like the primary user, the fallback user must only provide their token once per workflow item to opt-in. | String |
Query parameters
| Name | Type | Required |
|---|---|---|
token | string¦null |
Body parameters
Supported content types: application/json
Type: WebhookConnection
Webhook connection object
| Name | Type | Required |
|---|---|---|
connection | string | |
item | string | |
webhookType | string | |
secret | string | |
enabled | boolean | |
manage | boolean | |
webhookChangeTypes | [string]¦null | |
username | string¦null | |
user | string¦null | |
fallback | string¦null | |
fallback | string¦null |
Path parameters
| Name | Type | Required |
|---|---|---|
org | string | |
item | string |
Response status
| Status | Meaning | Description | Schema |
|---|---|---|---|
| 200 | OK | success | WebhookConnectionSuccessResponse |
| 400 | Bad Request | invalid object | WorkflowJsonExceptionDTO |
Examples
Request
# You can also use wget
curl -X POST '/{orgId}/{itemId}/webhookConnections' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <YOUR_TOKEN>' \
--data '{"connectionName":"string","itemId":"string","webhookType":"FeatureService","secret":"string","enabled":true,"manageWebhook":true,"webhookChangeTypes":["FeaturesUpdated"],"username":"string","userToken":"string","fallbackUsername":"string","fallbackUserToken":"string"}'Response
{
"success": true,
"connectionId": "string",
"message": "string",
"name": "UnableToDetermineHostingServer"
}