ตั้งค่าความพร้อมในการรับส่งข้อความ

ก่อนที่ผู้ใช้จะเริ่มสนทนากับตัวแทนของคุณ คุณต้องตั้งค่าความพร้อมในการรับส่งข้อความของตัวแทนใน Business Messages

หากผู้ใช้ส่งข้อความถึงตัวแทนในช่วงเวลาที่พร้อมให้บริการ ตัวแทนจะทักทายผู้ใช้ด้วยข้อความต้อนรับและการเริ่มสนทนา หากการสนทนาเริ่มต้นนอกเวลาที่ว่าง ผู้ใช้จะเห็นข้อความออฟไลน์ของตัวแทน โปรดดูเริ่มต้น การสนทนาเพื่อดูข้อมูลเพิ่มเติมเกี่ยวกับข้อความเหล่านี้

ความพร้อมใช้งานของบ็อตและมนุษย์

คุณสามารถระบุบ็อตและความพร้อมใช้งานของตัวแทนได้

หากคุณมีระบบอัตโนมัติในการเขียนข้อความสําหรับตัวแทนของคุณ ไม่ว่าระบบอัตโนมัติจะเป็นผู้ตอบอัตโนมัติซึ่งแจ้งให้ผู้ใช้ทราบว่าอยู่ในคิวของตนหรือไม่ ตัวแทนที่เข้าใจภาษาธรรมชาติอย่างซับซ้อนซึ่งมีสิทธิ์เข้าถึงรายละเอียดผู้ใช้แบบไดนามิกหรือสิ่งใดก็ตามในระหว่างนั้น ให้ระบุความพร้อมใช้งานของการรับส่งข้อความบ็อต

ความพร้อมใช้งานของมนุษย์เป็นสิ่งจําเป็นหากคุณต้องการเปิดใช้ตัวแทนในจุดแรกเข้าที่จัดการโดย Google รวมถึงจุดแรกเข้าตามตําแหน่งและจุดแรกเข้านอกพื้นที่ (ยกเว้น Google Ads) สําหรับความพร้อมให้บริการของมนุษย์ ให้ระบุเฉพาะวันในสัปดาห์และชั่วโมงที่คุณจะมีตัวแทนแบบเรียลไทม์ที่ตอบคําถามได้

หากตัวแทนบ็อตพร้อมให้บริการทุกวันตลอด 24 ชั่วโมง แต่ตัวแทนที่เป็นเจ้าหน้าที่พร้อมให้บริการตั้งแต่ 8:00 น. ถึง 20:00 น. คุณอาจระบุหน่วยงานอิสระได้

นอกจากนี้ หากระบุทั้งความพร้อมของบ็อตและมนุษย์ คุณจะส่งคําแนะนําคําขอเกี่ยวกับตัวแทนแบบเรียลไทม์เพื่อแจ้งให้ผู้ใช้ขอตัวแทนแบบเรียลไทม์ได้หากตัวแทนบ็อตตอบสนองความต้องการไม่ได้

อัปเดตความพร้อมในการรับส่งข้อความ

หากต้องการอัปเดตความพร้อมใช้งานของการรับส่งข้อความ คุณต้องส่งคําขอ Pwatch ด้วย Business Communications API เพื่ออัปเดตช่อง primaryAgentInteraction และ additionalAgentInteractions ของตัวแทน

เมื่ออัปเดตช่องเหล่านี้ คุณต้องระบุค่าสําหรับทุกช่องในออบเจ็กต์ SupportAgentโต้ตอบ คําขออัปเดตจะเขียนทับเนื้อหาของช่องทั้งหมดที่คุณแก้ไข รวมถึงช่องย่อยด้วย ตัวอย่างเช่น หากส่งคําขอเพิ่มอินสแตนซ์ไปยัง hours คุณจะต้องใส่อินสแตนซ์ hours ก่อนหน้าทั้งหมดด้วย มิเช่นนั้นการอัปเดตจะเขียนทับอินสแตนซ์นั้น

สิ่งที่ต้องดำเนินการก่อน

ก่อนที่จะอัปเดตความพร้อมใช้งานของการรับส่งข้อความ คุณต้องมีรายการต่อไปนี้

  • เส้นทางไปยังคีย์บัญชีบริการของโปรเจ็กต์ GCP ในเครื่องพัฒนาซอฟต์แวร์
  • ตัวแทน name (เช่น "brands/12345/agents/67890")

    หากไม่ทราบ name ของตัวแทน ให้ดูระบุตัวแทนทั้งหมดสําหรับแบรนด์

  • เขตเวลาเวลาว่างของบ็อต วันในสัปดาห์ และชั่วโมง

  • เขตเวลาที่พร้อมใช้งาน วันในสัปดาห์ และชั่วโมงที่มนุษย์ทํางาน

หากไม่ทราบค่า primaryAgentInteraction และ additionalAgentInteractions ปัจจุบัน โปรดดูรับข้อมูลตัวแทน

ส่งคําขออัปเดต

หากต้องการอัปเดตตัวแทน ให้เรียกใช้คําสั่งต่อไปนี้ แทนที่ตัวแปรด้วยค่าที่คุณระบุในข้อกําหนดเบื้องต้น

หากคุณมีทั้งบ็อตและการรับส่งข้อความกับมนุษย์ ให้ระบุความพร้อมของบ็อตใน 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