Custom responses
A Custom Response allows you to control the response that your webhook sends back to the source of a request. This can be useful if you need to:- Modify the content type of the response (e.g., JSON, plain text)
- Dynamically adjust the response content based on request data (such as data in the request body, query parameters, or headers)
- Tailor responses based on specific requirements from external systems or API integrations.
Why Use a Custom Response?
Custom responses are helpful when:- You want to dynamically replace parts of the response with incoming request data.
- You need to meet a specific content-type requirement, especially when working with APIs that expect responses in formats other than JSON.
- You aim to streamline response handling, directly from the webhook.
How to Set a Custom Response in Pabbly Hook
To set a custom response, follow these steps:- Navigate to the Custom Response Section: In Pabbly hook, locate the connection where you want to apply a custom response. Under the hook settings, find the "Custom Response" section.
- Activate the Custom Response: Mark the custom response as active to enable it for the webhook.
- Configure the custom response using Content Type and Content.
- Specify the Content Type: Choose the appropriate content type (e.g., application/json, text/plain) to ensure the response meets any specific format requirements.
- Define the Custom Response Content: Customize the response content with placeholders to insert request data dynamically.
- Use $request.body.<key>$ to replace placeholders with values from the request body.
- Use $request.query.<key>$ for values from query parameters.
- Use $request.headers.<key>$ for values from headers.
- Once satisfied with the custom response, click Save.
- Now you can send the webhook and check the custom response(Below is the screen shot for your reference).
- Now you see the custom response while triggering the webhook(Below is the screen shot for your reference).
Example : I will not send name in body.
Last edited: