Box.V2.Managers.BoxWebhooksManager.CreateWebhookAsync C# (CSharp) Method

CreateWebhookAsync() public method

Create a new webhook.
public CreateWebhookAsync ( BoxWebhookRequest webhookRequest ) : Task
webhookRequest Box.V2.Models.BoxWebhookRequest BoxWebhookRequest object.
return Task
        public async Task<BoxWebhook> CreateWebhookAsync(BoxWebhookRequest webhookRequest)
        {
            BoxRequest request = new BoxRequest(_config.WebhooksUri)
                .Method(RequestMethod.Post)
                .Payload(_converter.Serialize<BoxWebhookRequest>(webhookRequest));

            IBoxResponse<BoxWebhook> response = await ToResponseAsync<BoxWebhook>(request).ConfigureAwait(false);

            return response.ResponseObject;
        }