您可以對授權檢視區和授權檢視區集執行下列管理作業。
所需權限和角色
如要建立及管理授權檢視集和授權檢視,您必須具備下列 IAM 權限。
授權檢視集:
| 權限 | 說明 |
|---|---|
contactcenterinsights.authorizedViewSet.create |
建立授權檢視區塊集。 |
contactcenterinsights.authorizedViewSet.get |
取得授權檢視區塊集的詳細資料。 |
contactcenterinsights.authorizedViewSet.update |
更新現有的授權檢視區塊集。 |
contactcenterinsights.authorizedViewSet.delete |
刪除授權檢視表集。 |
contactcenterinsights.authorizedViewSet.list |
列出專案中的授權檢視集。 |
授權檢視表:
| 權限 | 說明 |
|---|---|
contactcenterinsights.authorizedView.create |
建立授權檢視表。 |
contactcenterinsights.authorizedView.get |
取得授權 view 的詳細資料。 |
contactcenterinsights.authorizedView.update |
更新現有的授權檢視區塊。 |
contactcenterinsights.authorizedView.delete |
刪除授權檢視表。 |
如要授予授權檢視畫面存取權,您必須具備下列權限:
| 權限 | 說明 |
|---|---|
contactcenterinsights.authorizedView.setIamPolicy |
在授權檢視區塊中設定 IAM 政策。 |
contactcenterinsights.authorizedView.getIamPolicy |
取得授權檢視區的身分與存取權管理政策。 |
預先定義的角色
下列預先定義的 IAM 角色可提供必要權限:
| 角色 | 說明 |
|---|---|
roles/contactcenterinsights.editor |
提供所有 Customer Experience Insights 資源的讀寫存取權。 |
roles/contactcenterinsights.admin |
提供所有 Customer Experience Insights 資源的讀寫存取權。 |
授權檢視表集
授權檢視集可將多個授權檢視表分組,並簡化授權程序。
建立授權檢視集
REST
如要建立授權檢視區塊集,您必須具備 contactcenterinsights.authorizedViewSet.create 權限。
使用任何要求資料之前,請先修改下列項目的值:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION:Customer Experience Insights 資料的位置。
- AUTHORIZED_VIEW_SET_ID:授權檢視區塊組合的選用使用者定義 ID,長度必須介於 1 至 63 個字元之間,開頭和結尾須為 [a-z0-9],且字元之間可包含破折號 (-)
- DISPLAY_NAME:授權檢視區塊集的說明名稱。
HTTP 方法和網址:
POST https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets?authorized_view_set_id=AUTHORIZED_VIEW_SET_ID
JSON 要求主體:
{
"displayName": "DISPLAY_NAME"
}
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID",
"displayName": "DISPLAY_NAME",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z"
}
讀取授權檢視表集
REST
如要讀取授權的檢視畫面集,必須具備 contactcenterinsights.authorizedViewSet.get 權限。
使用任何要求資料之前,請先修改下列項目的值:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION:Customer Experience Insights 資料的位置。
- AUTHORIZED_VIEW_SET_ID:授權檢視區塊集的 ID。
HTTP 方法和網址:
GET https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID",
"displayName": "DISPLAY_NAME",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z"
}
更新授權檢視集
REST
更新已授權檢視區塊集需要 contactcenterinsights.authorizedViewSet.update 權限。
使用任何要求資料之前,請先修改下列項目的值:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION:Customer Experience Insights 資料的位置。
- AUTHORIZED_VIEW_SET_ID:授權檢視區塊集的 ID。
- DISPLAY_NAME:授權檢視區塊集的說明名稱。
- UPDATE_MASK:要更新的欄位。這個值是以半形逗號分隔的欄位清單。
display_name
HTTP 方法和網址:
PATCH https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID?update_mask=display_name
JSON 要求主體:
{
"displayName": "DISPLAY_NAME"
}
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID",
"displayName": "DISPLAY_NAME",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z"
}
刪除授權檢視畫面集
REST
刪除授權檢視區集需要 contactcenterinsights.authorizedViewSet.delete 權限。
使用任何要求資料之前,請先修改下列項目的值:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION:Customer Experience Insights 資料的位置。
- AUTHORIZED_VIEW_SET_ID:授權檢視區塊集的 ID。
HTTP 方法和網址:
DELETE https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{}
列出授權檢視表集
REST
如要列出授權檢視集,必須具備 contactcenterinsights.authorizedViewSet.list 權限。
使用任何要求資料之前,請先修改下列項目的值:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION:Customer Experience Insights 資料的位置。
- PAGE_SIZE:回應中傳回的授權檢視集數量上限。如果值為零,服務會選取預設大小。呼叫傳回的物件數量可能會少於要求數量。如果回應中包含非空白的 `next_page_token`,表示還有更多資料。
- PAGE_TOKEN:最後一個 `ListAuthorizedViewSetsResponse` 傳回的值。這個值表示這是先前 `ListAuthorizedViewSets` 呼叫的延續,且系統應傳回下一頁資料。
- FILTER:篩選授權檢視區塊集的運算式。舉例來說:
create_time > "2022-01-01T00:00:00Z"update_time < "2022-01-02T00:00:00Z"display_name = "My Authorized View Set"display_name =~ "My.*"create_time > "2022-01-01T00:00:00Z" AND display_name = "My Authorized View Set"create_time > "2022-01-01T00:00:00Z" OR display_name = "My Authorized View Set"
- ORDER_BY:用來排序回應中列出的授權檢視集。舉例來說:
create_timecreate_time descupdate_timeupdate_time descdisplay_namedisplay_name desc
HTTP 方法和網址:
GET https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets?page_size=PAGE_SIZE&page_token=PAGE_TOKEN&filter=FILTER&order_by=ORDER_BY
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"authorizedViewSets": [
{
"name": "projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID",
"displayName": "My Authorized View Set",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z"
},
{
"name": "projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID_2",
"displayName": "Another Authorized View Set",
"createTime": "2022-01-02T00:00:00.000000Z",
"updateTime": "2022-01-02T00:00:00.000000Z"
},
],
"nextPageToken": "NEXT_PAGE_TOKEN"
}
授權檢視表
授權檢視畫面會為對話設下數量限制,並定義專員或管理員的角色。
建立授權檢視表
REST
建立授權檢視表需要 contactcenterinsights.authorizedView.create 權限。
使用任何要求資料之前,請先修改下列項目的值:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION:Customer Experience Insights 資料的位置。
- AUTHORIZED_VIEW_SET_ID:這個已授權檢視區塊所屬的已授權檢視區塊集 ID。
- AUTHORIZED_VIEW_ID:授權檢視區的選用使用者定義 ID,用於建立授權檢視區。這個值必須介於 1 至 63 個字元之間,開頭和結尾須為 [a-z0-9],且字元之間可包含破折號 (-)。
- DISPLAY_NAME:授權檢視區塊集的說明名稱。
- CONVERSATION_FILTER:要套用至資料的篩選器。你可以使用下列欄位:`agent_id`。
agent_id = "agent_123"agent_id = "agent_123" OR agent_id = "agent_456"quality_metadata.agent_info.agent_id: "agent_456"quality_metadata.agent_info.teams: "team_123"
HTTP 方法和網址:
POST https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID/authorizedViews?authorized_view_id=AUTHORIZED_VIEW_ID
JSON 要求主體:
{
"displayName": "DISPLAY_NAME",
"conversation_filter": "CONVERSATION_FILTER"
}
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID/authorizedViews/AUTHORIZED_VIEW_ID",
"displayName": "DISPLAY_NAME",
"conversationFilter": "CONVERSATION_FILTER",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z"
}
讀取授權檢視表
REST
讀取已授權檢視表需要 contactcenterinsights.authorizedView.get 權限。
使用任何要求資料之前,請先修改下列項目的值:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION:Customer Experience Insights 資料的位置。
- AUTHORIZED_VIEW_SET_ID:授權檢視區塊集的 ID。
- AUTHORIZED_VIEW_ID:授權檢視區塊的 ID。
HTTP 方法和網址:
GET https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID/authorizedViews/AUTHORIZED_VIEW_ID
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID/authorizedViews/AUTHORIZED_VIEW_ID",
"displayName": "DISPLAY_NAME",
"conversationFilter": "CONVERSATION_FILTER",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z"
}
更新授權檢視表
REST
更新已授權檢視表需要 contactcenterinsights.authorizedView.update 權限。
使用任何要求資料之前,請先修改下列項目的值:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION:Customer Experience Insights 資料的位置。
- AUTHORIZED_VIEW_SET_ID:這個已授權檢視區塊所屬的已授權檢視區塊集 ID。
- AUTHORIZED_VIEW_ID:要更新的授權檢視區塊 ID。
- DISPLAY_NAME:授權檢視區塊集的說明名稱。
- CONVERSATION_FILTER:要套用至資料的篩選器。你可以使用下列欄位:`agent_id`。
agent_id = "agent_123"agent_id = "agent_123" OR agent_id = "agent_456"quality_metadata.agent_info.agent_id: "agent_456"quality_metadata.agent_info.teams: "team_123"
- UPDATE_MASK:要更新的欄位。這個值是以半形逗號分隔的欄位清單。
display_nameconversation_filter
HTTP 方法和網址:
PATCH https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID/authorizedViews/AUTHORIZED_VIEW_ID?update_mask=display_name,conversation_filter
JSON 要求主體:
{
"displayName": "DISPLAY_NAME",
"conversation_filter": "CONVERSATION_FILTER"
}
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID/authorizedViews/AUTHORIZED_VIEW_ID",
"displayName": "DISPLAY_NAME",
"conversationFilter": "CONVERSATION_FILTER",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z"
}
刪除授權檢視表
REST
刪除授權檢視表需要 contactcenterinsights.authorizedView.delete 權限。
使用任何要求資料之前,請先修改下列項目的值:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION:Customer Experience Insights 資料的位置。
- AUTHORIZED_VIEW_SET_ID:授權檢視區塊集的 ID。
- AUTHORIZED_VIEW_ID:授權檢視區塊的 ID。
HTTP 方法和網址:
DELETE https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID/authorizedViews/AUTHORIZED_VIEW_ID
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{}
列出授權檢視表
REST
如要列出授權檢視集,必須具備 contactcenterinsights.authorizedViews.list 權限。
使用任何要求資料之前,請先修改下列項目的值:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION:Customer Experience Insights 資料的位置。
- AUTHORIZED_VIEW_SET_ID:授權檢視畫面集的自訂 ID。
- PAGE_SIZE:回應中傳回的檢視區塊數量上限。如果值為零,服務會選取預設大小。呼叫傳回的物件數量可能會少於要求數量。如果回應中包含非空白的 `next_page_token`,表示還有更多資料。
- PAGE_TOKEN:上次 `ListAuthorizedViewsResponse` 傳回的值。這個值表示這是先前 `ListAuthorizedViews` 呼叫的延續,且系統應傳回下一頁資料。
- FILTER:篩選器運算式,用於篩選回應中列出的授權檢視區塊。您可以根據下列欄位進行篩選:`authorized_view_id`、`display_name`、`conversation_filter`、`create_time` 和 `update_time`。您可以使用任意和/或運算式。您也可以對字串欄位使用規則運算式。
- 範例:
display_name = "My View" - 範例:
conversation_filter =~ ".*agent-1.*" - 範例:
create_time > "2022-01-01T00:00:00Z" - 範例:
display_name =~ ".*View.*" - 範例:
create_time > "2022-01-01T00:00:00Z" AND create_time <= "2022-01-02T00:00:00Z" - ORDER_BY:用來排序回應中列出的授權檢視區塊的排序依據運算式。
- 範例:
create_time - 範例:
update_time desc
HTTP 方法和網址:
GET https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID/authorizedViews?page_size=PAGE_SIZE&page_token=PAGE_TOKEN&filter=FILTER&order_by=ORDER_BY
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"authorizedViews": [
{
"name": "projects/my-project/locations/us-central1/authorizedViewSets/my-view-set/authorizedViews/my-view-1",
"displayName": "My First View",
"conversationFilter": "agent_id = \"agent-1\"",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z"
},
{
"name": "projects/my-project/locations/us-central1/authorizedViewSets/my-view-set/authorizedViews/my-view-2",
"displayName": "My Second View",
"conversationFilter": "agent_id = \"agent-2\"",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z"
}
],
"nextPageToken": "next-page-token"
}
設定授權檢視區的身分與存取權管理政策
REST
如要在授權檢視區上設定 IAM 政策,您必須具備 contactcenterinsights.authorizedView.setIamPolicy 權限。
使用任何要求資料之前,請先修改下列項目的值:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION:Customer Experience Insights 資料的位置。
- AUTHORIZED_VIEW_SET_ID:授權檢視區塊集的 ID。
- AUTHORIZED_VIEW_ID:授權檢視區塊的 ID。
- PRINCIPAL:要授予存取權的主體 (使用者)。
- ROLE:要授予使用者的角色。
HTTP 方法和網址:
POST https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID/authorizedViews/AUTHORIZED_VIEW_ID:setIamPolicy
JSON 要求主體:
{
"policy": {
"bindings": [
{
"role": "roles/ROLE",
"members": [
"PRINCIPAL"
]
}
]
}
}
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"version": 1,
"etag": "BwW...",
"bindings": [
{
"role": "roles/ROLE",
"members": [
"PRINCIPAL"
]
}
]
}
讀取授權檢視區的身分與存取權管理政策
REST
如要讀取授權檢視區的身分與存取權管理政策,必須具備 contactcenterinsights.authorizedView.getIamPolicy 權限。
使用任何要求資料之前,請先修改下列項目的值:
- PROJECT_ID: Google Cloud 專案 ID。
- LOCATION:Customer Experience Insights 資料的位置。
- AUTHORIZED_VIEW_SET_ID:授權檢視區塊集的 ID。
- AUTHORIZED_VIEW_ID:授權檢視區塊的 ID。
HTTP 方法和網址:
GET https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/AUTHORIZED_VIEW_SET_ID/authorizedViews/AUTHORIZED_VIEW_ID:getIamPolicy
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"version": 1,
"etag": "BwW...",
"bindings": [
{
"role": "roles/ROLE",
"members": [
"PRINCIPAL"
]
}
]
}
機構設定範例
這個範例說明如何為簡化機構設定授權檢視區塊。這個範例使用 REST API,在名為 acme-corp 的虛構專案中建立及管理資源。
Acme 的結構如下:
- Alice:Alice 是專案管理員。
- Bob:Bob 是管理員。
- Carol:Carol 是代理人。
- Dave:Dave 是代理人。
每位使用者都有與電子郵件地址相關聯的主體 ID。
- Alice 的是
user:admin.alice@acme.com。 - 志明的螢幕為
user:manager.bob@acme.com。 - Carol 的是
user:agent.carol@acme.com。 - Dave 的是
user:agent.dave@acme.com。
每個代理都有 agent_id,對應於對話的 Conversation.agent_id 欄位。
- Carol 的是
agent-carol。 - Dave 的是
agent-dave。
需求條件
每位使用者都需要下列存取層級:
- 管理員存取權:Alice 是管理員,因此擁有所有資料和資源的完整存取權。
- 管理員存取權:Bob 是管理員,因此可以為所屬團隊建立、編輯及查看對話和分析。
- 服務專員存取權:服務專員 Carol 和 Dave 只能查看自己參與的對話和分析。
步驟 1:授予專案存取權
將所有使用者新增至專案,並授予 roles/browser。這個角色可讓使用者查看專案和資源。
授予使用者專案瀏覽器存取權
以下程式碼說明如何將瀏覽器角色授予 Acme 的每位成員。
gcloud projects add-iam-policy-binding acme-corp \
--member="user:admin.alice@acme.com" \
--role="roles/browser"
gcloud projects add-iam-policy-binding acme-corp \
--member="user:manager.bob@acme.com" \
--role="roles/browser"
gcloud projects add-iam-policy-binding acme-corp \
--member="user:agent.carol@acme.com" \
--role="roles/browser"
gcloud projects add-iam-policy-binding acme-corp \
--member="user:agent.dave@acme.com" \
--role="roles/browser"
詳情請參閱「授予單一角色」。
您也可以使用 Google 網上論壇管理專案存取權。您可以將 roles/browser 授予群組,不必逐一授予個別使用者。舉例來說,您可以建立名為「project-browsers@acme.com」的群組,然後將 Bob 加入這個群組。然後將 roles/browser 角色授予這個群組。詳情請參閱「Google 群組」。
步驟 2:授予管理員專案層級權限
在專案層級授予管理員 roles/contactcenterinsights.admin。舉例來說,Alice 是 Acme 的管理員,因此她會透過這個角色取得所有資源的完整存取權。
授予管理員角色
下列程式碼說明如何授予 Alice 管理員角色:
gcloud projects add-iam-policy-binding acme-corp \
--member="user:admin.alice@acme.com" \
--role="roles/contactcenterinsights.admin"
步驟 3:建立授權檢視集
建立兩組授權檢視集,將管理員和服務專員的授權檢視分組。
建立編輯者授權檢視表集
REST
這個範例會建立名為editor-view-set 的授權檢視集,將具有管理員權限的檢視分組。
HTTP 方法和網址:
POST https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets?authorized_view_set_id=editor-view-set
JSON 要求主體:
{
"displayName": "Editor View Set"
}
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/editor-view-set",
"displayName": "Editor View Set",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z"
}
建立檢視者授權檢視集
REST
這個範例會建立名為viewer-view-set 的授權檢視區塊集,將具有代理商權限的檢視區塊分組。
HTTP 方法和網址:
POST https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets?authorized_view_set_id=viewer-view-set
JSON 要求主體:
{
"displayName": "Viewer View Set"
}
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/viewer-view-set",
"displayName": "Viewer View Set",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z"
}
步驟 4:將專案層級權限授予授權檢視集
授權檢視區是內建身分的資源,需要權限才能存取 {product_name} 資料。如要授權檢視畫面存取對話和作業,請授予下列角色:
roles/contactcenterinsights.editor,適用於editor-view-set中的所有授權 viewroles/contactcenterinsights.viewer,適用於viewer-view-set中的所有授權 view
詳情請參閱授予或撤銷角色。
將編輯者角色授予 editor-view-set
這個範例會將 roles/contactcenterinsights.editor 授予 editor-view-set。
gcloud
gcloud projects add-iam-policy-binding PROJECT_ID \
--member="principalSet://contactcenterinsights.googleapis.com/projects/PROJECT_NUMBER/type/AuthorizedView/ancestor.name/authorizedViewSets/editor-view-set" \
--role="roles/contactcenterinsights.editor"
將檢視者角色授予 viewer-view-set
這個範例會將 roles/contactcenterinsights.viewer 角色授予 viewer-view-set 授權檢視集。
gcloud
gcloud projects add-iam-policy-binding PROJECT_ID \
--member="principalSet://contactcenterinsights.googleapis.com/projects/PROJECT_NUMBER/type/AuthorizedView/ancestor.name/authorizedViewSets/viewer-view-set" \
--role="roles/contactcenterinsights.viewer"
步驟 5:建立授權檢視表
為每位經理和服務專員建立授權檢視畫面,並套用適當的篩選器。
建立管理員的授權檢視表
REST
這個範例會建立 ID 為bobs-editor-view 的授權檢視區塊,用於篩選 agent_id = carol OR agent_id = dave 中的對話。
HTTP 方法和網址:
POST https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViews?authorized_view_id=bobsEditorView
JSON 要求主體:
{
"displayName": "Bob's Editor View",
"value": {
"filter": "agent_id = \"agent-carol\" OR agent_id = \"agent-dave\""
}
}
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_ID/locations/LOCATION/authorizedViews/bobs-editor-view",
"displayName": "Bob's Editor View",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z",
"conversationFilter":"agent_id = \"agent-carol\" OR agent_id = \"agent-dave\""
}
授予管理員「授權編輯者」角色
REST
這個範例會在 bobs-editor-view 上,將 roles/contactcenterinsights.authorizedEditor 授予 Acme 管理員 Bob。
HTTP 方法和網址:
POST https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/editor-view-set/authorizedViews/bobs-editor-view:setIamPolicy
JSON 要求主體:
{
"policy": {
"bindings": [
{
"role": "roles/contactcenterinsights.editor",
"members": [
"user:manager.bob@acme.com"
]
}
]
}
}
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"version": 1,
"etag": "BwW...",
"bindings": [
{
"role": "roles/contactcenterinsights.editor",
"members": [
"user:manager.bob@acme.com"
]
}
]
}
建立代理商的授權檢視畫面
REST
這個範例會為 Acme 代理商的 Carol 建立授權檢視表。這個授權 view 的 ID 為 carols-viewer-view,會篩選出 agent_id = agent-carol 的對話。
HTTP 方法和網址:
POST https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViews?authorized_view_id=carols-viewer-view
JSON 要求主體:
{
"displayName": "Carol's Viewer View",
"value": {
"filter": "agent_id = \"agent-carol\""
}
}
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_ID/locations/LOCATION/authorizedViews/carols-viewer-view",
"displayName": "Carol's Viewer View",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z",
"conversationFilter": "agent_id = \"agent-carol\""
}
將「授權檢視者」角色授予給代理人
REST
這個範例會將 roles/contactcenterinsights.authorizedViewer 授予 carols-viewer-view 上的 Carol。
HTTP 方法和網址:
POST https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/viewer-view-set/authorizedViews/carols-viewer-view:setIamPolicy
JSON 要求主體:
{
"policy": {
"bindings": [
{
"role": "roles/contactcenterinsights.viewer",
"members": [
"user:agent.carol@acme.com"
]
}
]
}
}
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"version": 1,
"etag": "BwW...",
"bindings": [
{
"role": "roles/contactcenterinsights.viewer",
"members": [
"user:agent.carol@acme.com"
]
}
]
}
為其他代理商建立授權檢視表
REST
這個範例會為 Acme 代理商的 Dave 建立授權檢視表。這個授權 view 的 ID 為 daves-viewer-view,會篩選出 agent_id = agent-dave 的對話。
HTTP 方法和網址:
POST https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViews?authorized_view_id=daves-viewer-view
JSON 要求主體:
{
"displayName": "Dave's Viewer View",
"value": {
"filter": "agent_id = \"agent-dave\""
}
}
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"name": "projects/PROJECT_ID/locations/LOCATION/authorizedViews/daves-viewer-view",
"displayName": "Dave's Viewer View",
"createTime": "2022-01-01T00:00:00.000000Z",
"updateTime": "2022-01-01T00:00:00.000000Z",
"conversationFilter": "agent_id = \"agent-dave\""
}
將「授權檢視者」角色授予其他代理人
REST
這個範例會將 roles/contactcenterinsights.authorizedViewer 授予 daves-viewer-view 上的 Dave。
HTTP 方法和網址:
POST https://contactcenterinsights.googleapis.com/v1/projects/PROJECT_ID/locations/LOCATION/authorizedViewSets/viewer-view-set/authorizedViews/daves-viewer-view:setIamPolicy
JSON 要求主體:
{
"policy": {
"bindings": [
{
"role": "roles/contactcenterinsights.viewer",
"members": [
"user:agent.dave@acme.com"
]
}
]
}
}
請展開以下其中一個選項,以傳送要求:
您應該會收到如下的 JSON 回覆:
{
"version": 1,
"etag": "BwW...",
"bindings": [
{
"role": "roles/contactcenterinsights.viewer",
"members": [
"user:agent.dave@acme.com"
]
}
]
}