메시지 사용 가능 여부 설정

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

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

봇 및 사람 가용성

봇과 사람 상담사의 응대 가능 여부를 별도로 지정할 수 있습니다.

자동화가 사용자에게 대기열에서의 위치를 알려주는 자동 응답기이든, 사용자 세부정보에 동적으로 액세스할 수 있는 복잡한 자연어 이해 에이전트이든, 그 사이의 어떤 것이든 상담사를 위해 메시지를 작성하는 자동화가 있는 경우 봇 메시지 사용 가능 여부를 지정하세요.

위치 기반 진입점비지역 진입점 (Google Ads 제외)을 비롯한 Google 관리 진입점에서 에이전트를 실행하려면 사람이 응답할 수 있어야 합니다. 사람의 응대 가능 여부의 경우 질문에 답변할 수 있는 실시간 상담사가 있는 요일과 시간만 지정하세요.

봇 상담사는 24시간 이용 가능하지만 실제 상담사는 오전 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을 참고하세요.