# プレースメント情報の取得

> ペイウォールまたはオンボーディングのプレースメントに関する情報（ペイウォール、セグメント、オーディエンス、A/B テスト）を取得します。これにより、各プレースメントを個別に開くことなく、すべてが正しく設定されていることを確認できます。
>
> レート制限：1 秒あたり 2 リクエスト。

## OpenAPI

```yaml
/api-specs/export-analytics-api.yaml post /api/v1/client-api/exports/placements/
openapi: 3.1.0
info:
  title: Adapty エクスポートアナリティクス API
  version: 1.0.0
  description: |
    Adapty エクスポートアナリティクス API を使用すると、アナリティクスデータを CSV または JSON 形式でエクスポートできます。
    アプリのパフォーマンス指標をより深く分析し、レポートをカスタマイズして、
    時系列のトレンドを分析する柔軟性が得られます。この API を使用することで、詳細なアナリティクスデータを簡単に取得し、
    データインサイトを追跡・共有・改善することができます。
servers:
  - url: https://api-admin.adapty.io
    description: 本番サーバー
security:
  - apikeyAuth: []
paths:
  /api/v1/client-api/exports/placements/:
    post:
      summary: プレースメント情報の取得
      description: |-
        ペイウォールまたはオンボーディングのプレースメントに関する情報（ペイウォール、セグメント、オーディエンス、A/B テスト）を取得します。これにより、各プレースメントを個別に開くことなく、すべてが正しく設定されていることを確認できます。

        レート制限：1 秒あたり 2 リクエスト。
      operationId: retrievePlacementInfo
      security:
        - apikeyAuth: []
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/PlacementInfoRequest"
            examples:
              basic:
                summary: 基本的なプレースメント情報リクエスト
                value:
                  filters:
                    placement_type: paywall
      responses:
        "200":
          description: プレースメント情報を正常に取得しました
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/PlacementInfoResponse"
            text/csv:
              schema:
                type: string
                description: CSV 形式のプレースメント情報
        "400":
          description: リクエストが不正です
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
        "401":
          description: 認証されていません
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/UnauthorizedError"
        "429":
          description: レート制限を超過しました。API キーごとに 1 秒あたり最大 2 リクエストです。
components:
  schemas:
    PlacementInfoRequest:
      type: object
      required:
        - filters
      properties:
        filters:
          type: object
          required:
            - placement_type
          properties:
            placement_type:
              type: string
              enum:
                - paywall
                - onboarding
              description: レスポンスで返すプレースメントをフィルタリングします
    PlacementInfoResponse:
      type: object
      properties:
        data:
          type: array
          items:
            type: object
            properties:
              developer_id:
                type: string
                description: プレースメント ID
              placement_name:
                type: string
                description: プレースメント名
              audience_name:
                type: string
                description: オーディエンス名
              segment_name:
                type: string
                description: オーディエンス ID
              cross_placement_ab_test_name:
                type: string
                nullable: true
                description: クロスプレースメント A/B テスト名
              ab_test_name:
                type: string
                nullable: true
                description: A/B テスト名
              paywall_name:
                type: string
                description: ペイウォール名（placement_type が paywall の場合のみ返されます）
              onboarding_name:
                type: string
                description: オンボーディング名（placement_type が onboarding の場合のみ返されます）
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
              errors:
                type: array
                items:
                  type: string
        error_code:
          type: string
        status_code:
          type: integer
    UnauthorizedError:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
              errors:
                type: array
                items:
                  type: string
        error_code:
          type: string
        status_code:
          type: integer
  securitySchemes:
    apikeyAuth:
      type: apiKey
      in: header
      name: Authorization
      description: |
        API リクエストは、シークレット API キーを Authorization ヘッダーとして使用して認証する必要があります。
        API キーはアプリ設定で確認できます。形式は `Api-Key {YOUR_SECRET_API_KEY}` です。
        例：`Api-Key secret_live_...`
```
