I am trying to set up a webhook on a folder to listen for and take action on two types of events within the folder: FOLDER.CREATED, and FOLDER.DELETED. I successfully created the webhook with Postman using one of my Box Developer Tokens, but once my developer token expired an hour later, my webhook became inactive, with the webhook returning an incomplete body and the 'trigger' field reading 'NO ACTIVE SESSION'.
Is the only way to keep a webhook active really to have some perpetual server process using the box sdk to generate new access tokens every hour?
As per the box-node-webhook-to-lambda-sample on github:
Note that if your developer token expires, the webhook will no longer send events with a full payload. In that case, the event trigger will be NO_ACTIVE_SESSION. To get the webhook to send the full payload again, generate a new developer token in the Box Developer Console. Note that you don't need to recreate the webhook with the new developer token -- there just needs to be a non-expired token associated with the user that created the webhook
For context, this webhook fires off a Zapier zap, which then messages a slack channel about the event and fires off an aws lambda function. If the event is 'FOLDER.CREATED', the lambda function uses the box sdk to create a shared link for the folder, and adds the shared link to a record on Airtable.
Please sign in to leave a comment.