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

# 리포트 생성하기

액티브 유저 리포트(Active Users Report)에서는 선택한 주기에 따라 주요 마케팅 성과 지표인 DAU, WAU, MAU를 확인할 수 있는 통계 리포트입니다.

또한, 요청 횟수에 대한 제한이 없어 필요할 때마다 자유롭게 리포트를 생성할 수 있습니다.

Active Users Report 데이터를 요청합니다.

rate limit: 일반적인 사용량에는 별도의 제한이 없습니다. 다만, 서비스 안정성을 위협하는 과도한 요청이 감지될 경우, 일시적으로 429 Too Many Requests 응답이 반환될 수 있습니다.

<Card title="Try API Request" icon="rectangle-api" horizontal href="https://www.postman.com/airbridge-engineering/workspace/airbridge-api/request/22395869-f8073e1c-4654-42ff-b256-dace84eb02da" />

```text POST theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
https://api.airbridge.io/reports/api/v4/apps/{app_name}/active-users/query
```

<h2 id="리포트-생성하기-request">
  Request
</h2>

***

<h3 id="리포트-생성하기-headers">
  Headers
</h3>

<ParamField header="Accept-Language" type="string">
  API 요청 및 결과 반환에 사용할 언어를 지정할 수 있습니다. ISO-639-1 포맷을 따릅니다.
</ParamField>

<ParamField header="Content-Type" type="string">
  리소스의 미디어 타입을 나타냅니다. 기본값으로 `application/json`을 사용합니다.
</ParamField>

<ParamField header="Authorization" type="string">
  API 요청에 사용하는 키값입니다. [키값 생성 및 조회 방법](/ko/references/introduction)을 확인하여 획득할 수 있습니다.
</ParamField>

<h3 id="리포트-생성하기-path-params">
  Path Params
</h3>

<ParamField path="app_name" type="string" required>
  에어브릿지 앱 이름(App Name)
</ParamField>

<h3 id="리포트-생성하기-body-params">
  Body Params
</h3>

<ParamField body="from" type="string" required>
  요청할 리포트 데이터의 시작일.

  * `YYYY-MM-DD` 형태입니다.
  * 에어브릿지 앱의 타임존이 적용된 날짜이어야 합니다.
</ParamField>

<ParamField body="to" type="string" required>
  요청할 리포트 데이터의 종료일.

  * `YYYY-MM-DD` 형태입니다.
  * 에어브릿지 앱의 타임존이 적용된 날짜이어야 합니다.
  * 현재 날짜까지 설정할 수 있으며 한 번에 조회할 수 있는 최대 기간은 92일입니다.
</ParamField>

<ParamField body="granularity" type="enum" required>
  분석 기간 주기.

  | 벨류      | 설명                                                                                        |
  | ------- | ----------------------------------------------------------------------------------------- |
  | `day`   | 일별로 데이터를 분석합니다.                                                                           |
  | `week`  | 주별로 데이터를 분석합니다. 시작일로부터 7일 단위로 계산됩니다.                                                      |
  | `month` | 월별로 데이터를 분석합니다. 시작일로부터 다음달 같은 일자까지를 같은 달로 계산합니다. 예를 들어 3월 10일이 시작일이면 4월 10일까지를 같은 달로 봅니다. |
</ParamField>

<ParamField body="metrics" type="string[]" required>
  메트릭으로 다양한 광고 성과 데이터를 조회할 수 있습니다. 액티브 유저 리포트에서 선택할 수 있는 전체 메트릭 리스트는 [메타데이터 가져오기 (Metric) API](/ko/references/active-users-report/get-metadata-metric)를 통해서 확인 할 수 있습니다.

  최대 20개까지 설정할 수 있습니다.
</ParamField>

<ParamField body="groupBy" type="object" required>
  그룹바이는 조회할 메트릭의 수치를 나누는 기준입니다.
  조회에 사용할 그룹바이 항목 혹은 코호트를 설정할 수 있습니다.

  <Expandable title="하위 변수">
    <ParamField body="groupBy.fields" type="string[]" required>
      리포트 그룹바이.

      최대 6개의 그룹바이를 설정할 수 있으며, 선택할 수 있는 리스트는 [그룹바이 목록](https://docs.google.com/spreadsheets/d/13ThNnryqRmZQwJVecM8lZ2OB7LzA8s3cwLlQBGpbXLg/edit#gid=1419762398)에서 확인할 수 있습니다.
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="filters" type="object[]" required>
  '그룹바이'로 제공하는 항목들에 대한 필터.

  조건을 만족하는 데이터에 대한 통계 데이터를 리포트에서 조회할 수 있습니다.

  <Expandable title="하위 변수">
    <ParamField body="filters[0].filterType" type="enum" required>
      필터에 적용할 연산자.

      | 벨류          | 설명                                            |
      | ----------- | --------------------------------------------- |
      | `IN`        | 속해있다. 액츄얼스 리포트에서는 같다(is, =)에 대응합니다.           |
      | `NOT IN`    | 속해있지 않다. 액츄얼스 리포트에서는 같지 않다(is not, ≠)에 대응합니다. |
      | `LIKE`      | 포함한다. (contains, ∋)                           |
      | `NOT LIKE`  | 포함하지 않는다. (does not contain, ∌)               |
      | `EXIST`     | 값이 존재한다. (exists)                             |
      | `NOT EXIST` | 값이 존재하지 않는다. (does not exist)                 |
    </ParamField>

    <ParamField body="filters[0].field" type="string" required>
      필터를 지정할 그룹바이.

      `groupBys` 내에 정의된 값만 사용하실 수 있습니다.
    </ParamField>

    <ParamField body="filters[0].values" type="string[]">
      필터에 적용할 값.
    </ParamField>
  </Expandable>
</ParamField>

<RequestExample>
  ```shellscript Request theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
  curl -X POST 'https://api.airbridge.io/reports/api/v4/apps/{app_name}/active-users/query' \
    -H 'Accept-Language: ko' \
    -H 'Content-Type: application/json' \
    -H 'Authorization: Bearer {AIRBRIDGE-API-TOKEN}' \
    -d '{
    "from": "2022-11-04",
    "to": "2022-11-11",
    "granularity": "day",
    "groupBy": {
      "fields": [
        "channel"
      ]
    },
    "filters": [
      {
        "filterType": "IN",
        "field": "campaign",
        "values": [
          "App"
        ]
      }
    ]
  }'
  ```
</RequestExample>

<h2 id="리포트-생성하기-response">
  Response
</h2>

***

### 200

### 404

<ResponseExample>
  ```json 200 theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
  {
    "task": {
      "status": "RUNNING",
      "taskId": "5e286bd4-b4b1-4c04-8f6a-123456789abc"
    }
  }
  ```

  ```json 404 theme={"theme":{"light":"github-dark-dimmed","dark":"github-dark-dimmed"}}
  {
    "type": "about:blank",
    "title": "Not Found",
    "status": 404,
    "traceId": "1-000000-000000000000000"
  }
  ```
</ResponseExample>
