Webex Contact Center — Cloud Function token service (Firestore)
A Node.js Google Cloud Function with Firebase Firestore that stores Webex OAuth client settings and tokens, completes the authorization code callback, and serves GET requests that return a fresh Webex Contact Centeraccess token for cloud callers (flows, automation, HTTP clients).
Why use this playbook
- Cloud-native URL: One HTTPS endpoint on Google Cloud instead of operating your own VM for token storage when your stack is already GCP/Firebase.
- Flow-friendly pattern: Callers send
?name=and a sharedx-token-passphraseheader—easy to wire from Flow Designer or similar HTTP steps once network access is allowed. - Documented Webex APIs: Uses
https://webexapis.com/v1/access_tokenfor code exchange and refresh_token grants—no undocumented endpoints. - Clear limits: Describes Firestore layout,
/initsetup-only risk, and when to repeat browser OAuth after refresh expiry.
What it does
/callback— Exchangescodefor tokens and merges them into thetokens/{state}document in Firestore./init— Creates an empty token document (setup only; dangerous if misused in production).- GET with
namequery — ValidatesTOKEN_PASSPHRASE, returns access token if valid long enough, otherwise refreshes when refresh token is still valid.
Preview listing
This App Hub entry was published from an open pull request. Review the change.
Support
Third-Party Tool
—
Estimated Implementation Time
2-4 hours
Categories
A Node.js Google Cloud Function with Firebase Firestore that stores Webex OAuth client settings and tokens, completes the authorization code callback, and serves GET requests that return a fresh Webex Contact Centeraccess token for cloud callers (flows, automation, HTTP clients).
Why use this playbook
- Cloud-native URL: One HTTPS endpoint on Google Cloud instead of operating your own VM for token storage when your stack is already GCP/Firebase.
- Flow-friendly pattern: Callers send
?name=and a sharedx-token-passphraseheader—easy to wire from Flow Designer or similar HTTP steps once network access is allowed. - Documented Webex APIs: Uses
https://webexapis.com/v1/access_tokenfor code exchange and refresh_token grants—no undocumented endpoints. - Clear limits: Describes Firestore layout,
/initsetup-only risk, and when to repeat browser OAuth after refresh expiry.
What it does
/callback— Exchangescodefor tokens and merges them into thetokens/{state}document in Firestore./init— Creates an empty token document (setup only; dangerous if misused in production).- GET with
namequery — ValidatesTOKEN_PASSPHRASE, returns access token if valid long enough, otherwise refreshes when refresh token is still valid.
Preview listing
This App Hub entry was published from an open pull request. Review the change.