Skip to main content

I’m trying to make a custom Monday trigger for an integration app. However, I’m getting an error when creating the webhook using the MondaySDK. Error: “jwt must be provided”. I already have the access_token in monday.setToken() but still getting the same error.


Wanted to confirm if its because the mutation for webhook only accepts API Key as authorization? So I can’t create it using the SDK?


Would appreciate your help. Thank you!


router.post("/subscribe", async (req, res) => {
const { subscriptionId, webhookUrl, inputFields } = req.body.payload;

const { userId, accountId, aud, exp, iat } = jwt.verify(
req.headers.authorization,
process.env.MONDAY_SIGNING_SECRET
);

try {
await SubscriptionController.createSubscription(
subscriptionId,
webhookUrl,
accountId,
userId,
inputFields.boardId
);

const MondayToken = await UserController.findOneMondayToken(userId);
console.log(MondayToken);
monday.setToken(MondayToken.token.access_token);
const mondayEventsWebhook = await monday.api(
`mutation {
create_webhook (board_id: ${inputFields.boardId}, url: "${process.env.BASE_URL}/${subscriptionId}/status-change", event: change_status_column_value) {
id
board_id
}
}`
);

return res.status(200).send({ webhookId: subscriptionId });
} catch (error) {
console.log(error);
return res.status(500).send({ message: "internal server error" });
}
});

Hello @effex07 and welcome to the community!


I hope you like it here 💪


Would you be able to please send us an email to appsupport@monday.com so we can take a closer look into this and give this some following?


Looking forward to hearing from you via email!


Cheers,

Matias


Hey, were you able to resolve this?


I am getting the same error as well and need to figure out what to do next.


Reply