デバイス
コピー可能
デバイスは、Capgoにアップデートメタデータを報告する個々のアプリインストールです。 このAPIを使用して、そのメタデータを取得したり、デバイス固有のプライベートチャネルオーバーライドを設定および削除できます。
デバイスメタデータ
セクションのタイトル「デバイスメタデータ」各レコードにはデバイスID、プラットフォーム、アップデータとOSバージョン、ネイティブビルド、インストールしたバンドル、生産とエミュレーターの状態、カスタムID、チャンネルオーバーライドが含まれる。
利用可能な場合、 country_code は、デバイスに対するCloudflareでハンドリングされたリクエストから受け取った最新の有効な2桁のISO 3166-1国codeである。GPSやアプリから提供された場所の値ではない。 null 利用可能な場合、
を使用する。デバイスごとの単一の検索を使用する必要がある場合にこのフィールドを使用する。
エンドポイントのセクションPOST
POSTのセクションhttps://api.capgo.app/device/
デバイス固有のオーバーライドを設定します。デバイスごとにバンドルをオーバーライドすることはサポートされていません。オーバーライドは90日間有効です。最後の書き込みから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}ターミナル画面
protectedTokenscurl -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
「GET」のセクションhttps://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/
リクエストボディまたはクエリパラメータ
「リクエストボディまたはクエリパラメータ」セクション
DELETEinterface 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のリリースチャンネル機能名。ページ/エリア:Capgoのソリューションマーケティングページ。役割:短いUIラベルまたはナビゲーションアイテム。見られる場所:ソリューション/ホワイトラベル.astro。メッセージキー`solutions_white_label_visual_cell2_value` (ソリューション ホワイトラベル ビジュアル セル2 値)。 チャンネルにおける実装詳細について ベータテスト ソリューション ベータテスト ソリューションにおける製品ワークフローについて、 バージョン ターゲット ソリューション