# 대행사 브랜드 기업단위 목록 조회

## Request

## 대행사가 계약된 브랜드를 기업 단위로 조회합니다.<br>

> 대행사가 계약된 브랜드를 기업 단위로 조회합니다.  \
> 기업 단위 조회 시 사업자등록번호를 이용합니다.  \
> \
> &#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":{"AgencyId":{"name":"agencyId","in":"path","schema":{"type":"string","maxLength":20},"required":true,"description":"maxLength: 20 - RCS Biz Center에 등록된 대행사 ID 입니다.\n"},"CorpRegNum":{"name":"corpRegNum","in":"path","schema":{"type":"string","maxLength":10},"required":true,"description":"maxLength: 10 - 대상 기업의 사업자등록번호(10자리) 입니다.\n"},"Offset":{"name":"offset","in":"query","schema":{"type":"integer","default":0},"description":"시작 offset 번호(default: 0) 입니다."},"Limit":{"name":"limit","in":"query","schema":{"type":"integer","minimum":100,"maximum":1000,"default":100},"description":"minimum: 100, maximum: 1000 - 조회 최대 건수(default: 100) 입니다.'\n"}}},"paths":{"/agency/{agencyId}/corp/{corpRegNum}/brand":{"get":{"summary":"대행사가 계약된 브랜드를 기업 단위로 조회합니다.\n","description":"대행사가 계약된 브랜드를 기업 단위로 조회합니다.  \n기업 단위 조회 시 사업자등록번호를 이용합니다.  \n\n  + **계정 권한: 대행사**  \n","parameters":[{"$ref":"#/components/parameters/AgencyId"},{"$ref":"#/components/parameters/CorpRegNum"},{"$ref":"#/components/parameters/Offset"},{"$ref":"#/components/parameters/Limit"}],"responses":{"200":{"description":"페이지 내 Response 섹션 참조"}}}}}}
```

## 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="121">기본값</th><th>설명</th></tr></thead><tbody><tr><td><a href="#result-array-less-than-object-greater-than"><mark style="color:blue;"><strong><code>result</code></strong></mark></a></td><td>array&#x3C;object></td><td align="center"></td><td align="center">O</td><td></td><td>브랜드와 대행사의 계약관계 정보입니다.</td></tr><tr><td><strong><code>code</code></strong></td><td>string</td><td align="center">5</td><td align="center">O</td><td>20000000</td><td></td></tr><tr><td><strong><code>status</code></strong></td><td>integer</td><td align="center">3</td><td align="center">O</td><td>200</td><td></td></tr><tr><td><strong><code>desc</code></strong></td><td>string</td><td align="center"></td><td align="center">O</td><td></td><td></td></tr><tr><td><a href="#pagination-object"><mark style="color:blue;"><strong><code>pagination</code></strong></mark></a></td><td>object</td><td align="center"></td><td align="center">O</td><td></td><td>전체 건수와 페이징 조건을 제공합니다.</td></tr><tr><td><a href="#links-object"><mark style="color:blue;"><strong><code>links</code></strong></mark></a></td><td>object</td><td align="center"></td><td align="center">O</td><td></td><td>이전/다음 페이지 링크를 제공합니다. offset을 0이 아닌 limit보다 작은 양수값으로 설정한 경우 prev 는 null로 응답됩니다.</td></tr></tbody></table>

### <mark style="color:blue;">**result**</mark> - array\<object>

<table data-full-width="true"><thead><tr><th width="187">필드명</th><th width="141">타입</th><th width="68" align="center">길이</th><th width="108" align="center">필수여부</th><th width="81">기본값</th><th>설명</th></tr></thead><tbody><tr><td><strong><code>corpId</code></strong></td><td>string</td><td align="center">13</td><td align="center">O</td><td></td><td>RCS Biz Center에 등록된 기업 ID 입니다.</td></tr><tr><td><strong><code>corpRegNum</code></strong></td><td>string</td><td align="center">10</td><td align="center"></td><td></td><td>RCS Biz Center에 등록된 기업의 사업자등록번호 입니다.</td></tr><tr><td><strong><code>brandId</code></strong></td><td>string</td><td align="center">13</td><td align="center">O</td><td></td><td>브랜드 ID 입니다.</td></tr><tr><td><strong><code>brandName</code></strong></td><td>string</td><td align="center">20</td><td align="center"></td><td></td><td>브랜드 명 입니다.</td></tr><tr><td><strong><code>agencyId</code></strong></td><td>string</td><td align="center">20</td><td align="center">O</td><td></td><td>대행사 ID 입니다.</td></tr><tr><td><a href="#contracts-array-less-than-string-greater-than"><mark style="color:blue;"><strong><code>contracts</code></strong></mark></a></td><td>array&#x3C;object></td><td align="center"></td><td align="center"></td><td></td><td><p>계약 유형 입니다.</p><ul><li>a2p</li><li>chat</li></ul></td></tr><tr><td><strong><code>registerDate</code></strong></td><td>string</td><td align="center"></td><td align="center"></td><td></td><td>계약정보 등록일시 입니다.</td></tr><tr><td><strong><code>updateDate</code></strong></td><td>string</td><td align="center"></td><td align="center"></td><td></td><td>계약정보 수정일시 입니다.</td></tr><tr><td><strong><code>brandDate</code></strong></td><td>string</td><td align="center"></td><td align="center"></td><td></td><td>계약된 대상 브랜드의 최종 변경 일시 정보 입니다.</td></tr><tr><td><strong><code>chatbotDate</code></strong></td><td>string</td><td align="center"></td><td align="center"></td><td></td><td>브랜드 내 등록된 대화방 중 가장 최근에 변경된 대화방의 일시 정보 입니다.</td></tr><tr><td><strong><code>messagebaseDate</code></strong></td><td>string</td><td align="center"></td><td align="center"></td><td></td><td>브랜드 내 등록된 템플릿 중 가장 최근에 변경된 템플릿의 일시 정보 입니다.</td></tr><tr><td><strong><code>logoDate</code></strong></td><td>string</td><td align="center"></td><td align="center"></td><td></td><td>브랜드 내 등록된 브랜드 로고 중 가장 최근에 변경된 로고의 일시 정보 입니다.</td></tr></tbody></table>

### <mark style="color:blue;">contracts</mark> - **array\<string>**

<table data-full-width="true"><thead><tr><th width="145">필드명</th><th width="78">타입</th><th width="99" align="center">길이</th><th width="112" align="center">필수여부</th><th width="89">기본값</th><th>설명</th></tr></thead><tbody><tr><td><strong><code>Allowed</code></strong></td><td>string</td><td align="center"></td><td align="center"></td><td></td><td><p>계약 유형 입니다.</p><ul><li>a2p</li><li>chat</li></ul></td></tr></tbody></table>

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

<table data-full-width="true"><thead><tr><th width="143">필드명</th><th width="91">타입</th><th width="98" align="center">길이</th><th width="112" align="center">필수여부</th><th width="79">기본값</th><th>설명</th></tr></thead><tbody><tr><td><strong><code>total</code></strong></td><td>integer</td><td align="center"></td><td align="center">O</td><td></td><td>전체건수</td></tr><tr><td><strong><code>offset</code></strong></td><td>integer</td><td align="center"></td><td align="center">O</td><td></td><td>조회 기준 위치</td></tr><tr><td><strong><code>limit</code></strong></td><td>integer</td><td align="center"></td><td align="center">O</td><td></td><td>페이지 당 조회 건수</td></tr></tbody></table>

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

<table data-full-width="true"><thead><tr><th width="145">필드명</th><th width="89">타입</th><th width="99" align="center">길이</th><th width="112" align="center">필수여부</th><th width="80">기본값</th><th>설명</th></tr></thead><tbody><tr><td><strong><code>prev</code></strong></td><td>string</td><td align="center"></td><td align="center">O</td><td></td><td>이전페이지URL</td></tr><tr><td><strong><code>next</code></strong></td><td>string</td><td align="center"></td><td align="center">O</td><td></td><td>다음페이지URL</td></tr></tbody></table>

### ❖ response body sample

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

```
{
    "code": "20000000",
    "desc": null,
    "result": [
        {
            "corpId": "CO.l9ZohLN20I",
            "corpRegNum": "3148158360",
            "brandId": "BR.i3gC1762pT",
            "brandName": "테스트브랜드",
            "status": "검수완료(수정)",
            "agencyId": "hong",
            "contracts": [
                "a2p,chat"
            ],
            "registerDate": "2024-06-10T16:39:14.000+09",
            "updateDate": "2024-06-10T16:39:14.000+09",
            "brandDate": "2024-06-05T15:27:19.000+09",
            "chatbotDate": "2024-06-05T15:27:17.000+09",
            "messagebaseDate": "2024-06-05T15:27:21.000+09",
            "logoDate": null,
            "approvalDate": "2024-06-10T10:16:59.000+09"
        }
    ],
    "pagination": {
        "offset": 0,
        "limit": 100,
        "total": 1
    },
    "links": {
        "prev": null,
        "next": null
    },
    "status": 200
}
```

{% endtab %}

{% tab title="204" %}

```
존재하지 않는 {corpRegNum}로 조회시에는빈 contents가 리턴될 수 있음.
```

{% endtab %}

{% tab title="401" %}

```
{
    "error": {
        "code": "61003",
        "message": "Invalid token"
    },
    "status": 401
}

{
    "error": {
        "code": "61005",
        "message": "Invalid client id"
    },
    "status": 401
}

{
    "error": {
        "code": "61007",
        "message": "not allowed IP. unregistered 0.0.0.0"
    },
    "status": 401
}
```

{% 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 %}
