# 브랜드 소식 등록

## Request

## 브랜드 소식을 등록합니다.<br>

> 브랜드 소식을 등록합니다.\
> \
> 브랜드 소식에 등록 가능한 소식 유형에는 Gallery, Share 2가지 유형이 있습니다. 추후 Slide 유형을 추가로 제공할 예정입니다.\
> \
> Gallery 유형 소식 등록 시 포함되는 이미지는 파일 업로드 API를 이용하여 사전 등록해야 합니다.\
> \
> 이미지 파일 등록 시 발급되는 ID를 이용하여야 소식에 이미지를 표시할 수 있습니다.<br>

```json
{"openapi":"3.0.0","info":{"title":"RCS Biz Center 브랜드 소식 API 규격","version":"1.0.0"},"servers":[{"url":"https://api-qa.rcsbizcenter.com/bfapi/1.0","description":"RCS Biz Center API for Staging"},{"url":"https://api.rcsbizcenter.com/bfapi/1.0","description":"RCS Biz Center API for Production"}],"security":[{"jwtAuth":[]}],"components":{"securitySchemes":{"jwtAuth":{"type":"http","description":"인증방식은 JWT인증을 사용합니다. 토큰의 갱신은 없으며 토큰 만료 시 항상 재발급 받아야 합니다.\n","scheme":"bearer","bearerFormat":"JWT"}}},"paths":{"/brand/{brandId}/feed":{"post":{"summary":"브랜드 소식을 등록합니다.\n","description":"브랜드 소식을 등록합니다.\n\n브랜드 소식에 등록 가능한 소식 유형에는 Gallery, Share 2가지 유형이 있습니다. 추후 Slide 유형을 추가로 제공할 예정입니다.\n\nGallery 유형 소식 등록 시 포함되는 이미지는 파일 업로드 API를 이용하여 사전 등록해야 합니다.\n\n이미지 파일 등록 시 발급되는 ID를 이용하여야 소식에 이미지를 표시할 수 있습니다.\n","parameters":[{"name":"X-RCS-Brandkey","in":"header","description":"maxLength: 36 - RCS Biz Center에서 브랜드 등록 시 자동 생성되는 Key 입니다. 대행사가 브랜드 소식 API 연동 시 Header에 반드시 설정하여야 합니다.","required":false,"schema":{"type":"string"}},{"name":"brandId","in":"path","description":"브랜드 내 정보 접근시 사용되는 브랜드ID Path Parameter 입니다.","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"required":["description","pinYn","publishType","status","title","type"],"type":"object","properties":{"title":{"type":"string","description":"maxLength: 40 - 브랜드 소식 제목"},"description":{"type":"string","description":"maxLength: 2000 - 브랜드 소식 내용"},"type":{"type":"string","description":"브랜드 소식 카드 유형","enum":["gallery","share"]},"share":{"required":["snsLink","title"],"type":"object","properties":{"snsLink":{"type":"string","description":"소식 유형이 [share] 타입일때 의 SNS URL"},"title":{"type":"string","description":"maxLength: 80 - snsLink에서 추출한 open graph tag의 title 값"},"description":{"type":"string","description":"maxLength: 2000 - snsLink에서 추출한 open graph tag의 description 값"},"imageUrl":{"type":"string","description":"snsLink에서 추출한 open graph tag의 image 값"}},"description":"Share 유형은 SNS 제공처에서 제공하는 오픈그래프 meta 정보를 추출하여 등록해야 합니다. share 유형의 객체입니다."},"media":{"type":"array","description":"gallery 유형을 구성하는 이미지 정보 객체입니다.","items":{"required":["fileId","orderNo","url"],"properties":{"orderNo":{"type":"integer","description":"정렬 순서"},"fileId":{"type":"string","description":"이미지 파일 ID"},"url":{"type":"string","description":"이미지 URL(파일 등록 결과로 제공됨)"}}}},"buttons":{"type":"array","description":"소식 카드에 지정할 수 있는 버튼 정보 객체입니다.","items":{"required":["orderNo","title","type"],"properties":{"type":{"type":"string","description":"버튼 유형","enum":["app","url","call","chat"]},"orderNo":{"type":"integer","description":"정렬 순서"},"title":{"type":"string","description":"버튼명"},"applink":{"required":["action","packageName","uri"],"type":"object","properties":{"packageName":{"type":"string","description":"maxLength: 40 - App 실행을 위한 package name"},"scheme":{"type":"string","description":"maxLength: 40 - App 실행을 위한 scheme"},"uri":{"type":"string","description":"maxLength: 40 - App 실행을 위한 URI"}},"description":"APP 버튼 정보 객체입니다."},"link":{"type":"string","description":"버튼 유형에 따른 입력 데이터 형식은 다음과 같습니다.\n\n- url 인 경우, web URL(http:// or https://로 시작하는 문자열)\n- call 인 경우, 전화번호(숫자만 허용)\n- chat 인 경우, 대화방ID\n"}}}},"status":{"type":"string","description":"등록 시 지정할 소식의 상태값\n\n- save: 저장(최종 등록되지 않은 임시저장 상태)\n- ok: 등록\n- hide: 비공개\n","enum":["save","ok","hide"]},"publishType":{"type":"string","description":"소식의 게시 유형\n\n- publish: 즉시게시\n- reservation: 예약 - 지정한 일자에 소식목록에 표시되도록 예약된 소식\n- internet: 숨김게시 - 소식목록에 표시되지 않지만 URL을 통해 접근 가능한 소식\n","enum":["publish","reservation","internet"]},"publishDate":{"type":"string","description":"게시 일자. publishType이 reservation 인 경우 반드시 지정(형식 - YYYYMMDDhhmmss)"},"pinYn":{"type":"string","description":"소식 메인 상단 고정여부. 이미 고정된 소식 존재하는 경우 신규 지정 건으로 대체됨","default":"N"}},"description":"브랜드 소식 등록 정보 객체입니다.\n\n브랜드 소식 등록 시 gallery, share 유형 또는 두 가지 모두 사용 가능한 slide 유형 중 하나을 지정할 수 있습니다.\n\n각각의 유형은 buttons를 이용하여 소식 내 버튼을 지정할 수 있습니다.\n"}}}},"responses":{"200":{"description":"페이지 내 Response 섹션 참조"}}}}}}
```

### ❖ request body sample

{% tabs %}
{% tab title="gallery 유형" %}

```
{
  "title": "gallery feed title",
  "description": "gallery feed discription",
  "type": "gallery",
  "media": [
    {
      "orderNo": 1,
      "fileId": "BR.61hBmMP164-FDcoZeqOY0W7"
    },
    {
      "orderNo": 2,
      "fileId": "BR.61hBmMP164-FDcoZeqOY0W7"
    }
  ],
  "buttons": [
    {
      "title": "전화걸기",
      "type": "call",
      "orderNo": 1,
      "link": "15884741"
    },
    {
      "title": "앱 다운로드",    
      "type": "app",
      "orderNo": 2,
      "appLink": {
        "packageName": "com.nhn.android.search",
        "scheme": "naversearchapp",
        "uri": "http://naverapp.naver.com/inappbrowser/?url=http%3A%2F%2Fm.naver.com&target=new&version=6"
      }
    }
  ],
  "status": "save",
  "publishType": "publish",
  "publishDate": "201210181411",
  "pinYn": "N"
}
```

{% endtab %}

{% tab title="share 유형" %}

```
{
  "title": "share feed title",
  "description": "share feed discription",
  "type": "share",
  "share": {
      "snsLink": "https://www.youtube.com/watch?v=S3Ali_M8tE8",
      "title" : "SNL 코리아 레전드 모음",
      "description" : "",
      "imageUri" : "https://biz-dev.chatplus.co.kr/brand/BR.61hBmMP164/feed/20240704/BR.61hBmMP164-FDcoZeqOY0W7.jpg"
  },
  "buttons": [
    {
      "title": "전화걸기",
      "type": "call",
      "orderNo": 1,
      "name": "전화걸기",
      "link": "15884741"
    },
    {
      "title": "앱 다운로드",
      "type": "app",
      "orderNo": 2,
      "name": "앱 다운로드",
      "appLink": {
        "packageName": "com.android.mobile.cs",
        "action": "android.intent.action.VIEW",
        "uri": "abc://gizmos/foo/bar",
        "scheme": "intent://byunhost#Intent;scheme=byunscheme;action=android.intent.action.VIEW;category=android.intent.category.BROWSABLE;package=com.example.myapplication;end"
      }
    }
  ],
  "status": "save",
  "publishType": "publish",
  "publishDate": "201210181411",
  "pinYn": "N"
}
```

{% endtab %}
{% endtabs %}

## Response

<table data-full-width="true"><thead><tr><th width="173">필드명</th><th width="149">타입</th><th width="98" align="center">길이</th><th width="112" align="center">필수여부</th><th width="118">기본값</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>피드ID</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="184">필드명</th><th width="117">타입</th><th width="98" align="center">길이</th><th width="112" align="center">필수여부</th><th width="93">기본값</th><th>설명</th></tr></thead><tbody><tr><td><strong><code>feedId</code></strong></td><td>string</td><td align="center"></td><td align="center">O</td><td></td><td>피드ID</td></tr></tbody></table>

### ❖ response body sample

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

```
{
    "code": "20000000",
    "desc": null,
    "result": {
        "feedId": "BR.i3gC1762pT.QgrKlJz3Va"
    },
    "status": 200
}
```

{% endtab %}

{% tab title="400" %}

```
{
    "error": {
        "code": "64701",
        "message": "parameter required [buttons[title]]"
    },
    "status": 400
}

{
    "error": {
        "code": "64702",
        "message": "parameter invalid [share[snsLink]]"
    },
    "status": 400
}
```

{% endtab %}

{% tab title="401" %}

```
{
  "status": "401",
  "error": {
    "code": "61001",
    "message": "Missing Authorization header"
  }
}

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

{
    "error": {
        "code": "64713",
        "message": "No File Permission [BR.Q63creSjku-FDRwSMvksa5P]"
    },
    "status": 401
}
```

{% endtab %}
{% endtabs %}

{% hint style="warning" %}
error code는 [브랜드소식 - Response body error code](https://apidocs.rcsbizcenter.com/error_code#response-body-error-code) 참조
{% endhint %}
