デバイス
このプラグインのインストールステップとフルマークダウンガイドを含むセットアップ用の質問をコピーできます。
Capgoによって管理されるアプリの個々のインストールを表すデバイスは、APIを通じて、デバイスのバンドル(バージョン)、チャネル、および更新状況を追跡および管理できます。
デバイスの理解
「デバイスの理解」セクション各デバイスには、独自の特性と状態があります:
- プラットフォーム: iOS、Android、または Electron
- バンドル (バージョン): 現在のバンドル (バージョン) とネイティブ ビルド バージョン
- 環境: 製品化または開発、エミュレータまたは物理デバイス
- チャネル: 現在のアップデート チャネル割り当て
- カスタム ID: __CAPGO_KEEP_0__のためのオプションの識別子
ベスト プラクティス
「ベスト プラクティス」のセクション- バンドル (バージョン) トラッキング: デバイスのバンドル (バージョン) アドプションを監視してアップデートの採用を確実にする
- チャネル管理: テストのニーズに基づいてデバイスを適切なチャネルに割り当てる
- 環境認識: さまざまな環境 (prod/dev/emulator) に適切に対応する
- カスタム識別: 既存のシステムと統合するためにカスタム 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"}https://api.capgo.app/device/
デバイス情報を取得します。大量のデバイスリストの効率的な取得にカーソルベースのページネーションを使用します。
Query Parameters
Section titled “Query Parameters”app_id: 必須。アプリのIDdevice_id: 任意。特定のデバイスIDを取得する場合cursor: 任意。前のレスポンスから取得したカーソルlimit: 任意。ページあたりのデバイス数 (デフォルト: 50)
Example Requests
Section titled “例のリクエスト”# 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"レスポンスタイプ(リスト)
Section titled “レスポンスタイプ(リスト)”複数のデバイスをリクエストする場合(パラメータなし): 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")}Section titled “レスポンスタイプ(単一デバイス)”
特定のデバイスをリクエストする場合(パラメータあり)、直接デバイスオブジェクトを返します:Copy to clipboard device_id Response Type (List)
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/
デバイスの削除
クエリパラメータ
クエリパラメータのセクション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を使用する
- トラブルシューティング: デバイスの更新とチャンネル割り当てを追跡する
- ネイティブバージョン管理: ネイティブアプリのバージョンを互換性を確保するために監視する
デバイスから続ける
「デバイスから続ける」セクションのタイトルあなたが「 デバイス 」を使用している場合 デバイス チャンネルルーティングとステージドロールアウトの計画に使用するには、 チャンネル と接続してください。 チャンネル チャンネル チャンネル チャンネル詳細の実装については、 バージョン対象化ソリューション バージョン対象化ソリューションにおける製品ワークフロー向け