Smartsheet.Api.Internal.WebhookResourcesImpl.ResetSharedSecret C# (CSharp) Method

ResetSharedSecret() public method

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

if any argument is null or empty string if there is any problem with the REST API request if there is any problem with the REST API authorization (access token) if the resource cannot be found if the REST API service is not available (possibly due To rate limiting) if there is any other error during the operation
public ResetSharedSecret ( long webhookId ) : WebhookSharedSecret
webhookId long the sightId
return Smartsheet.Api.Models.WebhookSharedSecret
        public virtual WebhookSharedSecret ResetSharedSecret(long webhookId)
        {
            HttpRequest request = null;
            try
            {
                request = CreateHttpRequest(new Uri(Smartsheet.BaseURI, "webhooks/" + webhookId + "/resetsharedsecret"), HttpMethod.POST);
            }
            catch (Exception e)
            {
                throw new SmartsheetException(e);
            }

            HttpResponse response = this.Smartsheet.HttpClient.Request(request);

            WebhookSharedSecret secret = null;
            switch (response.StatusCode)
            {
                case HttpStatusCode.OK:
                    secret = this.Smartsheet.JsonSerializer.deserializeResult<WebhookSharedSecret>(
                        response.Entity.GetContent()).Result;
                    break;
                default:
                    HandleError(response);
                    break;
            }

            Smartsheet.HttpClient.ReleaseConnection();
            return secret;
        }