REST Resource: projects.chatAppConfig

資源:ChatAppConfig

代表 Google Chat 應用程式的設定,該應用程式是以 Google Workspace 外掛程式的形式建構。

JSON 表示法
{
  "name": string,
  "displayName": string,
  "description": string,
  "interactiveFeatureConfig": {
    object (InteractiveFeatureConfig)
  },
  "avatarUri": string,
  "state": enum (AppState),
  "errorLoggingEnabled": boolean,
  "markupSyntax": enum (MarkupSyntax)
}
欄位
name

string

必填。ID。Chat 擴充應用程式設定的資源名稱。

格式:projects/{project}/chatAppConfig,其中 {project} 是 Google Cloud 專案編號。

displayName

string

必填。Chat 擴充應用程式的顯示名稱,長度應介於 3 到 25 個字元。

description

string

必填。Chat 擴充應用程式的簡短說明,長度應介於 1 到 40 個半形字元。

interactiveFeatureConfig

object (InteractiveFeatureConfig)

(選用步驟) 應用程式互動功能的設定。如未提供,應用程式將不具互動性,也就是說,應用程式可以使用 Chat API,但使用者無法與應用程式互動。

avatarUri

string

(選用步驟) 應用程式顯示圖片的網址,必須是內含正方形 (顯示比例為 1:1) PNG 圖片的 HTTPS 網址。建議大小至少為 256 x 256 像素。如未指定,則會使用預設應用程式顯示圖片。

state

enum (AppState)

(選用步驟) 應用程式的狀態。如未指定,則預設為 ACTIVE。

errorLoggingEnabled

boolean

(選用步驟) 是否要將錯誤記錄至 Cloud Logging。如未指定,預設為 false。

markupSyntax

enum (MarkupSyntax)

(選用步驟) 這個 Chat 應用程式傳送或讀取訊息時,預設使用的標記語法。如未指定,則預設為 MARKUP_SYNTAX_MARKDOWN。

AppState

Chat 擴充應用程式的目前狀態。

列舉
APP_STATE_UNSPECIFIED 預設值。未指明
ACTIVE 對應至 Chat API 設定頁面中的「LIVE」。應用程式已啟用,可供有權限的使用者搜尋及使用。
DISABLED 應用程式已停用,任何人都無法再找到該應用程式,也無法再與其對話。

InteractiveFeatureConfig

應用程式互動功能的設定。

JSON 表示法
{
  "connectionConfig": {
    object (ConnectionConfig)
  },
  "appCommands": [
    {
      object (AppCommand)
    }
  ],
  "urlPatterns": [
    {
      object (UrlPattern)
    }
  ],
  "allowlistedTestingPrincipals": [
    string
  ],
  "supportsMultiuserSpaces": boolean
}
欄位
connectionConfig

object (ConnectionConfig)

必填。應用程式如何從 Google Chat 接收事件。

appCommands[]

object (AppCommand)

(選用步驟) 應用程式指令的設定。

urlPatterns[]

object (UrlPattern)

(選用步驟) 連結預覽設定。

allowlistedTestingPrincipals[]

string

(選用步驟) Google Workspace 網域中,可尋找及使用應用程式的使用者和群組電子郵件地址。

supportsMultiuserSpaces

boolean

(選用步驟) 應用程式是否可加入 1:1 人類即時訊息、群組通訊和聊天室。如未指定,預設為 false。

ConnectionConfig

應用程式接收事件的方式。

JSON 表示法
{

  "httpEndpointConfig": {
    object (HttpEndpointConfig)
  },
  "appsScriptEndpointConfig": {
    object (AppsScriptEndpointConfig)
  },
  "cloudPubSubEndpointConfig": {
    object (CloudPubSubEndpointConfig)
  },
  "dialogflowEndpointConfig": {
    object (DialogflowEndpointConfig)
  }
}
欄位
連線類型。以下是互斥欄位清單。回應中最多會設定下列其中一個欄位:
httpEndpointConfig

object (HttpEndpointConfig)

HTTP 端點設定。

appsScriptEndpointConfig

object (AppsScriptEndpointConfig)

Apps Script 部署作業設定。

cloudPubSubEndpointConfig

object (CloudPubSubEndpointConfig)

Pub/Sub 主題設定。

dialogflowEndpointConfig

object (DialogflowEndpointConfig)

Dialogflow 設定。

互斥欄位結束。

HttpEndpointConfig

HTTP 端點設定。

JSON 表示法
{

  "commonUrl": string,
  "perEventEndpointConfig": {
    object (HttpPerEventEndpointConfig)
  }
}
欄位
HTTP 端點網址設定。以下是互斥欄位清單。回應中最多會設定下列其中一個欄位:
commonUrl

string

(選用步驟) Google Chat 傳送所有互動事件的 HTTPS 網址。

perEventEndpointConfig

object (HttpPerEventEndpointConfig)

(選用步驟) Google Chat 傳送各類互動事件的獨立 HTTPS 網址。

互斥欄位結束。

HttpPerEventEndpointConfig

特定事件類型的 HTTP 端點設定。

JSON 表示法
{
  "appCommandEndpoint": string,
  "addedToSpaceEndpoint": string,
  "messageEndpoint": string,
  "removedFromSpaceEndpoint": string
}
欄位
appCommandEndpoint

string

必填。應用程式指令事件的 HTTPS 網址端點。

addedToSpaceEndpoint

string

必填。「新增至聊天室」事件的 HTTPS 網址端點。

messageEndpoint

string

必填。訊息事件的 HTTPS 網址端點。

removedFromSpaceEndpoint

string

必填。從聊天室中移除事件的 HTTPS 網址端點。

AppsScriptEndpointConfig

Apps Script 端點設定。

JSON 表示法
{
  "deploymentId": string,
  "perEventEndpointConfig": {
    object (AppsScriptPerEventEndpointConfig)
  }
}
欄位
deploymentId

string

必填。Apps Script 部署作業 ID。

perEventEndpointConfig

object (AppsScriptPerEventEndpointConfig)

(選用步驟) Google Chat 針對各類互動事件呼叫的 Apps Script 函式名稱。如未指定,Chat 會針對每個事件類型呼叫預設函式。

AppsScriptPerEventEndpointConfig

特定事件類型的 Apps Script 端點設定。

JSON 表示法
{
  "appCommandEndpoint": string,
  "addedToSpaceEndpoint": string,
  "messageEndpoint": string,
  "removedFromSpaceEndpoint": string
}
欄位
appCommandEndpoint

string

(選用步驟) 應用程式指令事件的函式名稱。如未指定,系統會使用預設的 onAppCommand 函式名稱。

addedToSpaceEndpoint

string

(選用步驟) 新增至聊天室事件的函式名稱。如未指定,系統會使用預設的 onAddedToSpace 函式名稱。

messageEndpoint

string

(選用步驟) 訊息事件的函式名稱。如未指定,系統會使用預設的 onMessage 函式名稱。

removedFromSpaceEndpoint

string

(選用步驟) 從聊天室移除事件的函式名稱。如未指定,系統會使用預設的 onRemovedFromSpace 函式名稱。

CloudPubSubEndpointConfig

Pub/Sub 端點設定。

JSON 表示法
{
  "topic": string
}
欄位
topic

string

必填。Google Chat 會將所有互動事件發布至這個 Pub/Sub 主題。主題必須與應用程式位於相同的 Google Cloud 雲端專案,且 Chat 必須具備將訊息發布至主題的權限。詳情請參閱「使用 Pub/Sub 建構 Google Chat 應用程式」。

格式:projects/{project}/topics/{topic}

DialogflowEndpointConfig

Dialogflow 端點設定。

JSON 表示法
{
  "dialogflowEdition": enum (DialogflowEdition),
  "agent": string
}
欄位
dialogflowEdition

enum (DialogflowEdition)

必填。Dialogflow 版本。

agent

string

(選用步驟) Dialogflow CX 代理或環境名稱。Dialogflow CX 必須提供這項資訊。請勿為 Dialogflow ES 設定。

格式:projects/{project}/locations/{location}/agents/{agent} 或 projects/{project}/locations/{location}/agents/{agent}/environments/{environment}。

DialogflowEdition

Dialogflow 版本類型。

列舉
DIALOGFLOW_EDITION_UNSPECIFIED 預設值。未指明
ES Dialogflow ES 版本。如要使用這個版本,Dialogflow ES 代理必須與應用程式位於同一個 Google Cloud 雲端專案中。Google Chat 會將所有互動事件傳送至該代理。
CX Dialogflow CX 版本。如要使用這個版本,Dialogflow CX 代理必須與應用程式位於同一個 Google Cloud 雲端專案,並在 agent 欄位中指定。Google Chat 會將所有互動事件傳送給該代理。

AppCommand

應用程式指令的設定。

JSON 表示法
{
  "commandType": enum (CommandType),
  "commandId": integer,
  "command": string,
  "displayName": string,
  "description": string,
  "dialogEnabled": boolean,
  "loadingNotificationMessage": string
}
欄位
commandType

enum (CommandType)

必填。這個指令的類型。

commandId

integer

必填。指令的 ID (1 至 1000)。在應用程式中不得重複。

command

string

(選用步驟) 指令名稱。如果是 SLASH_COMMAND,則必須設定;如果是其他指令類型,則不需設定。開頭必須是「/」,例如「/command」。

displayName

string

(選用步驟) 指令的顯示名稱,容易使用。MESSAGE_ACTION 和 QUICK_COMMAND 必須設定,SLASH_COMMAND 則不應設定。

description

string

必填。指令的簡短說明。

dialogEnabled

boolean

(選用步驟) 這個指令是否應觸發對話方塊。如未指定,則預設為 false。

loadingNotificationMessage

string

(選用步驟) 使用者觸發訊息動作時,會收到這則通知。僅支援 MESSAGE_ACTION 指令。

CommandType

應用程式指令的類型。

列舉
COMMAND_TYPE_UNSPECIFIED 預設值。未指明
SLASH_COMMAND 輸入「/」和指令名稱即可叫用指令。訊息文字中可能包含其他引數。
QUICK_COMMAND 從郵件撰寫內容選單叫出的快速指令。快速指令不接受額外引數。
MESSAGE_ACTION 從訊息內容選單叫用的指令。

UrlPattern

連結預覽的設定。

JSON 表示法
{
  "hostPattern": string,
  "pathPrefix": string
}
欄位
hostPattern

string

必填。要比對的網域。比對特定子網域 (例如「subdomain.example.com」),或加入星號 (*) 做為前置萬用字元,比對整個網域。舉例來說,「*.example.com」會比對「https://subdomain.example.com」和「https://any.number.of.subdomains.example.com」。

pathPrefix

string

(選用步驟) 附加至主機模式的路徑前置字串。如果留空,系統會比對主機模式中的所有網址。舉例來說,與主機模式「subdomain.example.com」配對時,指定「path/」即可比對開頭為「https://subdomain.example.com/path/」的網頁網址。

MarkupSyntax

這個 Chat 擴充應用程式用來設定訊息文字格式的標記語法。

列舉
MARKUP_SYNTAX_UNSPECIFIED 預設值。未指定。在 markup_syntax 推出前建立的現有 Chat 擴充應用程式會採用這個值,並使用 MARKUP_SYNTAX_CHAT,直到明確更新為止。
MARKUP_SYNTAX_CHAT 使用 Google Chat 的標記語法。詳情請參閱 https://developers.google.com/workspace/chat/format-messages#format-texts。
MARKUP_SYNTAX_MARKDOWN 使用 Markdown 語法。這個語法是以 CommonMark 規格為基礎,並提供額外擴充功能。詳情請參閱 https://developers.google.com/workspace/chat/format-messages#format-texts。

方法

get

取得專案的 Chat 擴充應用程式設定。

patch

更新專案的 Chat 擴充應用程式設定。