Being an ArcGIS administrator requires managing a vast quantity of information, as well as potentially very large numbers of items, users and groups. Your ArcGIS organization allows you to view and update this content, and third party applications such as GEO Jobe’s Admin Tools for ArcGIS can make the task even easier. But sometimes you want to be alerted to changes as soon as they happen, and that’s where webhooks come in.
What are Webhooks?
Imagine the following scenario: you have a number of feature services that contain information about your customers. Some of these feature services contain sensitive data that your organization needs but that shouldn’t be shared publicly, such as Social Security Numbers or credit card numbers. You may also want to have publicly available versions of these services with that sensitive information removed. But what if someone accidentally shares one of the versions with sensitive information publicly? If you have hundreds or thousands of publicly shared feature services, it would be enormously time consuming, if not impossible, to search through all of them to make sure there is no sensitive data in them. Even if you write a script to do this, you might only be able to run that script once per day, which would mean that sensitive information would be out there for anyone to see for up to 24 hours. Wouldn’t it be nice if you could immediately, automatically be informed the moment someone publicly shares a service with sensitive information–and wouldn’t it be even better if that service could be automatically unshared?
Generally speaking, webhooks are event listeners that respond whenever a particular action occurs. The webhook detects the action and then sends information about the action (the payload) to the URL of the application configured to receive it. That application can then perform some functionality based on the information contained in the payload. In the example above, the webhook would contain the ID of the item that was shared publicly, and the application could then do something to that item, such as tag it or unshare it, or simply alert an admin.
Webhooks for ArcGIS
Esri provides two kinds of webhooks for ArcGIS: hosted feature service webhooks and webhooks for items, users and groups. Hosted feature service webhooks are available in ArcGIS Online, and also in Beta on Enterprise 11. These webhooks detect actions such as editing or adding features. Webhooks for items, users and groups are available in Enterprise 10.7 and above, and detect actions such as sharing content, changing ownership of content, or creating content. Webhooks are not accessible in the normal ArcGIS organization interface, but can be viewed and managed via the REST API. Creating a webhook is simple: just choose a name, the events you want to watch for (such as a user being added or an item’s ownership being updated), and the payload URL that will receive the webhook’s payload. There are also several optional settings. Once that’s set up, the application can begin receiving payloads from the webhook. These payloads contain several pieces of information, including the item, user or group involved, the action that occurred, the user that performed the action, and the time the action occurred.
Webhooks provide several advantages over traditional methods of manually or programmatically checking content to detect changes. They are proactive rather than reactive, because they act as soon as changes occur, rather than waiting for user action or a program to run. They are also more efficient; manually looking for changes will often involve checking content that hasn’t changed since the last time it was checked, which is a waste of time, whereas webhooks allow you to only perform actions on content that has changed. Webhooks are particularly valuable for situations that are time sensitive, as in the example above.
Unleash the Power of Webhooks with GEO Jobe
If you are interested in webhooks but you don’t know how to get started, or you’re not a programmer, webhooks for items, users and groups are a key component of GEO Jobe’s new product, Scheduler for ArcGIS. Scheduler for ArcGIS allows you to schedule custom, multi-step tasks and complex workflows for your ArcGIS organization that run automatically–without having to write any code. Scheduler’s tasks can run on a schedule, but for Enterprise organizations, they can also be triggered by webhook events. For the example above, you could create a custom Scheduler task linked to a webhook that would check any feature service that is shared publicly for sensitive information, based on either text or a regular expression (such as a regular expression for Social Security Numbers). The task could then tag the service, email the service’s owner, email the org admin, and/or unshare the service. A Scheduler task with webhooks could also be used for actions such as detecting when a new user is added and automatically sending them an email with information about the organization, ensuring that all items added to a group have information such as a description, tags or credits, or alerting you when delete protection is removed from an important item. All of this can be created with just a few clicks, and will run automatically every time the selected event occurs.
Scheduler also provides a comprehensive, easy-to-use interface to view and manage webhooks in bulk. This interface can activate, deactivate, create, delete, update, export and clone webhooks for all of the organizations licensed for Scheduler. Scheduler can manage all webhooks regardless of whether they’re being used for a Scheduler task, and webhooks created for Scheduler come with additional options to give you better control over how webhooks trigger tasks. Your existing webhooks can also be easily migrated to Scheduler. All of this means that anyone can harness the full power of webhooks for items, users and groups, with no programming necessary.
Esri currently does not provide items, users and groups webhooks for ArcGIS Online. If you have AGOL and want to detect changes to content, Scheduler offers an alternative in the form of our Monitor tools. These tools compare information about items, users and groups to snapshots taken the last time the tool was run to determine when properties have changed. These tools still have to be scheduled, rather than occurring automatically as soon as the event occurs, but they can also be used to perform tasks such as finding sensitive information in feature services or validating item, user or group details.
For AGOL orgs that don’t have access to webhooks, Scheduler can run automated tasks to check for changes to content. Webhooks are a valuable tool for managing data proactively and detecting time sensitive events. Whether you are interested in using webhooks with Scheduler for ArcGIS or you want to work with our Professional Services team on custom development involving webhooks, GEO Jobe can help you use webhooks to allow your organization to function more effectively and securely.