https://linen.dev logo
#help
Title
# help
r

Roman

01/08/2024, 5:34 PM
Hi everyone! I'm trying to emulate a web hook with "serveEventListeners" setting. I need to use a file for the web hook body just like I can use it in regular response. Here is my json:
Copy code
{
  "request": {
    "url": "/api/v1/initiate",
    "method": "POST"
  },
  "response": {
    "status": 201,
    "jsonBody": {
      "status": "Processing"
    },
    "headers": {
      "Content-Type": "application/json"
    },
    "transformers": [
      "response-template"
    ]
  },
  "serveEventListeners": [
    {
      "name": "webhook",
      "parameters": {
        "method": "POST",
        "url": "<http://localhost:5139/webhook>",
        "headers": {
          "Content-Type": "application/json"
        },
        "bodyFileName": "testwh.json"
      }
    }
  ]
}
The webhook works but it sends me an empty body instead of testwh.json file content. It there a way to fix it or I have to use the "body" setting?
the reason why I'm using a file is a very big size of json and actually I need to choose one of several files with different json content depended of request data
t

Tom

01/08/2024, 5:49 PM
Unfortunately this isn’t supported in the webhook definition JSON at the moment. We’re planning to rework and expand the body model used in the response so that it can be used here and in a couple of other places, but that’s still TBD at the moment.
r

Roman

01/08/2024, 6:07 PM
Thanks for your answer!
👍 1
18 Views