asn_webhooks_create: Establishing a webhook is a two-part process. First, a simple...

View source: R/webhooks.R

asn_webhooks_createR Documentation

Establishing a webhook is a two-part process. First, a simple HTTP POST similar to any other resource creation. Since you could have multiple webhooks we recommend specifying a unique local id for each target.

Description

Next comes the confirmation handshake. When a webhook is created, we will send a test POST to the 'target' with an 'X-Hook-Secret' header as described in the [Resthooks Security documentation](http://resthooks.org/docs/security/). The target must respond with a '200 OK' and a matching 'X-Hook-Secret' header to confirm that this webhook subscription is indeed expected.

Usage

asn_webhooks_create(..., options = list())

Arguments

...

Object Data for the request

resource

Id A resource ID to subscribe to. The resource can be a task or project.#'

target

String The URL to receive the HTTP POST.#'

Details

If you do not acknowledge the webhook's confirmation handshake it will fail to setup, and you will receive an error in response to your attempt to create it. This means you need to be able to receive and complete the webhook *while* the POST request is in-flight.

See Also

Other webhooks: asn_webhooks_delete_by_id, asn_webhooks_get_all, asn_webhooks_get_by_id, asn_webhooks


datacamp/asana documentation built on Sept. 18, 2023, 8:51 a.m.