Accepting x-www-form-urlencoded request in webhook

I’ve set up a webhook to verify a user with a third party service. That third party service sends a token and user ID that I’ve provided to the webhook where I verify and return a true/false response.

The webhook is working fine for requests with a JSON body, however this 3rd party service is sending the token and user ID as application/x-www-form-urlencoded which the webhook seems unable to handle.

This is the error I’m seeing in postman:
{
“errors”: [
{
“code”: “ValidationError”,
“message”: “The request is invalid.”,
“details”: {
“body”: “Syntax error, malformed JSON”
}
}
]
}

Is there anyway to work around this, or will I need to set up a lambda outside of 8base?

1 Like

I’ve managed to get this working by setting up an aws API gateway and passing the request through a request mapping template before forwarding to the 8base webhook.

It would be great if something like this could be handled within 8base so I don’t need to manage other infrastructure on top.

If you’re already using api gateway and lambda on the backend of 8base it might be possible to use something similar to capture various types of request details and pass them through on the event object in addition to the request body json.

@squadsdev yes this is something we need to improve. We will answer to you later today.

@squadsdev we’ve added this to the backlog. We are going to upload this feature in a week or so. I will let you know as soon as it will be ready. Thank you for reporting that!

3 Likes

Great, thanks @ilya.8base.

Hi, @squadsdev. We just released a fix for that!