harsh-harlequin•2y ago
Access Token Issue
So, this might be a very noob question but here it is anyway -
I'm trying to build a Siri AI agent where you can ask Siri something and it will automatically call the Voiceflow Dialog API (via Apple Shortcuts) and give back a response.
The assistant I'm trying to build is one that can view (and edit in the future updates) Google Sheets file. But as you all know, private Google Sheets file requires OAuth Access Tokens. The problem with access token is that they expire.
While refresh tokens don't expire, I still can't just paste the refresh token in place of the access tokne. I still have to manually get a new acceess token using the refresh token and change the access token in the API call action block in the Voiceflow creator dashboard, which kind of defeats the entire purpose of the AI agent.
Any help would be much appreciated.
2 Replies
Why not using a service like Airtable or you own DB for this instead?
If using Google Sheet is a requirement, I assume that you should be able to get a new token passing the refresh token to their token refresh endpoint whenever you need. You can also choose to handle the OAuth/token refresh logic on a backend and use the API Step to fetch it when needed.
harsh-harlequinOP•2y ago
Hey, thanks for the response.
Yes, using Google Sheets is a requirement. Otherwise, I would have opted for something else long ago. Google APIs and OAuth are a pain in the ass. I tried building an entire OAuth flow on the backend using Node.js with ChatGPT (literally have 0 coding knowledge and experience) last night but failed miserably.
Was almost ready to quit but then from the depths of Reddit I found out about this platform called SheetsDB that automates and handles the entire OAuth by itself and captures all the data (or changes it) from Google Sheets and we can call the SheetsDB API to get that data (or change it). Basically, it acts as a bridge between the two.
The only limitation is that their free plan has limitations on the number of API calls per month and the number of Google Sheets files you can do this with. I'm not sure if this is a potentially good long-term solution but if someone wants to avoid coding at all costs (like me), they have relatively cheap subscription plans.
Thought I would share my findings in case someone finds it useful 🙂