Create a hosted feature service webhook

Did you know you can create a new webhook in ArcGIS Online? This blog article explains how to create a new webhook from a hosted feature service, but first, a little background?

What is a webhook?

A webhook allows web services to provide other services with near real-time information using HTTP POST requests. Webhooks are user-defined HTTP callbacks that are usually triggered by an event, such as editing or syncing a feature or changing the layer metadata. When that event occurs, the configured source such as a hosted feature service makes HTTP request to the URL configured for the webhook.

Pre-requisites

Webhooks can be turned on in an organization or a specific ArcGIS service such as a hosted feature service. Once it’s configured, the webhook is triggered each time one or more subscribed events occurs.

Note:An owner or administrator of the hosted feature service can create webhooks.

Create a hosted feature service in ArcGIS Online.

  1. Sign in to your ArcGIS online organizational account, go to My Contents , and click Add Item .
  2. Browse to the file, provide a title and tags, and keep the Publish check box checked.

Note:Here is a blog that explains how to create a hosted feature service .

AddItemFromMyComputer
  1. Once the feature layer is created, go to Settings and select  Enable Editing and Keep track of created and updated features for the feature layer. Save your changes. This enables webhooks in the service URL. Go to the Overview page and click URL – View  to view the service URL.
Enable Webhooks

Modify the service URL

Before you can create a webhook, you must modify the service URL by adding admin / between rest/ and services so the URL looks like the following.

https://services.arcgis.com/tenantID/ArcGIS/rest/ admin /services/ServiceName/FeatureServer?

On the service URL page, scroll down to the Supported Operations options and click Web Hooks .

Feature layer supported operations

Create a webhook

On the service URL admin Web Hooks page, click Create .

Webhooks create operation.

The Create operation allows administrators to create a webhook. You can specify the trigger events for this webhook and the URL to which the payloads are delivered when the webhook is invoked.

Note:Multiple webhooks can be created and multiple webhooks can share the same callback URL.

Fill out the form and create a webhook.

  • Name —Enter your webhook name.
  • Change Types —Enter the trigger event values that you want to track.
  • Signature Key —Specify a secret key that can be used to generate the HMAC hex digest using the sha256 has function.
  • HookUrl —Enter the payload URL.
  • Payload FormatJSON or PJSON . The default is JSON .
  • ActiveTrue or False . The default is False .
  • Schedule Info —Default values are provide, but you can modify them to your specifications.
  • FormatHTML or PJSON . The default is HTML .

When you have completed the form, click Create to create the webhook.

Webhook create form

Congratulations! You created a webhook!

The following image is a sample webhook containing the information you provided in the webhook form.

Created webhook

The following image lists the webhooks for a hosted feature service:

Webhooks list

About the author

Eddie Idolyantes

Eddie is a Product Engineer on the ArcGIS Online team and works primarily with the Hosted Feature Service. Our ArcGIS Online team is at the heart of the ArcGIS platform and I have the passion for problem solving to fulfill the needs of the Esri user community by pushing the envelope of Hosted Feature Service capabilities provided by ArcGIS.

我来评几句
登录后评论

已发表评论数()

相关站点

热门文章