Access Webhook data in Instant-Trigger module

Using a webhook (dedicated, without Attach or Detach) to trigger a module to get additional data.
Webhook payload is just 3 parameters:

{
  "unique_id": "<unique id>",
  "credential": "<credentials>",
  "event": "new-waiver"
}

Then get data associated with the unique_id, which has to be in the API URL as follows:

{
	// Request to API endpoint with parameter "id" defined in Mappable parameters.
	"url": "/waivers/{{connection.unique_id}}",		// Relative to base URL
	"method": "GET",
	"headers": {},
	"qs": {},										

	"response": {
		"output": "{{body}}"
	}
}

However, that does not provide the necessary data for the call, I’ve tried connection.body.unique_id, webhook.unique_id, and other permutations, but none are pulling in the data from the webhook I need.

Webhook is just simply

{
  "output": "{{body}}"
}

What am I missing here?

Thanks

If you need to use a parameter from the webhook’s response, make sure the parameter is mapped in response.data collection, otherwise the parameter will not be available via webhook.parameter mapping.

So in your case, instead of:

{
  "output": "{{body}}"
}

use:

{
    "response": {
        "data": {
            "unique_id": "{{body.unique_id}}"
        }
    }
}

Then, you can map the 'unique_id':

{
	"url": "/waivers/{{webhook.unique_id}}",
	"method": "GET",								
	"response": {
		"output": "{{body}}"
	}
}

Webhooks are documented here.

2 Likes

Thanks Tereza for the feedback.

I did get the simpler solution for myself which was referencing {{payload.unique_id}} in the Module.
I missed that in the documentation.

Thank you again regardless, and Happy New Year!

3 Likes