# 브랜드 운영자 권한 부여

## Request

## 브랜드 대표운영자가 브랜드 내 운영자(기업의 마스터/매니저, 대행사) 권한을 부여 합니다.<br>

> 브랜드 대표운영자가 브랜드 내 운영자(기업의 마스터/매니저, 대행사) 권한을 부여 합니다.  \
> &#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":{"PersonId":{"name":"personId","in":"path","description":"maxLength: 20 - 브랜드 대표운영자 또는 운영자의 계정(마스터, 매니저) ID 입니다.\n","schema":{"type":"string","maxLength":20},"required":true},"BrandId":{"name":"brandId","in":"path","schema":{"type":"string","maxLength":13},"required":true,"description":"maxLength: 13 - 브랜드 내 정보 접근시 사용되는 브랜드ID Path Parameter 입니다.\n"}},"schemas":{"RegPrivilegeInfo":{"type":"object","description":"브랜드의 권한 정보 객체입니다.\n","required":["privilegeType","id"],"properties":{"privilegeType":{"type":"string","description":"권한은 다음과 같이 구분됩니다.  \n\n  - Manager : 대표운영자  \n  - SubManager : 운영자(기업의 마스터 또는 매니저)\n  - Agency : 운영자(대행사)\n","enum":["Agency","SubManager","Manager"]},"id":{"description":"maxLength: 20 - 마스터, 매니저 또는 대행사의 ID입니다.\n","type":"string","maxLength":20}}}}},"paths":{"/corp/{personId}/brand/{brandId}/privilege":{"post":{"summary":"브랜드 대표운영자가 브랜드 내 운영자(기업의 마스터/매니저, 대행사) 권한을 부여 합니다.\n","description":"브랜드 대표운영자가 브랜드 내 운영자(기업의 마스터/매니저, 대행사) 권한을 부여 합니다.  \n  + **계정 권한 : 마스터**\n  + **브랜드 권한 : 브랜드 대표운영자**\n","parameters":[{"$ref":"#/components/parameters/PersonId"},{"$ref":"#/components/parameters/BrandId"}],"requestBody":{"description":"+ privilegeType이 SubManager 인 경우, 소속된 기업 내 다른 마스터, 매니저 계정을 운영자로 지정할 수\n있습니다.  \n\n+ privilegeType이 Agency 인 경우, 별도의 RCS 발송 계약을 맺은 대행사를 운영자로 지정합니다.  \n","content":{"application/json":{"schema":{"properties":{"regPrivileges":{"type":"array","items":{"$ref":"#/components/schemas/RegPrivilegeInfo"}}}}}}},"responses":{"200":{"description":"페이지 내 Response 섹션 참조"}}}}}}
```

### ❖ request body sample

{% tabs %}
{% tab title="SubManager 권한부여" %}

<pre><code><strong>{
</strong>    "regPrivileges": [
        {
            "privilegeType": "SubManager",
            "id": "lng04152"
        }
    ]
}
</code></pre>

{% endtab %}

{% tab title="Agency 권한부여" %}

```
{
    "regPrivileges": [
        {
            "privilegeType": "Agency",
            "id": "lng04152"
        }
    ]
}
```

{% 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="122">기본값</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></tbody></table>

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

<table data-full-width="true"><thead><tr><th width="148">필드명</th><th width="141">타입</th><th width="68" align="center">길이</th><th width="108" align="center">필수여부</th><th width="90">기본값</th><th>설명</th></tr></thead><tbody><tr><td><strong><code>privilegeType</code></strong></td><td>string</td><td align="center"></td><td align="center">O</td><td></td><td><p>권한은 다음과 같이 구분됩니다.</p><ul><li>Manager : 브랜드 관리자(=마스터)</li><li>SubManager : 브랜드 부관리자(=마스터, 매니저)</li><li>Agency : 브랜드 대행사</li></ul></td></tr><tr><td><strong><code>id</code></strong></td><td>string</td><td align="center">20</td><td align="center">O</td><td></td><td>마스터, 매니저 또는 대행사의 ID입니다.</td></tr><tr><td><strong><code>status</code></strong></td><td>string</td><td align="center"></td><td align="center">O</td><td></td><td><p>권한 처리 상태를 표시합니다.</p><ul><li>Waiting : RCS Biz Center 웹에서 제공되는 기능인 '브랜드 운영권한 신청'을 이용하여 신청 후 대기 브랜드 관리자의 승인을 대기 중인 상태입니다. Waiting 상태의 대상은 POST를 이용하여 등록하면 승인이 되고 Ok 상태로 변경됩니다.</li><li>Processing : 권한 정보를 이통3사에 동기화 중인 경우 processing 상태로 표시됩니다. Processing 상태가 짧은 시간 동안 발생할 수 있으며 지속될 경우 RCS Biz Center에 문의하시기 바랍니다.</li><li>Ok : 권한 상태가 정상적인 경우 표시됩니다.</li></ul></td></tr></tbody></table>

### ❖ response body sample

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

```
{
    "code": "20000000",
    "desc": null,
    "result": [
        {
            "privilegeType": "Manager",
            "id": "hong",
            "contracts": [],
            "status": "Ok"
        },
        {
            "privilegeType": "SubManager",
            "id": "hozzy59",
            "contracts": [],
            "status": "Ok"
        }
    ],
    "status": 200
}
```

{% endtab %}

{% tab title="400" %}

```
{
    "error": {
        "code": "64104",
        "message": "Invalid personId on path parameter"
    },
    "status": 400
}

{
    "error": {
        "code": "64348",
        "message": "hozzy59 is already registered."
    },
    "status": 400
}

{
    "error": {
        "code": "64336",
        "message": "required value: [privilegeType]"
    },
    "status": 400
}

{
    "error": {
        "code": "64338",
        "message": "invalid value: [privilegeType], SubManager or Agency (case sensitive)"
    },
    "status": 400
}

{
    "error": {
        "code": "64346",
        "message": "user not found: hozzy59"
    },
    "status": 400
}
```

{% endtab %}

{% tab title="401" %}

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

{% endtab %}

{% tab title="403" %}

```
{
    "error": {
        "code": "63001",
        "message": "No Brand Permission"
    },
    "status": 403
}
```

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