You're probably here because you:
- want to launch a Twilio app in minutes
- don't want to use your own servers or write (complex, third-party) code to
- want to use Google Sheets to store interactions with your Twilio phone number
You're in the right place! First, make sure to check out Twilio's Google Sheets Quick Deploy app in CodeExchange.
Before interacting with Google Drive services like Sheets from your Twilio app, you need to prove to Google that your app is authorized to access your data. This blog post will walk you through how you can fetch your Google credentials and launch this app within minutes.
Creating a Service Account
The first thing you need to do is create a Google Project before moving on. In this example, I'll use the name "Twilio Sheets".
Next, from your project dashboard, in the menu on the left, navigate to IAM & admin -> Service Accounts.
From here, you'll want to click CREATE SERVICE ACCOUNT
And fill out the information requested. I named mine "twilio-sheets" for example.
Feel free to leave the optional sections blank.
Gathering your credentials
Click on the Service Account you just made and click on the KEYS tab.
In here, click to create a new key and select "JSON" as the type of key.
This will automatically download a JSON file to your computer
. This is a sensitive file and should not be pushed to any public repository.
Using your credentials in CodeExchange
Next, open this file and copy the contents. You can do this by highlighting all the text, right-clicking and clicking “Copy”.
Then, go back to your CodeExchange app and paste this into the textbox that says “Google credentials”
And you’re done! You can continue through the rest of the app to get your Quick Deploy app launched.
Extra steps if you are using Google Sheets
If your project is using Google Sheets in particular, you should also do the following to make sure everything works correctly:
- Enable the Google Sheets API for your specific project in the Google Cloud Platform console. This link will default to your last project, so double check that it is the correct project.
- Add the email address for your project's Service Account to your Google Sheet, using the "Share" functionality.
With those taken care of, you should be ready to go.