# 양방향 중계사 수신서버 URL

## Request

## 양방향 서비스 제공 중계사에서 구현해야 하는 Webhook URI 입니다.<br>

> 양방향 서비스 제공 중계사에서 구현해야 하는 Webhook URI 입니다.\
> \
> RBC 대행사 정보의 수신서버 URL하위에 bidirctional 경로를 구현 제공해야 합니다.  \
> \
> 양방향 서비스 제공 중계사는 RBC에 등록되는 대행사의 양방향 메시지 중계사 지정, 양방향 대화방 등록, 대화방 메뉴 사용 시\
> 청약 여부와 같이 양방향 서비스 제공을 위해 필수 정보 연동이 필요합니다.  <br>

```json
{"openapi":"3.0.0","info":{"title":"RCS Biz Center API 규격","version":"1.1.15"},"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":{"NotiBidirectional":{"description":"양방향 서비스와 관련된 양방향 중계사 전용 Notification 입니다.  \n","type":"object","required":["notiType"],"properties":{"notiType":{"type":"string","enum":["appointment","registration","subscription","persistentmenu"],"description":"+ appointment: 일반 대행사가 양방향 서비스 중계사 지정 알림\n+ registration: 양방향 대화방 등록 알림\n+ subscription: 대화방메뉴 사용 청약 확인 요청\n+ persistentmenu: 대화방메뉴 등록 알림\n"},"value":{"type":"object","properties":{"agencyCorpRegNum":{"type":"string","maxLength":10,"description":"maxLength: 10 - 대행사 사업자등록번호\n"},"agencyId":{"type":"string","maxLength":20,"description":"maxLength: 20 - 대행사 ID\n"},"brandId":{"type":"string","maxLength":13,"description":"maxLength: 13 - 브랜드 ID\n"},"brandKey":{"type":"string","maxLength":18,"description":"maxLength: 18 - 브랜드 Key\n"},"chatbotId":{"type":"string","maxLength":15,"description":"maxLength: 15 - 대화방 ID\n"},"corpRegNum":{"type":"string","maxLength":10,"description":"maxLength: 10 - 기업 사업자등록번호\n"}}}}}}},"paths":{"/{webhookUrl}/bidirectional":{"post":{"summary":"양방향 서비스 제공 중계사에서 구현해야 하는 Webhook URI 입니다.\n","description":"양방향 서비스 제공 중계사에서 구현해야 하는 Webhook URI 입니다.\n\nRBC 대행사 정보의 수신서버 URL하위에 bidirctional 경로를 구현 제공해야 합니다.  \n\n양방향 서비스 제공 중계사는 RBC에 등록되는 대행사의 양방향 메시지 중계사 지정, 양방향 대화방 등록, 대화방 메뉴 사용 시\n청약 여부와 같이 양방향 서비스 제공을 위해 필수 정보 연동이 필요합니다.  \n","parameters":[{"$ref":"#/components/parameters/WebhookUrl"}],"requestBody":{"description":"notiType에 설정된 다음의 대상 정보를 구분하여 Object를 제공합니다.  \n\npersistentmenu는 registration의 의미를 포함하고 있습니다.  \n\n예를 들어, A중계사로 지정되어 있던 대화방메뉴를 갖는 양방향 대화방의 중계사를 B중계사로 변경한 경우, B중계사는\nregistration 수신 없이 persistentmenu를 수신하게 됩니다.  \n  \n- 'appointment': 일반 대행사가 양방향 서비스 중계사로 지정 알림\n  + 중계사는 대행사 지정에 대한 판단 후 성공(200) 또는 실패(404) 응답을 리턴하여야 함\n  \n  **[예시]**  \n  {\n    \"notiType\": \"appointment\",\n    \"value\": {\n      \"agencyCorpRegNum\": \"1148196221\"\n    }\n  }\n  \n- 'registration': 양방향 대화방 등록 알림 (agencyId는 RBC에 등록된 대행사 ID 이며, noti를\n받은 중계사를 지정한 대행사의 ID 또는 중계사의 ID) \n  + 양방향 대화방 생성 후 단순 통지, 중계사는 수신시 성공(200) 응답을 리턴하여야 함 \n\n  **[예시]**  \n  {\n    \"notiType\": \"registration\",\n    \"value\": {\n      \"agencyId\": \"noagency\",\n      \"brandId\": \"BR.Q63creSjku\",\n      \"brandKey\": \"BK.SD8X63r9uJaApN9\",\n      \"chatbotId\": \"bd_chatbot_v1\",\n      \"corpRegNum\": \"1148196221\"\n    }\n  }\n\n- 'subscription': 대화방메뉴 자동응답메시지 사용 청약 확인을 RBC가 중계사로 요청함  \n  + 중계사는 corpRegNum으로 대화방메뉴 자동응답메시지 사용 청약 여부를 확인 후 성공(200) 또는 실패(404) 응답을 리턴하여야 함\n  \n  **[예시]**  \n  {\n    \"notiType\": \"subscription\",\n    \"value\": {\n      \"agencyId\": \"noagency\",\n      \"brandId\": \"BR.Q63creSjku\",\n      \"brandKey\": \"BK.SD8X63r9uJaApN9\",\n      \"chatbotId\": \"bd_chatbot_v1\",\n      \"corpRegNum\": \"1148196221\"\n    }\n  }\n\n- 'persistentmenu': 대화방메뉴 등록 알림 (agencyId는 RBC에 등록된 대행사 ID 이며, noti를\n받은 중계사를 지정한 대행사의 ID 또는 중계사의 ID)\n  + 양방향 대화방 대화방메뉴 등록 후 단순 통지, 중계사는 수신시 성공(200) 응답을 리턴하여야 함\n\n  **[예시]**  \n  {\n    \"notiType\": \"persistentmenu\",\n    \"value\": {\n      \"agencyId\": \"noagency\",\n      \"brandId\": \"BR.Q63creSjku\",\n      \"brandKey\": \"BK.SD8X63r9uJaApN9\",\n      \"chatbotId\": \"bd_chatbot_v1\",\n      \"corpRegNum\": \"1148196221\"\n    }\n  }\n","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotiBidirectional"}}}},"responses":{"200":{"description":"페이지 내 Response 섹션 참조"}}}}}}
```

### ❖ request body sample

{% tabs %}
{% tab title="양방향 서비스 중계사 지정 알림" %}

```
{
    "notiType": "appointment",
    "value": {
        "agencyCorpRegNum": "1148196221"
    }
}
```

{% endtab %}

{% tab title="양방향 대화방 등록 알림" %}

```
{
    "notiType": "registration",
    "value": {
        "agencyId": "noagency",
        "brandId": "BR.Q63creSjku",
        "brandKey": "BK.SD8X63r9uJaApN9",
        "chatbotId": "bd_chatbot_v1",
        "corpRegNum": "1148196221"
    }
}
```

{% endtab %}

{% tab title="대화방메뉴 사용 청약 확인 요청" %}

```
{
    "notiType": "subscription",
    "value": {
        "agencyId": "noagency",
        "brandId": "BR.Q63creSjku",
        "brandKey": "BK.SD8X63r9uJaApN9",
        "chatbotId": "bd_chatbot_v1",
        "corpRegNum": "1148196221"
    }
}
```

{% endtab %}

{% tab title="대화방메뉴 등록 알림" %}

```
{
    "notiType": "persistentmenu",
    "value": {
        "agencyId": "noagency",
        "brandId": "BR.Q63creSjku",
        "brandKey": "BK.SD8X63r9uJaApN9",
        "chatbotId": "bd_chatbot_v1",
        "corpRegNum": "1148196221"
    }
}
```

{% 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="82">기본값</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><mark style="color:blue;"><strong><code>error</code></strong></mark></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="83">기본값</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](/rbc-api/error_code.md#rcs-biz-center-response-body-error-code) 참조
{% endhint %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://apidocs.rcsbizcenter.com/rbc-api/bidirect_agency/post_bidirect_webook_uri.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
