# インテグレーション識別子を設定する

> プロファイルにインテグレーション識別子を追加します。

## OpenAPI

```yaml
/api-specs/adapty-api.yaml post /api/v2/server-side-api/integration/profile/set/integration-identifiers/
openapi: 3.1.0
info:
  title: Adapty サーバーサイド API
  version: 1.0.0
servers:
  - url: https://api.adapty.io
    description: 本番サーバー
paths:
  /api/v2/server-side-api/integration/profile/set/integration-identifiers/:
    post:
      summary: インテグレーション識別子を設定する
      description: プロファイルにインテグレーション識別子を追加します。
      operationId: setIntegrationIdentifiers
      tags:
        - Integration
      security:
        - apikeyAuth: []
      parameters:
        - name: adapty-customer-user-id
          in: header
          required: false
          schema:
            type: string
          description: お客様のシステムにおける顧客の一意の ID です。`adapty-customer-user-id` または `adapty-profile-id` のいずれかが必須です。
        - name: adapty-profile-id
          in: header
          required: false
          schema:
            type: string
            format: uuid
          description: お客様のシステムにおけるプロファイルの一意の ID です。匿名プロファイルを扱う場合に最適です。`adapty-customer-user-id` または `adapty-profile-id` のいずれかが必須です。
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: "#/components/schemas/IntegrationIdentifiersRequest"
            example:
              pushwoosh_hwid: example_pushwoosh_hwid
              mixpanel_user_id: example_mixpanel_user_id
              facebook_anonymous_id: example_facebook_anonymous_id
              firebase_app_instance_id: example_firebase_app_instance_id
              amplitude_user_id: example_amplitude_user_id
              amplitude_device_id: example_amplitude_device_id
              appmetrica_device_id: example_appmetrica_device_id
              appmetrica_profile_id: example_appmetrica_profile_id
              one_signal_subscription_id: example_one_signal_subscription_id
              one_signal_player_id: example_one_signal_player_id
              branch_id: example_branch_id
              appsflyer_id: example_appsflyer_id
              adjust_device_id: example_adjust_device_id
              airbridge_device_id: example_airbridge_device_id
              tenjin_analytics_installation_id: example_tenjin_analytics_installation_id
              posthog_distinct_user_id: example_posthog_distinct_user_id
      responses:
        "200":
          description: インテグレーション識別子が正常に設定されました。レスポンスボディは空です。
        "400":
          description: リクエストが不正です
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              example:
                errors:
                  - At least one integration identifier must be provided.
                error_code: validation_error
                status_code: 400
        "401":
          description: 認証エラー
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              example:
                errors:
                  - Invalid API key
                error_code: unauthorized
                status_code: 401
        "404":
          description: プロファイルが見つかりません
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
              example:
                errors:
                  - Profile not found
                error_code: profile_not_found
                status_code: 404
        "500":
          description: 内部サーバーエラー
          content:
            application/json:
              schema:
                $ref: "#/components/schemas/ErrorResponse"
components:
  schemas:
    IntegrationIdentifiersRequest:
      type: object
      properties:
        adjust_device_id:
          type: string
          nullable: true
          description: Adjust インテグレーションにおけるネットワークユーザーの ID
        airbridge_device_id:
          type: string
          nullable: true
          description: Airbridge インテグレーションにおけるユーザーデバイスの ID
        amplitude_device_id:
          type: string
          nullable: true
          description: Amplitude インテグレーションにおけるユーザーデバイスの ID
        amplitude_user_id:
          type: string
          nullable: true
          description: Amplitude インテグレーションにおけるユーザーの ID
        appmetrica_device_id:
          type: string
          nullable: true
          description: AppMetrica インテグレーションにおけるユーザーデバイスの ID
        appmetrica_profile_id:
          type: string
          nullable: true
          description: AppMetrica インテグレーションにおけるユーザーの ID
        appsflyer_id:
          type: string
          nullable: true
          description: AppsFlyer インテグレーションにおけるネットワークユーザーの ID
        branch_id:
          type: string
          nullable: true
          description: Branch インテグレーションにおけるユーザーアプリの Branch キー
        facebook_anonymous_id:
          type: string
          nullable: true
          description: Facebook Ads インテグレーションにおけるユーザーの ID
        firebase_app_instance_id:
          type: string
          nullable: true
          description: Firebase インテグレーションにおけるユーザーの ID
        mixpanel_user_id:
          type: string
          nullable: true
          description: Mixpanel インテグレーションにおけるユーザーの ID
        one_signal_player_id:
          type: string
          nullable: true
          description: OneSignal インテグレーションにおけるユーザーの ID（レガシー識別子）
        one_signal_subscription_id:
          type: string
          nullable: true
          description: OneSignal インテグレーションにおけるユーザーの ID（推奨識別子）
        posthog_distinct_user_id:
          type: string
          nullable: true
          description: PostHog インテグレーションにおけるユーザーの ID
        pushwoosh_hwid:
          type: string
          nullable: true
          description: Pushwoosh インテグレーションにおけるユーザーデバイスの ID
        tenjin_analytics_installation_id:
          type: string
          nullable: true
          description: Tenjin インテグレーションにおけるユーザーデバイスの ID
      description: 少なくとも 1 つのインテグレーション識別子を指定する必要があります
    ErrorResponse:
      type: object
      properties:
        errors:
          type: array
          items:
            type: object
            properties:
              source:
                type: string
                nullable: true
                description: エラーの発生源
              errors:
                type: array
                items:
                  type: string
                description: エラーメッセージの配列
        error_code:
          type: string
          description: エラーの短縮名
        status_code:
          type: integer
          description: HTTP ステータスコード
      required:
        - errors
        - error_code
        - status_code
  securitySchemes:
    apikeyAuth:
      type: apiKey
      name: Authorization
      in: header
      default: Api-Key {Your secret API key}
      description: |
        API リクエストは、**Authorization** ヘッダーにシークレット API キーを `Api-Key {your_secret_api_key}` の形式（例: `Api-Key secret_live_...`）で指定して認証する必要があります。このキーは Adapty ダッシュボード → **App Settings** → **General** タブ → **API keys** セクションで確認できます。
```
