Beispiel #1
0
        /// <summary>
        /// Create an new webhook.
        /// </summary>
        /// <param name="webhook">The webhook to be created.</param>
        /// <returns>The ID of the newly created webhook.</returns>
        public int CreateWebhook(Webhook webhook)
        {
            var request = new RestRequest(Method.POST);
            request.Resource = "/{accountId}/webhooks";
            request.AddBody(webhook);

            return Execute<int>(request);
        }
Beispiel #2
0
        /// <summary>
        /// Update an existing webhook
        /// </summary>
        /// <param name="webhookId">The ID of the Webhook to update.</param>
        /// <param name="webhook">The webhook parameters to be updated.</param>
        /// <returns>The id of the updated webhook, or False if the update failed.</returns>
        public int UpdateWebhook(string webhookId, Webhook webhook)
        {
            var request = new RestRequest(Method.PUT);
            request.Resource = "/{accountId}/webhooks/{webhookId}";
            request.AddUrlSegment("webhookId", webhookId);
            request.AddBody(webhook);

            return Execute<int>(request);
        }