設定訊息可用性

您必須先設定個人 服務專員在 Business Messages 中的訊息功能。

如果使用者在可用時段傳送訊息給服務專員,服務專員就會向使用者問候 包含歡迎訊息和對話開場白對話開始時 超過時段,使用者就會看到服務專員的離線訊息。請參閱 開始 這個 對話 進一步瞭解這些訊息

機器人和人類可用性

您可以指定單獨的機器人和真人 代表 提高可用性

只要您用任何方式自動撰寫訊息, 或自動回覆者告訴使用者 佇列,是一種複雜的自然語言理解代理程式,能以動態方式 或其中任何內容,請說明是否提供機器人傳訊功能。

如果想在 Google 代管的服務專員上啟動代理程式,就必須啟用人工服務 進入點,包括位置型進入點非本地的進入點 (Google Ads 除外)。設定人員接聽時,請僅指定你可以在星期幾,讓真人服務專員回答問題。

如果機器人代表服務全年無休 但客服代表的上班時間是上午 8 點到晚上 8 點 以便獨立作業

此外,如果同時指定機器人和人類可用性 可傳送即時服務專員要求 建議 在機器人代表無法提供服務時,提示使用者要求真人服務專員 他們的需求

更新訊息功能適用情形

如要更新訊息功能適用情形,請向商家提出 PATCH 要求 用於更新代理程式的 primaryAgentInteractionadditionalAgentInteractions 欄位。

更新這些欄位時, SupportedAgentInteraction 物件。更新要求會覆寫所有內容 欄位,包括所有子欄位。比如說 如要將執行個體新增至 hours,您需要加入所有先前的 hours 否則您的更新會覆寫這些執行個體。

必要條件

如要更新訊息功能適用情形,請先備妥以下項目:

  • 開發機器上 GCP 專案服務帳戶金鑰的路徑
  • 代理程式 name (例如「brands/12345/agents/67890」)

    如果您不知道代理程式的 name,請參閱列出 品牌

  • 機器人的可用時區、星期幾和時段

  • 人類可用性時區、星期幾和時段

如果您不知道目前的primaryAgentInteractionadditionalAgentInteractions 值,請參閱「取得代理程式」一節 資訊

傳送更新要求

如要更新代理程式,請執行下列指令。將變數替換為值 已確認在必要條件中提供的資訊。

如果同時有機器人和真人訊息的可用性,請指定機器人的可用性 primaryAgentInteraction,且執行個體為人類可用性,例如 additionalAgentInteractions

# This code updates the agent interaction of a bot and human representatives.
# Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/patch

# Replace the __BRAND_ID__ and __AGENT_ID__
# Make sure a service account key file exists at ./service_account_key.json

curl -X PATCH \
"https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__?updateMask=businessMessagesAgent.primaryAgentInteraction,businessMessagesAgent.additionalAgentInteractions" \
-H "Content-Type: application/json" \
-H "User-Agent: curl/business-communications" \
-H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \
-d '{
  "businessMessagesAgent": {
    "primaryAgentInteraction": {
      "interactionType": "BOT",
      "botRepresentative": {
        "botMessagingAvailability": {
          "hours": [
            {
              "startTime": {
                "hours": 20,
                "minutes": 0
              },
              "endTime": {
                "hours": 8,
                "minutes": 0
              },
              "timeZone": "America/Los_Angeles",
              "startDay": "MONDAY",
              "endDay": "SUNDAY"
            }
          ]
        }
      }
    },
    "additionalAgentInteractions": [
      {
        "interactionType": "HUMAN",
        "humanRepresentative": {
          "humanMessagingAvailability": {
            "hours": [
              {
                "startTime": {
                  "hours": 8,
                  "minutes": 0
                },
                "endTime": {
                  "hours": 20,
                  "minutes": 0
                },
                "timeZone": "America/Los_Angeles",
                "startDay": "MONDAY",
                "endDay": "SUNDAY"
              }
            ]
          }
        }
      }
    ]
  }
}'
# This code updates the primary agent interaction of a bot representative
# Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/patch

# Replace the __BRAND_ID__ and __AGENT_ID__
# Make sure a service account key file exists at ./service_account_key.json

curl -X PATCH \
"https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__?updateMask=businessMessagesAgent.primaryAgentInteraction" \
-H "Content-Type: application/json" \
-H "User-Agent: curl/business-communications" \
-H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \
-d '{
  "businessMessagesAgent": {
    "primaryAgentInteraction": {
      "interactionType": "BOT",
      "botRepresentative": {
        "botMessagingAvailability": {
          "hours": [
            {
              "startTime": {
                "hours": 20,
                "minutes": 0
              },
              "endTime": {
                "hours": 8,
                "minutes": 0
              },
              "timeZone": "America/Los_Angeles",
              "startDay": "MONDAY",
              "endDay": "SUNDAY"
            }
          ]
        }
      }
    }
  }
}'
# This code updates the primary agent interaction of a human representative
# Read more: https://developers.google.com/business-communications/business-messages/reference/business-communications/rest/v1/brands.agents/patch

# Replace the __BRAND_ID__ and __AGENT_ID__
# Make sure a service account key file exists at ./service_account_key.json

curl -X PATCH \
"https://businesscommunications.googleapis.com/v1/brands/__BRAND_ID__/agents/__AGENT_ID__?updateMask=businessMessagesAgent.primaryAgentInteraction" \
-H "Content-Type: application/json" \
-H "User-Agent: curl/business-communications" \
-H "$(oauth2l header --json ./service_account_key.json businesscommunications)" \
-d '{
  "businessMessagesAgent": {
    "primaryAgentInteraction": {
      "interactionType": "HUMAN",
      "humanRepresentative": {
        "humanMessagingAvailability": {
          "hours": [
            {
              "startTime": {
                "hours": 20,
                "minutes": 0
              },
              "endTime": {
                "hours": 8,
                "minutes": 0
              },
              "timeZone": "America/Los_Angeles",
              "startDay": "MONDAY",
              "endDay": "SUNDAY"
            }
          ]
        }
      }
    }
  }
}'

如需格式設定和值選項,請參閱: brands.agents.patch敬上 和 SupportedAgentInteraction