이 페이지는 AI로 자동 번역되었으며 부정확한 내용이 포함될 수 있습니다. 번역 오류를 신고하려면 페이지 오른쪽 목차 아래에 있는 피드백 기능을 사용하세요.
웹훅 객체
webhook객체를 사용하면 메시징 엔드포인트를 통해 웹훅 메시지를 수정하거나 생성할 수 있습니다.
{
"url": (required, string),
"request_method": (required, string) one of "POST", "PUT", "DELETE", or "GET",
"request_headers": (optional, Hash) key-value pairs to use as request headers,
"body": (optional, string or JSON object) payload Braze sends in the webhook request. Pass a JSON object, or a string that contains your payload. If you pass a string that includes JSON, escape quotes and backslashes so the outer messaging request remains valid JSON,
"message_variation_id": (optional, string) used when providing a campaign_id to specify which message variation this message should be tracked under
}
모범 사례로서 Braze는 발신자와 서버가 시간이 지남에 따라 변경될 수 있으므로 일관되고 예측 가능한 동작을 위해 request_headers 필드에 Content-Type의 명시적인 값을 제공할 것을 권장합니다. Content-Type 헤더에 값을 지정하지 않으면 시스템이 요청 본문에서 값을 유추합니다.
JSON 본문을 포함하는 웹훅 객체 예시
body 필드는 아웃바운드 웹훅의 페이로드를 담고 있습니다. 페이로드가 JSON인 경우, JSON 객체로 전달하거나 동일한 JSON을 포함하는 문자열로 전달할 수 있습니다.
다음 두 가지 웹훅 객체는 모두 동일한 페이로드를 https://example.com/hooks/braze로 전송합니다.
body에 JSON 객체 사용
Braze는 body에 JSON 객체를 허용하며, 웹훅을 전송하기 전에 이를 직렬화합니다.
{
"url": "https://example.com/hooks/braze",
"request_method": "POST",
"request_headers": {
"Content-Type": "application/json"
},
"body": {
"user_id": "12345",
"event": "purchase",
"properties": {
"product": "sneakers",
"price": 99.99
}
}
}
body에 JSON 문자열 사용
body를 문자열로 전달하는 경우, 먼저 내부 JSON을 구성한 다음 큰따옴표와 백슬래시를 이스케이프 처리하여 외부 메시징 요청이 유효한 JSON으로 유지되도록 합니다.
{
"user_id": "12345",
"event": "purchase",
"properties": {
"product": "sneakers",
"price": 99.99
}
}
위 객체는 다음과 같이 이스케이프 처리된 body의 문자열 값이 됩니다.
{
"url": "https://example.com/hooks/braze",
"request_method": "POST",
"request_headers": {
"Content-Type": "application/json"
},
"body": "{\"user_id\":\"12345\",\"event\":\"purchase\",\"properties\":{\"product\":\"sneakers\",\"price\":99.99}}"
}

참고
배열 및 기타 객체나 문자열이 아닌 값은 body에 사용할 수 없습니다. 객체 또는 문자열을 전달하세요.
New Stuff!