How do I return a Webhook in JSON

Hi!

So I’m trying to build a workflow where I receive a webhook to a URL (works perfectly fine) and forward the response body via a return_http_response.
When I choose {{steps.trigger.event.body}} for the Response Body in the Configuration I receive everything but a “}” is missing at the end - so Postman cannot parse the response to JSON.

I just added the missing “}” in the test script of Postman, but it would be nicer if it will be returned with the body.

Cheers
Alexander

1 Like

Hello @alexander.hehenberger,

First off, welcome to Pipedream!

I’m not sure I can reproduce your issue. I setup a simple workflow with HTTP request trigger, and an action to return an http response as below

Then I tried to send a test request from postman with a valid JSON body. The response I received is correctly

Would you mind checking on your side if the request body you send is valid?

Hi!

My JSON response looks like this:
image

Actually I just changed the response to:

Response Status Code: 200
Response Headers: { "Content-Type": "application/json" }
Response Body: {{steps.trigger.event.body}} }

Hello @alexander.hehenberger,

I’m still not quite sure how to reproduce your issue

May I ask where did you put this?

image

the additional } is what I need that postman can parse it

I also have the issue that in Postman I always receive the same response. No matter which event I choose. When I test the workflow, it shows the correct event but postman doesn’t receive it.

Plus, is it possible to always return the last event?

Thanks,
Alexander

1 Like