デバイス
コピー用意
デバイスは、Capgoにアップデートメタデータを報告する個々のアプリインストールです。 このAPIを使用して、そのメタデータを取得したり、デバイス固有のプライベートチャンネルオーバーライドを設定および削除できます。
デバイスメタデータ
「デバイスメタデータ」のセクション各レコードには、デバイスID、プラットフォーム、アップデータとOSバージョン、ネイティブビルド、インストールされたバンドル、生産とエミュレーターの状態、カスタムID、チャンネルオーバーライドが含まれます。
利用可能な場合、 country_code is the latest valid two-letter ISO 3166-1 country code received from a Cloudflare-handled request for the device. It is not GPS or a location value supplied by your app. It can be null 利用できない場合、単一デバイスの検索を使用してください。
エンドポイント
エンドポイントPOST
セクション:POSThttps://api.capgo.app/device/
デバイス固有のオーバーライドを設定します。 プライベート チャンネルにバンドルを選択するには、そのバンドルをチャンネルに割り当ててください。デバイスごとに直接バンドルをオーバーライドすることはサポートされていません。オーバーライドは、最後の書き込みから90日間有効です。再度POSTすると有効期限が更新されます。
リクエストボディ
セクション:リクエストボディinterface DeviceChannelOverride { app_id: string; // reverse-domain app ID, for example com.example.app device_id: string; channel: string; // existing non-public channel name}curl -X POST \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "app_id": "com.example.app", "device_id": "device_456", "channel": "beta" }' \ https://api.capgo.app/device/パブリックチャネルはデバイスオーバーライドとして使用できません。
成功応答
セクション:成功応答{ "status": "ok"}GET
セクション:GEThttps://api.capgo.app/device/
デバイスメタデータを取得します。結果は、省略した場合にカーソルでページネーションされる。 device_id.
クエリパラメータ
セクション:クエリパラメータapp_id: 必須の逆ドメインアプリID、例えばcom.example.app.device_id: デバイスID。存在する場合、応答は単一のデバイスとしてではなく、ページネーションされたリストとして返されます。customIdMode: 必須のブール値。__CAPGO_KEEP_0__ に設定true: デバイスが空でないものだけを返すcustom_id.cursor: 前回のリスト応答から取得したカーソルlimit: 1 ページあたりのデバイスの数
例のリクエスト
セクション:例のリクエスト# Get the first pagecurl -H "authorization: your-api-key" \ "https://api.capgo.app/device/?app_id=com.example.app"
# Get one device, including its request-derived country when availablecurl -H "authorization: your-api-key" \ "https://api.capgo.app/device/?app_id=com.example.app&device_id=device_456"
# Get only devices with a custom IDcurl -H "authorization: your-api-key" \ "https://api.capgo.app/device/?app_id=com.example.app&customIdMode=true"
# Get the next pagecurl -H "authorization: your-api-key" \ "https://api.capgo.app/device/?app_id=com.example.app&cursor=2024-01-01T00:00:00Z%7Cdevice_456"レスポンスのタイプ
セクション:レスポンスのタイプinterface DeviceListResponse { data: Device[]; nextCursor?: string; hasMore: boolean;}
interface Device { updated_at: string; device_id: string; custom_id: string; version?: number; version_name: string | null; channel?: string; app_id: string; platform: "ios" | "android" | "electron"; plugin_version: string; os_version: string; version_build: string; is_prod: boolean; is_emulator: boolean; key_id: string | null; install_source: string | null; country_code: string | null;}country_code Capgo が有効な Cloudflare-派生の国 code を保持している場合、デバイスごとに検索される。有効な国が無いリクエストでは、最後に有効な値はクリアされない; リスト応答は null このフィールドのために。
例のレスポンス (リスト)
「例のレスポンス (リスト)」のセクション{ "data": [ { "device_id": "device_456", "custom_id": "test-device-1", "version": 1, "version_name": "1.0.0", "app_id": "com.example.app", "platform": "ios", "plugin_version": "5.0.0", "os_version": "17.0", "version_build": "1", "is_prod": true, "is_emulator": false, "key_id": null, "install_source": null, "country_code": null, "updated_at": "2024-01-01T00:00:00Z" } ], "nextCursor": "2024-01-01T00:00:00Z|device_456", "hasMore": true}例のレスポンス (単一のデバイス)
「例のレスポンス (単一のデバイス)」のセクション{ "device_id": "device_456", "custom_id": "test-device-1", "version": 1, "version_name": "1.0.0", "app_id": "com.example.app", "platform": "ios", "plugin_version": "5.0.0", "os_version": "17.0", "version_build": "1", "is_prod": true, "is_emulator": false, "key_id": "MIIB", "install_source": null, "country_code": "FR", "updated_at": "2024-01-01T00:00:00Z", "channel": "beta"}削除
「削除」https://api.capgo.app/device/
デバイスのチャンネルオーバーライドを削除します。デバイスは通常のチャンネル選択を使用します。このエンドポイントは、メタデータレコードを削除しません。
リクエストボディまたはクエリパラメータ
「リクエストボディまたはクエリパラメータ」interface DeviceOverrideRemoval { app_id: string; device_id: string;}例のリクエスト
「例のリクエスト」のセクションcurl -X DELETE \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "app_id": "com.example.app", "device_id": "device_456" }' \ https://api.capgo.app/device/成功レスポンス
「成功レスポンス」のセクション{ "status": "ok"}エラー
「エラー」のセクションエラーはHTTPエラーのステータスとJSONボディを使用します。 error そして message エラー コード。一般的なエラー コードには:
invalid_app_id場合app_idは、逆引き ドメイン識別子ではありません。device_not_found未知のデバイスの検索用にchannel_not_foundリクエストされたチャネルが存在しない場合。public_channel_overrideデバイスをパブリック チャネルにオーバーライドしようとしている場合。invalid_version_id直接バンドル オーバーライドを試みている場合;チャネルを使用してください。cannot_access_appまたはcannot_access_channelAPI キーが必要な権限を含んでいない場合。
一般的な使用例
「一般的な使用例」-
テスト デバイスをプライベート ベータ チャネルに移動する
{"app_id": "com.example.app","device_id": "device_456","channel": "beta"} -
デバイスを通常のチャネル選択にリセット
アプリとデバイスのIDを含むエンドポイントを使用
DELETEデバイスから続ける
「デバイスから続ける」セクション
「デバイスから続ける」セクション「デバイス」機能を使用している場合 「デバイス」 「デバイス」機能を使用してチャネルルーティングとステージドロールアウトを計画するには、チャネルと接続する必要があります。 チャネル チャネル チャネル チャンネルにおける実装詳細について チャンネル コンテキスト:Capgoのリリースチャンネルの機能名。ページ/エリア:Capgoのソリューションマーケティングページ。役割:短いUIラベルまたはナビゲーションアイテム。見られる場所:ページソリューション/ホワイトラベル.astro。メッセージキー`solutions_white_label_visual_cell2_value` (ソリューション ホワイトラベル ビジュアル セル2 値)。 チャンネルにおける実装詳細について ベータテスト ソリューション ベータテスト ソリューションにおける製品ワークフローについて、 バージョン ターゲット ソリューション