Method: projects.locations.apps.sessions.generateChatToken

Generates a session scoped token for chat widget to authenticate with Session APIs.

HTTP request

POST https://ces.googleapis.com/v1/{name=projects/*/locations/*/apps/*/sessions/*}:generateChatToken

The URL uses gRPC Transcoding syntax.

Path parameters

Parameters
name

string

Required. The session name to generate the chat token for. Format: projects/{project}/locations/{location}/apps/{app}/sessions/{session}

Request body

The request body contains data with the following structure:

JSON representation
{
  "deployment": string,
  "recaptchaToken": string
}
Fields
deployment

string

Required. The deployment of the app to use for the session. Format: projects/{project}/locations/{location}/apps/{app}/deployments/{deployment}

recaptchaToken

string

Optional. The reCAPTCHA token generated by the client-side chat widget.

Response body

Response message for WidgetService.GenerateChatToken.

If successful, the response body contains data with the following structure:

JSON representation
{
  "chatToken": string,
  "expireTime": string
}
Fields
chatToken

string

The session scoped token for chat widget to authenticate with Session APIs.

expireTime

string (Timestamp format)

The time at which the chat token expires.

Uses RFC 3339, where generated output will always be Z-normalized and use 0, 3, 6 or 9 fractional digits. Offsets other than "Z" are also accepted. Examples: "2014-10-02T15:01:23Z", "2014-10-02T15:01:23.045123456Z" or "2014-10-02T15:01:23+05:30".

Authorization scopes

Requires one of the following OAuth scopes:

  • https://www.googleapis.com/auth/cloud-platform
  • https://www.googleapis.com/auth/ces

For more information, see the Authentication Overview.