# 대행사 수신서버 URL

## Request

## 대행사에서 등록한 수신서버 URL을 통해 RBC에서 발생하는 데이터의 등록/수정/삭제 이벤트 정보를 전달합니다.<br>

> 대행사에서 등록한 수신서버 URL을 통해 RBC에서 발생하는 데이터의 등록/수정/삭제 이벤트 정보를 전달합니다.  \
> 등록/수정/삭제 알림 대상은 다음과 같습니다.  \
> &#x20; \+ 브랜드 계약(권한) 등록  \
> &#x20; \+ 브랜드 수정/반려  \
> &#x20; \+ 대화방 승인/수정/반려/삭제  \
> &#x20; \+ 템플릿 승인/수정/반려/삭제  \
> &#x20; \+ 자동응답메시지 등록/수정/삭제  \
> &#x20; \+ 신규 포멧/템플릿 상품 등록  \
> &#x20; \+ 대행사 키 재발급\
> &#x20; \+ 레아아웃 등록/수정/삭제\
> &#x20; \+ 로고 승인/수정/반려/삭제<br>

```json
{"openapi":"3.0.0","info":{"title":"RCS Biz Center API 규격","version":"1.1.12"},"servers":[{"description":"RCS Biz Center API for Staging","url":"https://api-qa.rcsbizcenter.com/api/1.1"},{"description":"RCS Biz Center API for Production","url":"https://api.rcsbizcenter.com/api/1.1"}],"security":[{"jwtAuth":[]}],"components":{"securitySchemes":{"jwtAuth":{"type":"http","scheme":"bearer","bearerFormat":"JWT","description":"인증방식은 JWT인증을 사용합니다. 토큰의 갱신은 없으며 토큰 만료 시 항상 재발급 받아야 합니다.\n"}},"parameters":{"WebhookUrl":{"name":"webhookUrl","in":"path","schema":{"type":"string"},"required":true,"description":"RBC에 등록된 대행사 계정 정보 상에 대행사가 직접 등록한 수신서버(Webhook) URL 정보입니다.\n"}},"schemas":{"NotiContract":{"description":"브랜드 운영 권한 Notification 입니다.\n","type":"object","required":["notiType"],"properties":{"notiType":{"type":"string","default":"contract"},"corpId":{"type":"string"},"corpRegNum":{"type":"string"},"brandId":{"type":"string"},"method":{"description":"대상별 처리 정보를 제공합니다.  \n\n  - rejected: 반려\n  - created: 승인 또는 신규등록\n  - modified: 수정\n  - deleted: 삭제\n","type":"string","enum":["rejected","created","modified","deleted"]},"reason":{"description":"\"method가 rejected 인 경우 사유를 제공합니다.\"\n","type":"string"}}},"NotiChatbot":{"description":"대화방 Notification 입니다.\n","type":"object","required":["notiType"],"properties":{"notiType":{"type":"string","default":"chatbot"},"brandId":{"type":"string"},"chatbotId":{"type":"string"},"method":{"description":"대상별 처리 정보를 제공합니다.  \n\n  - rejected: 반려\n  - created: 승인 또는 신규등록\n  - modified: 수정\n  - deleted': 삭제\n","type":"string","enum":["rejected","created","modified","deleted"]},"reason":{"description":"method가 rejected 인 경우 사유를 제공합니다.\n","type":"string"}}},"NotiMessagebaseForm":{"description":"템플릿 양식 Notification 입니다.  \n","type":"object","required":["notiType"],"properties":{"notiType":{"type":"string","default":"messagebaseform"},"messagebaseformId":{"type":"string"},"method":{"description":"대상별 처리 정보를 제공합니다.  \n\n  - rejected: 반려\n  - created: 승인 또는 신규등록\n  - modified: 수정\n  - deleted': 삭제\n","type":"string","enum":["rejected","created","modified","deleted"]},"reason":{"description":"\"method가 rejected 인 경우 사유를 제공합니다.\"\n","type":"string"}}},"NotiTemplate":{"description":"템플릿 Notification 입니다.  \n","type":"object","required":["notiType"],"properties":{"notiType":{"type":"string","default":"template"},"brandId":{"type":"string"},"messagebaseformId":{"type":"string"},"messagebaseId":{"type":"string"},"method":{"description":"대상별 처리 정보를 제공합니다.  \n\n  - rejected: 반려\n  - created: 승인 또는 신규등록\n  - modified: 수정\n  - deleted': 삭제\n","type":"string","enum":["rejected","created","modified","deleted"]},"reason":{"description":"method가 rejected 인 경우 사유를 제공합니다.\n","type":"string"}}},"NotiFormat":{"description":"포맷 Notification 입니다.  \n","type":"object","required":["notiType"],"properties":{"notiType":{"type":"string","default":"format"},"messagebaseformId":{"type":"string"},"messagebaseId":{"type":"string"},"method":{"description":"대상별 처리 정보를 제공합니다.  \n\n  - rejected: 반려\n  - created: 승인 또는 신규등록\n  - modified: 수정\n  - deleted': 삭제\n","type":"string","enum":["rejected","created","modified","deleted"]},"reason":{"description":"\"method가 rejected 인 경우 사유를 제공합니다.\"\n","type":"string"}}},"NotiBrand":{"description":"브랜드 Notification 입니다.\n","type":"object","required":["notiType"],"properties":{"notiType":{"type":"string","default":"brand"},"brandId":{"type":"string"},"method":{"description":"대상별 처리 정보를 제공합니다.  \n\n  - rejected: 반려\n  - modified: 수정\n","type":"string","enum":["rejected","modified"]},"reason":{"description":"method가 rejected 인 경우 사유를 제공합니다.\n","type":"string"}}},"NotiAutoReplyMsg":{"description":"자동응답 메시지 Notification 입니다.  \n","type":"object","required":["notiType"],"properties":{"notiType":{"type":"string","default":"autoreplymsg"},"brandId":{"type":"string"},"autoReplyMsgId":{"type":"string"},"method":{"description":"대상별 처리 정보를 제공합니다.  \n\n  - created: 신규등록 \n  - modified': 수정\n  - deleted: 삭제\n","type":"string","enum":["created","modified","deleted"]},"reason":{"description":"method가 rejected 인 경우 사유를 제공합니다.\n","type":"string"}}},"NotiAgencyKey":{"type":"object","description":"대행사 키가 재발급된 경우에 한하여 전달됩니다. 삭제 시에는 전송되지 않습니다.","required":["notiType","agencyKey"],"properties":{"notiType":{"description":"webhook 알림 타입 구분값 입니다.","type":"string","default":"agencykey"},"agencyKey":{"description":"재발급으로 새로 생성된 agencyKey 입니다.\n","type":"string"},"method":{"description":"대상별 처리 정보를 제공합니다.\n\n  - created: 재발급으로 새로운 agencyKey가 생성된 경우 표시됩니다.\n","type":"string","enum":["created"]},"date":{"description":"재발급 일시입니다..\n","type":"string"},"userName":{"description":"대행사 키를 재발급한 대행사 담당자의 이름입니다.\n","type":"string"}}},"NotiFormatBr":{"description":"브랜드 포맷(레이아웃) Notification 입니다.  \n","type":"object","required":["notiType"],"properties":{"notiType":{"type":"string","default":"formatbr"},"brandId":{"type":"string"},"messagebaseId":{"type":"string"},"method":{"description":"대상별 처리 정보를 제공합니다.  \n  - created: 승인 또는 신규등록\n  - modified': 수정\n  - deleted: 삭제\n","type":"string","enum":["rejected","created","modified","deleted"]},"reason":{"description":"method가 rejected 인 경우 사유를 제공합니다.\n","type":"string"}}},"NotiLogo":{"description":"브랜드 로고 Notification 입니다.  \n","type":"object","required":["notiType"],"properties":{"notiType":{"type":"string","default":"logo"},"brandId":{"type":"string"},"fileId":{"type":"string"},"method":{"description":"대상별 처리 정보를 제공합니다.\n\n  - created: 승인 또는 신규등록\n  - rejected: 반려\n  - modified: 수정\n  - deleted': 삭제\n","type":"string","enum":["rejected","created","modified","deleted"]},"reason":{"description":"method가 rejected 인 경우 사유를 제공합니다.\n","type":"string"}}}}},"paths":{"/{webhookUrl}":{"post":{"summary":"대행사에서 등록한 수신서버 URL을 통해 RBC에서 발생하는 데이터의 등록/수정/삭제 이벤트 정보를 전달합니다.\n","description":"대행사에서 등록한 수신서버 URL을 통해 RBC에서 발생하는 데이터의 등록/수정/삭제 이벤트 정보를 전달합니다.  \n등록/수정/삭제 알림 대상은 다음과 같습니다.  \n  + 브랜드 계약(권한) 등록  \n  + 브랜드 수정/반려  \n  + 대화방 승인/수정/반려/삭제  \n  + 템플릿 승인/수정/반려/삭제  \n  + 자동응답메시지 등록/수정/삭제  \n  + 신규 포멧/템플릿 상품 등록  \n  + 대행사 키 재발급\n  + 레아아웃 등록/수정/삭제\n  + 로고 승인/수정/반려/삭제\n","parameters":[{"$ref":"#/components/parameters/WebhookUrl"}],"requestBody":{"description":"notiType에 설정된 다음의 대상 정보를 구분하여 Object를 제공합니다.\n\n  - contract: 브랜드 계약              \n  - chatbot: 대화방              \n  - messagebaseform: 템플릿 양식              \n  - template: 템플릿              \n  - format: 포멧(이통 제공 공통템플릿)              \n  - brand: 브랜드              \n  - autoreplymsg: 자동응답메시지              \n  - agencykey: 대행사 키\n  - formatbr: 브랜드에 등록된 레이아웃으로 만든 포멧  \n  - logo: 브랜드 로고\n","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/NotiContract"},{"$ref":"#/components/schemas/NotiChatbot"},{"$ref":"#/components/schemas/NotiMessagebaseForm"},{"$ref":"#/components/schemas/NotiTemplate"},{"$ref":"#/components/schemas/NotiFormat"},{"$ref":"#/components/schemas/NotiBrand"},{"$ref":"#/components/schemas/NotiAutoReplyMsg"},{"$ref":"#/components/schemas/NotiAgencyKey"},{"$ref":"#/components/schemas/NotiFormatBr"},{"$ref":"#/components/schemas/NotiLogo"}],"discriminator":{"propertyName":"notiType"}}}}},"responses":{"200":{"description":"페이지 내 Response 섹션 참조"}}}}}}
```

### ❖ request body sample

{% tabs %}
{% tab title="브랜드계약" %}

```
{
      "notiType": "contract",
      "method": "created",
      "reason": ""
      "corpId": "CO.l9ZohLN20I",
      "corpRegNum": 3148158360
      "brandId": "BR.i3gC1762pT"
}
```

{% endtab %}

{% tab title="대화방" %}

```
{
      "notiType": "chatbot",
      "method": "created",
      "reason": ""
      "corpId": "CO.l9ZohLN20I",
      "corpRegNum": 3148158360
      "brandId": "BR.i3gC1762pT"
}
```

{% endtab %}

{% tab title="템플릿양식" %}

```
{
      "notiType": "messagebaseform",
      "method": "created",
      "reason": ""
      "corpId": "CO.l9ZohLN20I",
      "corpRegNum": 3148158360
      "brandId": "BR.i3gC1762pT"
}
```

{% endtab %}

{% tab title="템플릿" %}

```
{
      "notiType": "template",
      "method": "created",
      "reason": ""
      "corpId": "CO.l9ZohLN20I",
      "corpRegNum": 3148158360
      "brandId": "BR.i3gC1762pT"
}
```

{% endtab %}

{% tab title="포멧" %}

```
{
      "notiType": "format",
      "method": "created",
      "reason": ""
      "corpId": "CO.l9ZohLN20I",
      "corpRegNum": 3148158360
      "brandId": "BR.i3gC1762pT"
}
```

{% endtab %}

{% tab title="브랜드" %}

```
{
      "notiType": "brand",
      "method": "created",
      "reason": ""
      "corpId": "CO.l9ZohLN20I",
      "corpRegNum": 3148158360
      "brandId": "BR.i3gC1762pT"
}
```

{% endtab %}

{% tab title="자동응답" %}

```
{
      "notiType": "autoreplymsg",
      "method": "created",
      "reason": ""
      "corpId": "CO.l9ZohLN20I",
      "corpRegNum": 3148158360
      "brandId": "BR.i3gC1762pT"
}
```

{% endtab %}

{% tab title="대행사키" %}

```
{
      "notiType": "agencykey",
      "method": "created",
      "reason": ""
      "corpId": "CO.l9ZohLN20I",
      "corpRegNum": 3148158360
      "brandId": "BR.i3gC1762pT"
}
```

{% endtab %}

{% tab title="레이아웃" %}

```
{
      "notiType": "formatbr",
      "method": "created",
      "reason": ""
      "corpId": "CO.l9ZohLN20I",
      "corpRegNum": 3148158360
      "brandId": "BR.i3gC1762pT"
}
```

{% endtab %}

{% tab title="로고" %}

```
{
      "notiType": "logo",
      "method": "created",
      "reason": ""
      "corpId": "CO.l9ZohLN20I",
      "corpRegNum": 3148158360
      "brandId": "BR.i3gC1762pT"
}
```

{% endtab %}
{% endtabs %}

## Response

<table data-full-width="true"><thead><tr><th width="147">필드명</th><th width="141">타입</th><th width="68" align="center">길이</th><th width="108" align="center">필수여부</th><th width="88">기본값</th><th>설명</th></tr></thead><tbody><tr><td><strong><code>status</code></strong></td><td>string</td><td align="center"></td><td align="center">O</td><td></td><td>200 : 성공적으로 알림을 수신하였을 경우 응답합니다.<br>400 : 대행사 측 청약이 우선 처리되지 않은 상태에서 'contract'가 전달된 경우 필히 응답되어야 합니다.</td></tr><tr><td><a href="#error-object"><mark style="color:blue;"><strong><code>error</code></strong></mark></a></td><td>object</td><td align="center"></td><td align="center"></td><td></td><td></td></tr></tbody></table>

### <mark style="color:blue;">error</mark> - object

<table data-full-width="true"><thead><tr><th width="147">필드명</th><th width="141">타입</th><th width="68" align="center">길이</th><th width="108" align="center">필수여부</th><th width="84">기본값</th><th>설명</th></tr></thead><tbody><tr><td><strong><code>code</code></strong></td><td>string</td><td align="center"></td><td align="center"></td><td></td><td></td></tr><tr><td><strong><code>message</code></strong></td><td>string</td><td align="center"></td><td align="center"></td><td></td><td></td></tr></tbody></table>

### ❖ response body sample

{% tabs %}
{% tab title="200" %}

```
{
  "status": "200",
  "error": {
    "code": "",
    "message": ""
  }
}
```

{% endtab %}

{% tab title="400" %}

```
{
  "status": "400",
  "error": {
    "code": "69999",
    "message": "No Subscription"
  }
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
error code는 [RCS Biz Center - Response body error code](https://apidocs.rcsbizcenter.com/error_code#rcs-biz-center-response-body-error-code) 참조
{% endhint %}
