Google Business Messages는 2024년 7월 31일에 지원 중단됩니다.
자세히 알아보기
웹훅 설정
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
<ph type="x-smartling-placeholder">
웹훅은 파트너가 생성한 HTTPS 콜백으로 에이전트의 작동 방식을 지정합니다.
메시지와 이벤트에 응답해야 합니다 사전 빌드된 자동화된
Dialogflow 같은 솔루션을
커스텀 웹훅을 설정하여 에이전트의 동작을 정의해야 합니다.
파트너 수준 및 에이전트 수준 웹훅
파트너 수준 또는 상담사 수준에서 웹훅을 설정할 수 있습니다.
파트너 수준 웹훅은 유지관리하는 모든 상담사에게 적용되지만 상담사 수준은
각각 하나의 개별 에이전트에 적용됩니다.
행동이 각기 다른 여러 상담사를 운영하는 경우
각 에이전트에 서로 다른 웹훅을 설정할 수 있습니다. 다른 한쪽에는
상담사의 행동이 비슷한 경우 또는 상담사가 한 명뿐인 경우
파트너 수준 웹훅을 사용할 수 있습니다
파트너 수준 웹훅과 에이전트 수준 웹훅을 모두 구성한 경우
에이전트 수준 웹훅이 특정 에이전트에 우선하는 반면
파트너 수준 웹훅은 상담사 수준이 없는 상담사에게 적용됩니다.
웹훅을 설정할 수도 있습니다
파트너 수준 웹훅 설정
파트너 수준 웹훅을 설정하려면 다음 단계를 따르세요.
- 비즈니스 커뮤니케이션 개발자 콘솔을 엽니다.
Business Messages Google 계정으로 로그인합니다.
- 계정 설정을 엽니다.
- 올바른 파트너 계정을 선택했는지 확인합니다.
- Business Messages 웹훅 URL에서 구성을 클릭합니다.
- 웹훅 엔드포인트 URL에 애플리케이션의 URL과 '/callback/'을 함께 입력합니다.
예를 들어 'https://PROJECT_ID.appspot.com/callback/'과 같은 형태일 수 있습니다.
clientToken
값을 기록합니다. 이를 통해 받은 메시지가 Google에서 보낸 것인지 확인해야 합니다.
지정된
clientToken
매개변수를 사용하고 일반 텍스트와 함께 200 OK
응답을 전송합니다.
보안 비밀 매개변수의 값을 응답 본문으로 사용합니다. 예를 들어
웹훅은 다음 본문 콘텐츠가 포함된 POST 요청을 수신합니다.
{
"clientToken":"SJENCPGJESMGUFPY",
"secret":"0123456789"
}
이 경우 웹훅은 clientToken
값을 확인해야 합니다.
clientToken
이 올바르면 0123456789
이 포함된 200 OK
응답을 반환합니다.
응답 본문입니다.
콘솔에서 확인을 클릭합니다. Business Messages에서 웹훅을 확인하면
대화상자가 닫힙니다
에이전트 수준 웹훅 설정
파트너 수준 웹훅에서 에이전트에 전송된 메시지를 수신합니다. 만약
특정 에이전트의 메시지가 다른 웹훅으로 전달되도록 하려면
에이전트 수준 웹훅을 설정할 수 있습니다
- 비즈니스 커뮤니케이션 개발자 콘솔을 엽니다.
Business Messages Google 계정으로 로그인합니다.
- 에이전트를 클릭합니다.
- 통합을 클릭합니다.
- Webhook(웹훅)에서 Configure(구성)를 클릭합니다.
- 웹훅 엔드포인트 URL에
'https://'.
clientToken
값을 기록합니다. Google에서 보낸 메시지가 제대로 전송되었는지
Google에서 수신하는 사용자 수
지정된
clientToken
매개변수를 생성하고 200 OK 응답을
보안 비밀 매개변수를 사용하세요. 예를 들어 웹훅이 POST 요청을 수신한다고 가정하겠습니다.
다음 본문 내용 포함:
{
"clientToken":"SJENCPGJESMGUFPY",
"secret":"0123456789"
}
이 경우 웹훅은 clientToken
값을 확인해야 합니다.
clientToken
이(가) 정답입니다. 보안 비밀 URL이 포함된 200 OK
응답을 반환하세요.
매개변수를 0123456789
로 설정합니다.
콘솔에서 확인을 클릭합니다. Business Messages에서 웹훅을 확인하면
대화상자가 닫힙니다
달리 명시되지 않는 한 이 페이지의 콘텐츠에는 Creative Commons Attribution 4.0 라이선스에 따라 라이선스가 부여되며, 코드 샘플에는 Apache 2.0 라이선스에 따라 라이선스가 부여됩니다. 자세한 내용은 Google Developers 사이트 정책을 참조하세요. 자바는 Oracle 및/또는 Oracle 계열사의 등록 상표입니다.
최종 업데이트: 2024-10-14(UTC)
[null,null,["최종 업데이트: 2024-10-14(UTC)"],[[["\u003cp\u003eA webhook defines how your agent responds to messages and events, and should be set at either the partner or agent level, depending on your needs.\u003c/p\u003e\n"],["\u003cp\u003ePartner-level webhooks apply to all agents under your account, whereas agent-level webhooks are specific to individual agents and take precedence.\u003c/p\u003e\n"],["\u003cp\u003eTo set a webhook, you provide an endpoint URL, obtain a clientToken for verification, and configure your webhook to handle verification requests from Google.\u003c/p\u003e\n"],["\u003cp\u003eThe verification process involves receiving a POST request with a clientToken and secret, validating the clientToken, and responding with a 200 OK and the secret value.\u003c/p\u003e\n"],["\u003cp\u003eYou can set up your webhook using either the Business Communications Developer Console or the API.\u003c/p\u003e\n"]]],[],null,["# Set your webhook\n\n| Choose whether to set your webhook with the Business Communications [Developer\n| Console](https://business-communications.cloud.google.com?utm_source=/business-communications/business-messages/guides/how-to/agents/set-webhook&utm_medium=devsite&utm_campaign=business-messages) or [API](/business-communications/business-messages/reference/business-communications/rest). \n| Developer Console API\n\nA webhook is a partner-created HTTPS callback that specifies how your agent\nshould respond to messages and events. Unless you're using a pre-built automated\nsolution like [Dialogflow](/business-communications/business-messages/guides/how-to/integrate/dialogflow#dialogflow_integration),\nyou need to set a custom webhook to define the behavior for your agent.\n\nPartner-level and agent-level webhooks\n--------------------------------------\n\nYou can set your webhook either at the partner level or at the agent level.\nPartner-level webhooks apply to every agent you maintain, while agent-level\nwebhooks each apply to one individual agent.\n\nIf you operate multiple agents with distinct behavior, you may wish to set a\ndifferent webhook for each agent using the agent-level setting. On the other\nhand, if your agents have similar behavior, or if you only have one agent, you\ncan use the partner-level webhook.\n\nIf you have both a partner-level webhook and an agent-level webhook configured,\nthe agent-level webhook takes precedence on its specific agent, while the\npartner-level webhook applies to agents that don't have an agent-level\nwebhook.\n\nSet your partner-level webhook\n------------------------------\n\nTo set your partner-level webhook, follow these steps:\n\n1. Open the [Business Communications Developer Console](https://business-communications.cloud.google.com?utm_source=/business-communications/business-messages/guides/how-to/agents/set-webhook&utm_medium=devsite&utm_campaign=business-messages) and sign in with your Business Messages Google account.\n2. Open the [Account settings](https://business-communications.cloud.google.com/console/partner/settings?utm_source=/business-communications/business-messages/guides/how-to/set-webhook&utm_medium=devsite&utm_campaign=business-messages).\n3. Make sure the correct partner account is selected.\n4. For **Business Messages webhook URL** , click **Configure**.\n5. For **Webhook endpoint URL**, enter your application's URL + \"/callback/\". For example, it might be something like \"https://PROJECT_ID.appspot.com/callback/\".\n6. Note your `clientToken` value. You need it to [verify that messages you receive are coming from Google](/business-communications/business-messages/guides/how-to/message/receive#verify).\n7. Configure your webhook to accept a POST request with the specified\n `clientToken` parameter and send a `200 OK` response with the plain text\n value of the secret parameter as the response body. For example, suppose your\n webhook receives a POST request with the following body content:\n\n {\n \"clientToken\":\"SJENCPGJESMGUFPY\",\n \"secret\":\"0123456789\"\n }\n\n In that case, your webhook should confirm the `clientToken` value and, if\n `clientToken` is correct, return a `200 OK` response with `0123456789` as the\n response body.\n8. In the console, click **Verify**. When Business Messages verifies your webhook,\n the dialog closes.\n\nSet an agent-level webhook\n--------------------------\n\nYou receive messages sent to your agent at your partner-level webhook. If you\nwant messages for a specific agent to arrive at a different webhook instead, you\ncan set an agent-level webhook.\n\n1. Open the [Business Communications Developer Console](https://business-communications.cloud.google.com?utm_source=/business-communications/business-messages/guides/how-to/agents/set-webhook&utm_medium=devsite&utm_campaign=business-messages) and sign in with your Business Messages Google account.\n2. Click your agent.\n3. Click **Integrations**.\n4. For **Webhook** , click **Configure**.\n5. For **Webhook endpoint URL**, enter your webhook's URL, beginning with \"https://\".\n6. Note your `clientToken` value. You need it to [verify that messages you\n receive are coming from Google](/business-communications/business-messages/guides/how-to/message/receive#verify).\n7. Configure your webhook to accept a POST request with the specified\n `clientToken` parameter and send a 200 OK response with the value of the\n secret parameter. For example, suppose your webhook receives a POST request\n with the following body content:\n\n {\n \"clientToken\":\"SJENCPGJESMGUFPY\",\n \"secret\":\"0123456789\"\n }\n\n In that case, your webhook should confirm the `clientToken` value and, if\n `clientToken` is correct, return a `200 OK` response with the secret URL\n parameter set to `0123456789`.\n8. In the console, click **Verify**. When Business Messages verifies your webhook,\n the dialog closes."]]