Creating a Webhook in Box for Event Subscription
New comments and deleted items, do not reflect immediately in the SearchUnify index. A recrawl is needed to capture the changes. A method to keep your Box data in sync with the index is to enable event subscription, which involves creating a webhook.
The webhook works on files and folders. It updates the index when files and folders are deleted or added. It also updates the index when new comments are added. However, the webhook currently has no way to find out when a comment is deleted. It means that deleted comments remain in the SearchUnify index. This is a known issue and it will be fixed in the coming releases.
Create an App in Box
-
Visit https://app.box.com/developers/console. Log in if prompted.
-
In the My Apps section, click Create New App.
-
Select Custom App.
-
Select User Authentication (OAuth 2.0) and give your app a Name. Click Connect.
-
The app has been created. On the app's Configuration tab, scroll down to the Application Scopes section and check Manage webhooks. Then, click Save Changes.
-
Switch to the Webhooks tab and click Create Webhook. Select V1 from the dropdown.
-
Give the webhook a Name and add a brief Description. Check two Event Types: Commented and Deleted.
-
Scroll down to the Endpoint Configuration section. For the Endpoint URL, enter the URL in the following pattern:
-
Scroll further down to the Callback Parameters section and click add callback parameter. Add the following three callback parameters:
Method Parameter name Parameter value GET itemId item_id GET itemType item_type GET webhookEvent event_type -
Click Save Webhook.