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

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

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

ความพร้อมใช้งานของบ็อตและตัวแทนที่เป็นบุคคล

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

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

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

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

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

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

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

เมื่ออัปเดตช่องเหล่านี้ คุณต้องระบุค่าสำหรับทุกช่องในออบเจ็กต์ SupportedAgentInteraction คำขออัปเดตจะเขียนทับเนื้อหาของทุกช่องที่คุณแก้ไข รวมถึงช่องย่อย เช่น หากคุณส่งคำขอเพิ่มอินสแตนซ์ลงใน 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