デバイス
このプラグインのインストール手順と全体のマークダウン ガイドを含むセットアップ コマンドをコピーします。
デバイスは、Capgo で管理されるアプリの個々のインストールを表します。デバイス API を使用すると、バンドル (バージョン)、チャネル、および更新状況を含むデバイスを追跡および管理できます。
デバイスがアクティブな場合、常に更新をチェックすることで、連続して追跡されます。
デバイスの理解「デバイスの理解」
- 各デバイスには、独自の特性と状態があります。プラットフォーム
- : iOS、Android、またはElectronバンドル(バージョン)
- : 現在のバンドル(バージョン)とネイティブビルドバージョン環境
- チャンネル:現在のアップデートチャンネルの割り当て
- カスタムID:あなた自身のトラッキング用にオプションの識別子
ベストプラクティス
セクション「ベストプラクティス」- バンドル(バージョン)トラッキング:デバイスのバンドル(バージョン)採用を確認するためにアップデートの取り入れを監視
- チャンネル管理:テストのニーズに基づいてデバイスを適切なチャンネルに割り当てる
- 環境認識:異なる環境(プロダクト/開発者/エミュレータ)を適切に処理する
- カスタム識別: existing システムと統合するためにカスタム ID を使用します
エンドポイント
セクション「エンドポイント」POST
セクション「POST」https://api.capgo.app/device/
特定のバンドル (バージョン) またはチャネルにデバイスをリンクします。
リクエストボディ
セクション「リクエストボディ」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"}GET
GETのセクションhttps://api.capgo.app/device/
大きなデバイスリストの効率的な取得のためにカーソルベースのページネーションを使用してデバイス情報を取得します。
クエリパラメータ
クエリパラメータのセクションapp_id:必須。アプリのIDdevice_id:任意。特定のデバイスIDを取得するために使用します。cursor: __CAPGO_KEEP_0__ (前回のレスポンスのカーソルを使用してページネーション)limit: __CAPGO_KEEP_0__ (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"レスポンスのタイプ (リスト)
「レスポンスのタイプ (リスト)」のセクションデバイスを複数リクエストする場合 (パラメータなし): device_id コピー
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")}__CAPGO_KEEP_0__ (デフォルト: 50)
Response Type (Single Device)特定のデバイスを要求する際の 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")}例 (リスト)
例 (リスト){ "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}コピー
例 (単一デバイス){ "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"}コピー
削除https://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を使用する
- トラブルシューティングデバイスの更新とチャンネル割り当てを追跡する
- ネイティブ バージョン管理:ネイティブアプリのバージョンを監視して互換性を確保する
デバイスから続ける
「デバイスから続ける」セクションCapacitorを使用している場合 デバイス チャンネルルーティングとステージドロールアウトの計画に使用するには、デバイスを チャンネル チャンネル チャンネル チャンネル チャンネル チャンネルにおける実装詳細について ベータテスト ソリューション ベータテスト ソリューションにおける製品ワークフローについて バージョン ターゲット ソリューション バージョン ターゲット ソリューションにおける製品ワークフローについて