Webex Contact Center — Cloud Function token service (Firestore) (Contact Center)

Webex Contact Center — Cloud Function token service (Firestore)

Playbook by Webex for Developers

Webex Contact Center — Cloud Function token service (Firestore)

Serverless WxCC tokens: GCF + Firestore, GET ?name=, passphrase header, OAuth callback and refresh.

Serverless WxCC tokens: GCF + Firestore, GET ?name=, passphrase header, OAuth callback and refresh.
View Playbook
Playbook by Webex for Developers

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 shared x-token-passphrase header—easy to wire from Flow Designer or similar HTTP steps once network access is allowed.
  • Documented Webex APIs: Uses https://webexapis.com/v1/access_token for code exchange and refresh_token grants—no undocumented endpoints.
  • Clear limits: Describes Firestore layout, /init setup-only risk, and when to repeat browser OAuth after refresh expiry.

What it does

  • /callback — Exchanges code for tokens and merges them into the tokens/{state} document in Firestore.
  • /init — Creates an empty token document (setup only; dangerous if misused in production).
  • GET with name query — Validates TOKEN_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 shared x-token-passphrase header—easy to wire from Flow Designer or similar HTTP steps once network access is allowed.
  • Documented Webex APIs: Uses https://webexapis.com/v1/access_token for code exchange and refresh_token grants—no undocumented endpoints.
  • Clear limits: Describes Firestore layout, /init setup-only risk, and when to repeat browser OAuth after refresh expiry.

What it does

  • /callback — Exchanges code for tokens and merges them into the tokens/{state} document in Firestore.
  • /init — Creates an empty token document (setup only; dangerous if misused in production).
  • GET with name query — Validates TOKEN_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.