# 웹훅 통합 샘플

웹훅을 사용하면 분석, CRM 시스템, 마케팅 자동화 서비스 등 거의 모든 다른 서비스와 고객 여정 데이터를 공유할 수 있습니다. 예를 들어, 고객이 여정 내에서 특정 작업을 수행했을 때 외부 서비스에 자동으로 알리거나, 고객 데이터를 분석 도구로 보내거나, 특정 여정 내 이벤트에 대해 타사 이메일, SMS 또는 WhatsApp 메시지를 트리거할 수 있습니다. 사용 사례는 매우 다양하므로 자신에게 맞는 것을 선택하세요. [Customer Journeys의 웹훅 요소에 대해 자세히 알아보기](/ko/product/customer-journey/journey-elements#webhook)

이 게시물에서는 다양한 사용 사례 및 서비스에 대해 웹훅을 구현하는 방법을 보여줍니다.

## Mixpanel

### 사용 사례

여정에서 Mixpanel로 이벤트 데이터를 전송합니다.

### 전제 조건

* Mixpanel 계정 및 프로젝트 ID
* [서비스 계정](https://developer.mixpanel.com/reference/authentication#service-accounts)

수집 API용 웹훅 ([https://developer.mixpanel.com/reference/events](https://developer.mixpanel.com/reference/events)):

### URL 예시

`https://api.mixpanel.com/import?strict=1&project_id=XXXXXXX`

```
Authorization: Basic UHVzaHdvb3NVTTWlrcjROZUE=
Content-Type: application/json
```

### 데이터 예시

```
[
  {
    "event": "PW_ApplicationOpen",
    "properties": {
        "time": "{{point:48ae746b-0f54-47db-b96c-1f082e110ff4;event:PW_ApplicationOpen;attribute:datetime}}",
        "distinct_id": "{{device:hwid}}",
        "$insert_id": "48ae746b-0f54-47db-b96c-1f082e110ff4",
        "device_type": "{{point:48ae746b-0f54-47db-b96c-1f082e110ff4;event:PW_ApplicationOpen;attribute:device_type}}",
        "application_version": "{{point:48ae746b-0f54-47db-b96c-1f082e110ff4;event:PW_ApplicationOpen;attribute:application_version}}",
        "timezone": "{{tag:Timezone}}",
        "name": "{{tag:Name}}"
    }
  }
]
```

## Amplitude

### 사용 사례

여정에서 Amplitude로 이벤트 데이터를 전송합니다.

### 전제 조건

* Amplitude 계정

수집 API용 웹훅 ([https://developers.amplitude.com/docs/http-api-v2#request-format](https://developers.amplitude.com/docs/http-api-v2#request-format)):

### URL

`https://api.amplitude.com/2/httpapi`

```
Accept: */*Content-Type: application/json
```

### 데이터 예시

```
{
  "api_key": "c506ffde6db9xxxxxxa50120e22ec5",
  "events": [
    {
      "user_id": "{{device:user_id}}",
      "device_id": "{{device:hwid}}",
      "event_type": "PW_ApplicationOpen",
      "user_properties": {"timezone": "{{tag:Timezone}}", "sdk_version": "{{tag:SDK Version}}"},
      "country": "{{tag:Country}}"
    }
  ]
}
```

## Slack

### 사용 사례

여정에서 Slack 메시지를 트리거합니다.

### 전제 조건

* Slack 계정

### URL 예시

`https://pushwoosh.slack.com/apps/XXXXXXXX-incoming-webhooks`

```
Content-Type: application/json
```

### 데이터 예시

```json
{
"text": "Hi there :smile:",
"username": "John Doe"
}
```

## Zapier

### 사용 사례

Zapier로 데이터를 전송하여 4000개 이상의 앱에서 Zapier 자동화에 추가로 사용할 수 있습니다.

### 전제 조건

* Zapier 계정

### URL 예시

`https://hooks.zapier.com/hooks/catch/XXXXXXX/xxxxxxx`

```
Content-Type: application/json
```

### 데이터 예시

```json
{
  "hwid": "{{device:hwid}}",
  "sdk": "{{tag:SDK Version}}"
}
```

## Twilio (SMS)

### 사용 사례

여정에서 SMS 보내기

### 전제 조건

* Twilio 계정 (TWILIO\_ACCOUNT\_SID 및 TWILIO\_AUTH\_TOKEN에 대한 액세스 권한)
* 구매한 전화번호

### URL 예시

`https://api.twilio.com/2010-04-01/Accounts/\$TWILIO_ACCOUNT_SID/Messages.json`

```text
Content-Type: application/x-www-form-urlencoded
Authorization: Basic.... // https://www.blitter.se/utils/basic-authentication-header-generator/를 사용하여 TWILIO_ACCOUNT_SID 및 TWILIO_AUTH_TOKEN을 인코딩하여 인증 값을 얻습니다
```

### 데이터 예시

```text
From=%2B18646511557&To=%2B15852826356&Body=...
```