google-sheetsgoogle-apps-scriptweb-applicationsslack-commands

Slack to Google Sheets integration "dispatch failed" error from slash command


I have created a simple slash command in Slack which retrieves some data from a google sheet. The sheet extension is deployed as a web app and works fine, there is no code error. However, after about a week, the slash command no longer works and returns a "dispatch failed" error. To fix, I have to redeploy the web app (keeping the same URL). Again, it works fine for a week or so then fails with the same error. Is there a way that I can avoid having to do this and get the web app to work permanently?


Solution

  • Google sometimes regularly(about a week) revokes granted authorization for webapps(probably as a security measure). To reduce automatic revokations, reduce the scopes used by the script: