デバイス
このプラグインのインストール手順とフルマークダウンガイドを含む設定プロンプトをコピーする。
Devices represent individual installations of your app that are managed by Capgo. The Devices API allows you to track and manage devices, including their bundles (versions), channels, and update status.
最後のデバイスアクティビティから
デバイスが__CAPGO_KEEP_0__に接続していない場合、この期間内に自動的にシステムから削除されます。アクティブなデバイスは、更新をチェックするたびに継続的に追跡されます。デバイスの理解
- 「デバイスの理解」のセクション各デバイスには独自の特性と状態があります:
- バンドル (バージョン): 現在のバンドル (バージョン) とネイティブ ビルド バージョン
- 環境: 製品環境または開発環境、エミュレータまたは物理デバイス
- チャネル: 現在の更新チャネル割り当て
- カスタム ID: 自分のトラッキング用途のためにオプションの識別子
ベスト プラクティス
セクション “ベスト プラクティス”- バンドル (バージョン) トラッキング: デバイスのバンドル (バージョン) アドプションを監視して、更新の採用を確実にする
- チャネル管理: テストのニーズに基づいてデバイスを適切なチャネルに割り当てる
- 環境認識: 適切にプロダクト/開発者/エミュレータ環境を処理する
- カスタム識別: 既存システムと統合するためにカスタムIDを使用する
エンドポイント
エンドポイント特定のバンドル(バージョン)またはチャネルにデバイスをリンクする
リクエストボディhttps://api.capgo.app/device/
__CAPGO_KEEP_0__
__CAPGO_KEEP_0__
セクション「リクエスト ボディ」interface DeviceLink { app_id: string device_id: string version_id?: string // bundle (version) name channel?: string // channel name}例のリクエスト
セクション「例のリクエスト」curl -X POST \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "app_id": "app_123", "device_id": "device_456", "channel": "beta" }' \ https://api.capgo.app/device/成功応答
セクション「成功応答」{ "status": "ok"}https://api.capgo.app/device/
セクション「GET」
クエリ パラメータ
クエリ パラメータのセクションapp_id: 必須。アプリの IDdevice_id: 任意。特定のデバイス ID を取得するために使用しますcursor: 任意。前のレスポンスからカーソルを取得するために使用しますlimit: 任意。1 ページあたりのデバイス数 (デフォルト: 50)
例のリクエスト
例のリクエストのセクション# Get all devices (first page)curl -H "authorization: your-api-key" \ "https://api.capgo.app/device/?app_id=app_123"
# Get specific devicecurl -H "authorization: your-api-key" \ "https://api.capgo.app/device/?app_id=app_123&device_id=device_456"
# Get next page using cursorcurl -H "authorization: your-api-key" \ "https://api.capgo.app/device/?app_id=app_123&cursor=2024-01-01T00:00:00Z|device_456"レスポンスのタイプ (リスト)
レスポンスのタイプ (リスト)のセクション複数のデバイスを要求する場合 (no device_id parameter):
interface DeviceListResponse { data: Device[]; nextCursor?: string; // Pass this as 'cursor' param to get next page hasMore: boolean; // true if more pages available}
interface Device { updated_at: string; device_id: string; custom_id: string; version?: number; // bundle (version) id version_name: string | null; // bundle (version) name 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; // First 4 chars of encryption key (e.g., "MIIB")}Response Type (Single Device)
Response Type (Single Device) のセクション特定のデバイスを要求する場合、parameter で、デバイス オブジェクトを直接返します: device_id クリップボードにコピー
interface Device { updated_at: string; device_id: string; custom_id: string; version?: number; // bundle (version) id version_name: string | null; // bundle (version) name 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; // First 4 chars of encryption key (e.g., "MIIB")}Example Response (List) のセクション
クリップボードにコピー{ "data": [ { "device_id": "device_456", "custom_id": "test-device-1", "version": 1, "version_name": "1.0.0", "app_id": "app_123", "platform": "ios", "plugin_version": "5.0.0", "os_version": "17.0", "version_build": "1", "is_prod": true, "is_emulator": false, "updated_at": "2024-01-01T00:00:00Z" } ], "nextCursor": "2024-01-01T00:00:00Z|device_456", "hasMore": true}parameter
例のレスポンス (単一デバイス){ "device_id": "device_456", "custom_id": "test-device-1", "version": 1, "version_name": "1.0.0", "app_id": "app_123", "platform": "ios", "plugin_version": "5.0.0", "os_version": "17.0", "version_build": "1", "is_prod": true, "is_emulator": false, "updated_at": "2024-01-01T00:00:00Z", "channel": "production"}DELETE
例のDELETEhttps://api.capgo.app/device/
__CAPGO_KEEP_0__に接続していないデバイスをチャネルオーバーライドから削除します。この操作でデバイスはデフォルトのチャネルに戻されます。
このエンドポイントはデバイスを削除することはできません。ただし、チャネルオーバーライドのみに影響します。
クエリパラメータinterface Device { device_id: string app_id: string}例のリクエスト
「例のリクエスト」のセクションcurl -X DELETE \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "app_id": "app_123", "device_id": "device_456" }' \ https://api.capgo.app/device/成功応答
「成功応答」のセクション{ "status": "ok"}エラー処理
セクション「エラー処理」一般的なエラーシナリオとその応答:
// Device not found{ "error": "Device not found", "status": "KO"}
// Invalid bundle (version){ "error": "Version not found", "status": "KO"}
// Invalid channel{ "error": "Channel not found", "status": "KO"}
// Permission denied{ "error": "Insufficient permissions to manage devices", "status": "KO"}一般的な使用例
一般的な使用例のセクション- ベータデバイスの登録
{ "app_id": "app_123", "device_id": "device_456", "channel": "beta"}- バージョンオーバーライド
{ "app_id": "app_123", "device_id": "device_456", "version_id": "1.1.0"}- デフォルトチャンネルにリセット
// Use DELETE endpoint to remove overridesデバイス管理のヒント
デバイス管理のヒントのセクション- 監視デバイスの状態とバンドル(バージョン)の配布を定期的に確認する
- テスト: 使いやすいテストデバイスを識別するためにカスタムIDを使用します
- トラブルシューティング: デバイスのアップデートとチャネル割り当てを追跡します
- ネイティブバージョン管理: ネイティブアプリのバージョンを監視して互換性を確保します