> ## Documentation Index
> Fetch the complete documentation index at: https://docs.notifly.tech/llms.txt
> Use this file to discover all available pages before exploring further.

# テンプレートを使ってカカオブランドメッセージを配信する

> テンプレートを使ってメッセージを配信します。

> [!WARNING]
>
> * このエンドポイントは、カカオトークの配信プラットフォームが`Notifly`のチャネルに対応します。`Notifly (Legacy)`のチャネルでは利用できません。
> * `200`レスポンスの`{ "success": true }`が示すのは、Notiflyが配信リクエストをキューに登録したことまでです。
> * API経由の配信統計については[contact@notifly.tech](mailto:contact@notifly.tech)にお問い合わせください。この統計はコンソールに表示されません。


## OpenAPI

````yaml /ja/api-reference/openapi.yaml post /messages/kakao-brand-message
openapi: 3.0.3
info:
  title: Notifly API
  version: 1.0.0
  contact:
    email: contact@notifly.tech
servers:
  - url: https://api.notifly.tech
    description: Notifly APIサーバー
security: []
tags:
  - name: catalog
    x-group: カタログ
paths:
  /messages/kakao-brand-message:
    post:
      summary: send-kakao-brand-message
      operationId: sendKakaoBrandMessage
      requestBody:
        required: true
        content:
          application/json:
            schema:
              type: object
              required:
                - projectId
                - templateId
                - brandMessageTarget
                - recipientList
              properties:
                projectId:
                  type: string
                  description: Notiflyの設定画面で確認できます。
                templateId:
                  type: string
                  description: 登録済みの配信テンプレートIDです。
                brandMessageTarget:
                  type: string
                  enum:
                    - M
                    - 'N'
                    - I
                    - I+N
                  description: >-
                    配信対象です。`M`はマーケティング受信に同意したユーザー、`N`はチャネルの友だちではないユーザー、`I`はチャネルの友だち、`I+N`は友だちを優先する配信です。`I+N`では、先に`I`で配信し、友だちではないため失敗した送信先に`N`で再配信します。
                senderGroupingKey:
                  type: string
                  description: 配信をまとめるためのキーです。最大100文字です。
                recipientList:
                  type: array
                  items:
                    type: object
                    required:
                      - recipientNo
                    properties:
                      recipientNo:
                        type: string
                        description: 送信先の電話番号です。
                      templateParameter:
                        type: object
                        description: >-
                          ブランドメッセージのテンプレートにある`#{変数}`に入れる値です。たとえば`#{customer_name}`には`{
                          "customer_name": "홍길동" }`を指定します。
                      failoverTextMessageTemplateParameter:
                        type: object
                        description: >-
                          代替SMSテンプレートの変数値です。たとえばテンプレートに`{{ event["coupon_name"]
                          }}`があれば、`{ "coupon_name": "8월 할인 쿠폰"
                          }`を指定します。ブランドメッセージの代替SMSは広告SMSとして配信されます。登録済みの080受信拒否番号が必要です。
                  description: 送信先のリストです。最大1,000件まで指定できます。
            example:
              projectId: example_project_1234567890abcdef
              templateId: template-id
              brandMessageTarget: M
              recipientList:
                - recipientNo: '01012345678'
                  templateParameter:
                    customer_name: 홍길동
                  failoverTextMessageTemplateParameter:
                    coupon_name: 8월 할인 쿠폰
      responses:
        '200':
          description: 配信リクエストをキューに登録しました。このレスポンスが示すのはキューへの登録結果です。
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
              example:
                success: true
        '400':
          description: 発信者情報が登録されていません。
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error:
                    type: string
              example:
                success: false
                error: Sender info is not registered.
        '500':
          description: サーバー内部エラーです。
          content:
            application/json:
              schema:
                type: object
                properties:
                  success:
                    type: boolean
                  error:
                    type: string
              example:
                success: false
                error: Internal Server Error
      security:
        - bearerAuth: []
components:
  securitySchemes:
    bearerAuth:
      type: http
      scheme: bearer
      bearerFormat: JWT
      description: '`POST /authenticate`で発行したトークンをBearer形式で送信します。'

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.