> ## 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.

# キャンペーンの詳細統計を取得する

> 指定したキャンペーンの配信状況とコンバージョンの実績を取得します。

> [!NOTE]
>
> **前日分のデータを確認する時間**
>
> 前日分のデータは午前7時（KST）以降に確認してください。

> [!NOTE]
>
> **Campaign Statistics APIの変更**
>
> 2025-07-06に`conversionType`フィールドが追加されました。


## OpenAPI

````yaml /ja/api-reference/openapi.yaml get /projects/{projectId}/campaigns/{campaignId}/stats
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:
  /projects/{projectId}/campaigns/{campaignId}/stats:
    get:
      summary: get-campaign-statistics-retrieval
      operationId: getCampaignStatisticsRetrieval
      parameters:
        - name: projectId
          in: path
          required: true
          schema:
            type: string
          description: プロジェクトIDです。
        - name: campaignId
          in: path
          required: true
          schema:
            type: string
          description: キャンペーンIDです。
        - name: start
          in: query
          required: true
          schema:
            type: string
            format: date-time
          description: 集計対象の開始時刻です。UTCの`yyyy-MM-ddTHH:00:00.000Z`形式で指定します。開始時刻は集計に含まれます。
          example: '2024-10-27T15:00:00.000Z'
        - name: end
          in: query
          required: true
          schema:
            type: string
            format: date-time
          description: 集計対象の終了時刻です。UTCの`yyyy-MM-ddTHH:00:00.000Z`形式で指定します。終了時刻は集計に含まれません。
          example: '2024-10-29T15:00:00.000Z'
      responses:
        '200':
          description: メッセージの統計を取得しました。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: object
                    properties:
                      lastCollectedAt:
                        type: string
                        description: 最後に集計した時刻です。韓国標準時（KST）の`yyyy-MM-dd HH:mm:ss`形式です。
                      stats:
                        type: array
                        items:
                          $ref: '#/components/schemas/CampaignStatsMetric'
                  error:
                    type: string
                    nullable: true
              example:
                data:
                  lastCollectedAt: '2024-10-29 04:00:00'
                  stats:
                    - metricName: 구매_이벤트
                      metricType: conversion
                      conversionType: sales_conversion
                      totalSum: 930832
                      dailySums:
                        - date: '2024-09-30'
                          sum: 0
                          dimensionSums:
                            - dimensionKey: 이름
                              dimensionValue: 이름1
                              sum: 0
                    - metricName: send_success
                      metricType: standard
                      totalCount: 550
                      dailyCounts:
                        - date: '2024-10-28'
                          count: 250
                          dimensionCounts:
                            - dimensionKey: region
                              dimensionValue: us-east
                              count: 100
                            - dimensionKey: region
                              dimensionValue: us-west
                              count: 150
                        - date: '2024-10-29'
                          count: 300
                          dimensionCounts:
                            - dimensionKey: region
                              dimensionValue: us-east
                              count: 200
                            - dimensionKey: region
                              dimensionValue: us-west
                              count: 100
                error: null
        '400':
          description: リクエストパラメーターが不正です。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: string
                    nullable: true
                  error:
                    type: string
              example:
                data: null
                error: Invalid project ID
        '401':
          description: 認証に失敗しました。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: string
                    nullable: true
                  error:
                    type: string
              example:
                data: null
                error: 'Unauthorized: Invalid Authorization Token'
        '500':
          description: サーバー内部エラーです。
          content:
            application/json:
              schema:
                type: object
                properties:
                  data:
                    type: string
                    nullable: true
                  error:
                    type: string
              example:
                data: null
                error: 'Internal Server Error: some-error-message'
      security:
        - bearerAuth: []
components:
  schemas:
    CampaignStatsMetric:
      type: object
      properties:
        metricName:
          type: string
          description: 集計した指標の名前です。
        metricType:
          type: string
          enum:
            - standard
            - conversion
          description: 指標のタイプです。
        conversionType:
          type: string
          enum:
            - direct_count_conversion
            - total_count_conversion
            - sales_conversion
          description: コンバージョン指標のタイプです。`metricType`が`conversion`の場合のみ存在します。
        totalCount:
          type: integer
          description: 指定した期間における、この指標の累計回数です。
        totalSum:
          type: number
          description: '`sales_conversion`の場合の、指定した期間におけるこの指標の合計値です。'
        dailyCounts:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                description: 集計日です。形式は`yyyy-MM-dd`で、KSTを基準とします。
              count:
                type: integer
                description: 該当日の指標の回数です。
              dimensionCounts:
                type: array
                items:
                  type: object
                  properties:
                    dimensionKey:
                      type: string
                      description: ユーザー属性のキーです。
                    dimensionValue:
                      type: string
                      description: ユーザー属性の値です。
                    count:
                      type: integer
                      description: 該当する属性値の指標の回数です。
          description: 日別に集計した指標データです。
        dailySums:
          type: array
          items:
            type: object
            properties:
              date:
                type: string
                description: 集計日です。形式は`yyyy-MM-dd`で、KSTを基準とします。
              sum:
                type: number
                description: 該当日の合計値です。
              dimensionSums:
                type: array
                items:
                  type: object
                  properties:
                    dimensionKey:
                      type: string
                      description: ユーザー属性のキーです。
                    dimensionValue:
                      type: string
                      description: ユーザー属性の値です。
                    sum:
                      type: number
                      description: 該当する属性値の合計値です。
          description: '`sales_conversion`の場合の日別に集計した指標データです。'
  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.