Hi everyone! I'm trying to emulate a web hook with...
# help
r
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
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
Thanks for your answer!
👍 1