메시지 사용 가능 여부 설정

사용자가 에이전트와 대화를 시작하려면 먼저 Business Messages에서 에이전트의 메시지 사용 가능 여부를 설정해야 합니다.

사용자가 근무 시간 동안 에이전트에게 메시지를 보내면 에이전트는 환영 메시지와 대화 시작 문구로 사용자에게 인사합니다. 대화가 가능한 시간이 아닌 시간에 시작되면 에이전트의 오프라인 메시지가 사용자에게 표시됩니다. 이러한 메시지에 대한 자세한 내용은 대화 시작하기를 참고하세요.

봇 및 사용자 지원 여부

봇과 인간의 대표 가용성을 별도로 지정할 수 있습니다.

에이전트의 메시지를 작성하는 모든 종류의 자동화가 있는 경우(자동화가 큐에서 사용자에게 자신의 위치를 알려주는 자동 응답이든, 사용자 세부정보에 동적으로 액세스할 수 있는 복잡한 자연어 이해 에이전트든, 또는 그 사이의 모든 내용이든) 봇 메시지 가용성을 지정할 수 있습니다.

위치 기반 진입점로컬이 아닌 진입점 (Google Ads 제외) 등 Google에서 관리하는 진입점에서 상담사를 시작하려는 경우 직원의 참석 여부가 필수입니다. 상담사의 문의 가능 시간을 확인하려면 상담사가 질문에 답변할 수 있는 요일과 시간만 지정하세요.

봇 담당자가 오전 8시부터 오후 8시까지 연중무휴로 일하는 경우 이들을 독립적으로 지정할 수 있습니다.

또한 봇과 상담사의 가용성을 모두 지정하는 경우 봇 담당자가 요구사항을 충족할 수 없는 경우 사용자에게 실시간 에이전트를 요청하라는 메시지를 표시하는 실시간 에이전트 요청 추천을 보낼 수 있습니다.

메시지 사용 가능 여부 업데이트

메시지 사용 가능 여부를 업데이트하려면 Business Communications API로 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.patchSupportedAgentInteraction를 참고하세요.