What the template includes
The template is a Google Sheet with an Apps Script project behind it.Make template copy
Opens in Google Sheets
- Config — where you connect your account and set the reports configuration.
- Total chats, Ratings, Tag usage — one tab per report, each a clean data table.
- Dashboard — KPI cards and charts, rebuilt automatically from the data tabs every time you refresh.
Prerequisites
- A Text account with permission to create personal access tokens.
- A Google account to hold your copy of the sheet.
How the template works
The Apps Script project inside the spreadsheet handles the report configuration and data pulls. When you click Refresh reports, the script:- Reads your settings from the Config tab.
- Calls the Reports API over HTTPS, once per report, using your token for authentication.
- Writes each response into its data tab.
- Rebuilds the Dashboard tab from the fresh data.
Set up your template
1
Make your own copy
Open the template and choose File → Make a copy. Each copy of the file gets its own private Apps Script project.
2
Create a personal access token
Open Text and go to Settings → API access → Personal access
tokens.
Create a new token with the
reports_read scope. Copy the Base64-encoded
token shown on that screen — you’ll paste it in the next step.3
Connect the sheet
On the Config tab, click Set API token.To approve the permissions, click Advanced and approve the requested connection. Once done, paste your token into the dialog and save.When the connection is successful, you’ll see a Connected status in the Config tab.
The first time you do this, Google shows its standard permission screen for any script that calls an external service — this isn’t specific to the template.
4
Choose your date range
Still on the Config tab, set:
- From / To — leave blank for the last 30 days, or pick specific dates.
- Timezone — used to bucket time-based reports correctly.
- Distribution — the time bucket for reports that support it, like Total chats and Ratings. Possible values:
hour,day,month,year.
5
Refresh reports
Click Refresh reports, or use Reports API → Refresh all reports from the menu. Either one asks you to confirm first, since it replaces the data on every report tab. Each data tab fills in, and the Dashboard rebuilds with current KPI cards and charts. The Config tab shows the connection status and the time of the last refresh.
Token storage and sharing
Your personal access token is stored in Apps Script’s Script Properties for the project associated with your copy of the sheet. The Set API token dialog won’t show the value back to you once it’s saved — that’s a property of the dialog, not of the token’s visibility overall. The report tabs don’t update on their own — they show whatever data was last pulled during a refresh. Anyone who makes their own copy of the main template starts with no token set and connects their own account independently.Customize the code
Open Extensions → Apps Script to see the project, organized into single-purpose files:
To add a new report, edit
Reports.gs. To change authentication or error handling, edit ReportsApi.gs. UI changes — new buttons, new menu entries — go in Menu.gs.
Add a new report
New reports are added declaratively, as one entry inreportRegistry_() inside Reports.gs. Each entry describes an endpoint and how to turn its response into rows:
refreshAllReports(), gets its own tab (created if it doesn’t exist), and appears in the “Reports API” menu. For a one-click shortcut, add a matching line in Menu.gs.
More chart options exist than shown here. See
colors, cols, and
maxRows in the ratings and tags entries in Reports.gs.Keep exploring