Hello everyone
I am trying to perform a POST request on my custom Webhook, using Postman.
# 8base.yml
functions:
testFn:
type: webhook
handler:
code: src/webhooks/testFn/handler.js
path: /testFn
method: POST
β’ If the request is sent without Authorization Bearer token, it works fine.
// This works fine π
curl --location --request POST 'https://api.8base.com/{workspace_id}/webhook/testFn' \
--header 'Content-Type: application/json' \
--data-raw '{
"foo": "bar"
}'
β’ However, when I perform the same action with any Authorization Bearer token in the header, it returns an error
// This doesn't work β
curl --location --request POST 'https://api.8base.com/{workspace_id}/webhook/testFn' \
--header 'Authorization: Bearer 123' \
--header 'Content-Type: application/json' \
--data-raw '{
"foo": "bar"
}'
// Error response
{
"errors": [
{
"code": "InvalidTokenError",
"message": "Token validation",
"details": {
"token": "Not valid auth token and not registered token",
"reason": "Token validation"
}
}
]
}
This is a major issue, because all the third party APIs Iβll connect my workspace to send Authorization Bearer token in the headers.
Can someone help me solve this issue ?
Thanks