waha icon indicating copy to clipboard operation
waha copied to clipboard

[Feature Request] - Validate sessions payload

Open devlikepro opened this issue 1 year ago • 1 comments

Right now it's possible to start not valid sessions, like using webhooks key=value instead of list

  {
    "name": "session_12",
    "config": {
      "webhooks": {
        "url": "https://dev-api.wconnect.app/webhooks/receive",
        "events": [
          "message.any",
          "session.status"
        ],
        "retries": {
          "delaySeconds": 2,
          "attempts": 15
        }
      }
    },
  }

We need to validate it in endpoints

patron:PRO

devlikepro avatar Aug 02 '24 09:08 devlikepro

It'll return 400 response with a description in 2024.9.1

{
  "statusCode": 400,
  "message": [
    "config.webhooks must be an array"
  ],
  "error": "Bad Request"
}

patron:PRO

devlikepro avatar Aug 11 '24 06:08 devlikepro