I have build an api-function for a trello webhook.
export default function handler(req, res) {
if (req.method == "POST") {
value = req.body;
res.status(200).json("Ok");
initalBoardID = value.model.id;
value = value.action;
type = value.type;
translationKey = value.display.translationKey;
if (
type == "addMemberToCard" &&
translationKey == "action_member_joined_card"
) {
member = value.display.entities.member.id;
createCard();
}
} else {
res.status(200).json("Function works");
}
}
If I use Postman this function works fine. But Trello doesn't send any webhook tho this function.
The URL has an SSL certificate and an https protocol.
How can I update this function that Trello send a webhook tho this function?