Attached

The new URL address, which has been created, is automatically registered to the service using attach procedure, and can be unregistered using detach procedure.

A connection should be attached to the webhook.

Attach

The Attach remote procedure is used to automatically attach a webhook to a remote service. Please note that you will need to detach this RPC later, and for that you will need this remote procedure’s Id.

{
    "url": "https://www.example.com/api/webhook",
    "method": "POST",
    "body": {
        "url": "{{webhook.url}}"
    },
    "response": {
        "data": {
            "externalHookId": "{{body.id}}",
            "token": "{{body.token}}"
        }
    }
}

To save the remote webhook id (in order for detach to work), you must use the response.data collection. This collection will be available in the detach webhook remote procedure as webhook IML variable for you to use.

If the API returns a parameter, that should then be used in the detach remote procedure, you need to make sure the parameter is mapped in the response.data collection, otherwise the parameter will not be available via webhook.parameter mapping (see the token in the example above).

The webhook collection with webhook’s data is also accessible in regular remote procedure calls if the call is processed in the context of an Instant Trigger. For example, if you create a dynamic interface for an Instant Trigger based on parameters entered when the webhook was created.

Detach

The Detach remote procedure is used to automatically detach (delete) a webhook from a remote service when it is no longer needed. The only thing you have to do is to correctly specify the url to detach a webhook. No response processing is needed.

{
    "url": "https://www.example.com/api/webhook/{{webhook.externalHookId}}",
    "method": "DELETE"
}

Please refer to RPCs docs to get more information about writing RPCs.

Last updated