Introducing Webhooks for Columns

Published on 27 February 2020

If you currently use Webhooks or you want to be notified when specific column data changes, this update is for you!

Webhooks provide a way for Smartsheet to automatically notify your external application or service when certain events occur in Smartsheet. Webhooks offer a more efficient alternative to using the API to periodically poll for changes.

Webhooks for Columns is an enhancement to existing Webhooks that enables you to limit your webhooks to specific columns. Your webhooks will only be called if data in those columns is changed, rather than anywhere on the sheet. This is a more efficient use of computing and networking resources as you will not be notified for other changes within the same sheet that you don’t care about.

A new subscope field is added to the Webhook Object. Subscope contains an array field columnIds. The webhook notification will fire if data in ANY of those columns changes.

Example Webhook Object to Create Webhook

var body = {
 name: "Webhook #4",
 callbackUrl: "https://www.example.com/webhooks",
 scope: "sheet",
 scopeObjectId: 3285357287499652,
 events: ["*.*"],
 version: 1,
 subscope: {
  columnIds: [7318427511613316, 7318427511613123],
 }
};

The gotchas - expected behaviors:

  • Subscope (columnIds) is set only on creation and read-only thereafter. This is consistent with existing Update Webhook (PUT endpoint) that the scope and scopeObjectId are also not updated. You should delete and create a new Webhook if you need to modify the scope, scopeObjectId, and subscope.
  • Subscope is not returned with the callback payload. You can see the subscope information by getting the webhook by id.
  • An empty columnIds field means that all columns match. This might be a source of confusion, since the "empty means all match" behavior is a bit counter-intuitive. The API documentation is very clear about this behavior.

More information about Webhooks can be found in the Official API and SDK Documentation.

comment

Comments