Table of Contents

Interface WebhookResources

Namespace
Smartsheet.Api
Assembly
smartsheet-csharp-sdk.dll

Interface used to encapsulate webhook resources.

public interface WebhookResources

Methods

CreateWebhook(Webhook)

Creates a new Webhook.

The request body is limited to name(required), callbackUrl (required), scope (required) scopeObjectId (required), events(required), version(required)

It mirrors to the following Smartsheet REST API method:POST /webhooks

Webhook CreateWebhook(Webhook webhook)

Parameters

webhook Webhook

the webhook to be created

Returns

Webhook

the created webhook

Exceptions

InvalidOperationException

if any argument is null or empty string

InvalidRequestException

if there is any problem with the REST API request

AuthorizationException

if there is any problem with the REST API authorization (access token)

ResourceNotFoundException

if the resource cannot be found

ServiceUnavailableException

if the REST API service is not available (possibly due to rate limiting)

SmartsheetException

if there is any other error during the operation

DeleteWebhook(long)

Delete a webhook.

It mirrors to the following Smartsheet REST API method: DELETE /webhooks/{webhookId}

void DeleteWebhook(long webhookId)

Parameters

webhookId long

the webhook Id

Exceptions

InvalidOperationException

if any argument is null or empty string

InvalidRequestException

if there is any problem with the REST API request

AuthorizationException

if there is any problem with the REST API authorization (access token)

ResourceNotFoundException

if the resource cannot be found

ServiceUnavailableException

if the REST API service is not available (possibly due to rate limiting)

SmartsheetException

if there is any other error during the operation

GetWebhook(long)

Gets the Webhook specified in the URL.

It mirrors to the following Smartsheet REST API method: GET /webhooks/{webhookId}

Webhook GetWebhook(long webhookId)

Parameters

webhookId long

the Id of the webhook

Returns

Webhook

the webhook resource (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null).

Exceptions

InvalidOperationException

if any argument is null or empty string

InvalidRequestException

if there is any problem with the REST API request

AuthorizationException

if there is any problem with the REST API authorization (access token)

ResourceNotFoundException

if the resource cannot be found

ServiceUnavailableException

if the REST API service is not available (possibly due to rate limiting)

SmartsheetException

if there is any other error during the operation

ListWebhooks(PaginationParameters?)

Gets the list of all Webhooks that the user owns (if a user generated token was used to make the request) or the list of all Webhooks associated with the third-party app (if a third-party app made the request). Items in the response are ordered by API Client name, then Webhook name, then creation date.

It mirrors to the following Smartsheet REST API method: GET /webhooks

PaginatedResult<Webhook> ListWebhooks(PaginationParameters? paging = null)

Parameters

paging PaginationParameters

Returns

PaginatedResult<Webhook>

IndexResult object containing an array of Webhook objects

Exceptions

InvalidOperationException

if any argument is null or empty string

InvalidRequestException

if there is any problem with the REST API request

AuthorizationException

if there is any problem with the REST API authorization (access token)

ResourceNotFoundException

if the resource cannot be found

ServiceUnavailableException

if the REST API service is not available (possibly due to rate limiting)

SmartsheetException

if there is any other error during the operation

ResetSharedSecret(long)

Resets the shared secret for the specified Webhook. For more information about how a shared secret is used, see Authenticating Callbacks.

The request body should be empty

It mirrors to the following Smartsheet REST API method: POST /webhooks/{webhookId}/resetsharedsecret

WebhookSharedSecret ResetSharedSecret(long webhookId)

Parameters

webhookId long

the webhook Id

Returns

WebhookSharedSecret

the Webhook shared secret

Exceptions

InvalidOperationException

if any argument is null or empty string

InvalidRequestException

if there is any problem with the REST API request

AuthorizationException

if there is any problem with the REST API authorization (access token)

ResourceNotFoundException

if the resource cannot be found

ServiceUnavailableException

if the REST API service is not available (possibly due to rate limiting)

SmartsheetException

if there is any other error during the operation

UpdateWebhook(Webhook)

Updates the Webhook specified in the URL.

The request body is limited to the name, events, callbackUrl, enabled and version attributes.

It mirrors to the following Smartsheet REST API method: PUT /webhooks/{webhookId}

Webhook UpdateWebhook(Webhook webhook)

Parameters

webhook Webhook

the webhook to update

Returns

Webhook

the updated webhook

Exceptions

InvalidOperationException

if any argument is null or empty string

InvalidRequestException

if there is any problem with the REST API request

AuthorizationException

if there is any problem with the REST API authorization (access token)

ResourceNotFoundException

if the resource cannot be found

ServiceUnavailableException

if the REST API service is not available (possibly due to rate limiting)

SmartsheetException

if there is any other error during the operation