Bot Builder / Integrations
Google Sheets integration
Connect Google Sheets once, test the credential, then reuse it in Visual Bot Builder google_sheets nodes.
Current Implementation
- Provider key is
google_sheets. - Recommended mode is
OAuth2; Apps Scriptweb_appremains as fallback. - OAuth callback is
/api/integrations/oauth/google/callback. - OAuth popup posts
smsport_google_sheets_oauthback to SmsPort and tries to close automatically. - Visual Builder uses the saved credential through the
google_sheetsnode.
Google Cloud Setup
- Create or select a Google Cloud project.
- Enable
Google Sheets API. - Enable
Google Drive APIonly if SmsPort later adds spreadsheet picker/list/search from Google Drive. - Configure OAuth consent screen and add test users while the app is in Testing mode.
- Create an OAuth client with application type
Web application. - Add the SmsPort OAuth Redirect URL as an Authorized redirect URI. It must match exactly.
Callback URL Shape
text
Local:
http://localhost:3005/api/integrations/oauth/google/callback
Production:
https://<api-domain>/api/integrations/oauth/google/callbackProduction should not show localhost. Use INTEGRATIONS_GOOGLE_OAUTH_CALLBACK_URL as the explicit override when needed.
SmsPort Credential Flow
- Open Integrations or the Google Sheets credential modal from Visual Builder.
- Set
Connection modetoOAuth2 (recommended). - Enter
OAuth Client IDandOAuth Client Secret. - Copy
OAuth Redirect URLinto the Google Cloud OAuth client. - Click
Connect Googleand complete Google consent. - Click
Save. The modal should stay open so the connection can be tested. - Click
Testand confirm the status becomes healthy.
Visual Builder Node Fields
credentialId: saved Google Sheets connection.operation: for exampleget_rows.documentId: spreadsheet ID from the Google Sheets URL.sheetName: tab name, such asLeadsorSheet1.lookupVariableKey,keyColumn,resultColumn, andoutputVariableKeyare used for lookup-style flows.
Required Branches
success: Google Sheets operation succeeded.not_found: lookup ran but no matching row was found.error: credential, API, permission, or request failed.
Common Errors
access_denied: add the Google account as a test user or publish/verify the app.redirect_uri_mismatch: paste the exact redirect URL shown by SmsPort into Google Cloud.Google Drive API has not been used: current code is calling Drive API and should be changed to use Sheets API for normal tests.Failed to refresh Google OAuth access token: reconnect Google after confirming client ID/secret and APIs.value too long for type character varying(240): fixed by truncating run summaries before writingintegration_runs.
Debug Logs
text
google_oauth_start requested
google_oauth_start redirect_resolved
google_oauth_callback received
google_oauth_callback success
connection_test requested
connection_test resultRelated: