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 |
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 |
Required. The deployment of the app to use for the session. Format: projects/{project}/locations/{location}/apps/{app}/deployments/{deployment} |
recaptchaToken |
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 |
The session scoped token for chat widget to authenticate with Session APIs. |
expireTime |
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: |
Authorization scopes
Requires one of the following OAuth scopes:
https://www.googleapis.com/auth/cloud-platformhttps://www.googleapis.com/auth/ces
For more information, see the Authentication Overview.