デバイス
コピー可能
Devices are individual app installations that report updater metadata to Capgo. Use this API to retrieve that metadata or set and remove a device-specific private-channel override.
デバイスはアップデートをインストールする必要なく、メタデータを更新するためにアップデータと統計のチェックインが可能です。
デバイスメタデータ「デバイスメタデータ」セクション
各レコードには、デバイスID、プラットフォーム、アップデータとOSバージョン、ネイティブビルド、インストールしたバンドル、生産とエミュレーターの状態、カスタムID、チャネルオーバーライドが含まれます。 country_code は、最新の有効な2文字のISO 3166-1国コードcode、Cloudflare-ハンドルされたリクエストから受信されたデバイスです。GPSやアプリから提供される位置値ではありません。この値は null 利用できない場合に使用してください。必要な場合には、単一デバイスの検索を使用してください。
エンドポイント
セクション「エンドポイント」POST
セクション「POST」https://api.capgo.app/device/
デバイス固有のオーバーライドを設定して、 プライベート チャンネルに設定します。デバイスごとにバンドルを選択するには、チャンネルにバンドルを割り当てます。直接デバイスごとにバンドルをオーバーライドすることはサポートされていません。
リクエスト本体
セクション「リクエスト本体」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
「GET」のセクションhttps://api.capgo.app/device/
デバイスのメタデータを取得します。結果は、クエリパラメータを省略した場合にカーソルでページネーションされます。 device_id.
app_id: 必須の逆ドメインアプリID、例えばcom.example.app.device_id: オプションのデバイスID。存在する場合、レスポンスは単一のデバイスとしてではなく、ページネーションされたリストとして返されます。customIdMode: オプションのブール値。セットする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を保存している場合、Capgoはデバイス固有の検索によって埋められます。有効な国コードが存在しないリクエストは、最後に有効な値をクリアしません; リストレスポンスは 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_appCapacitorライブアップデートの代替cannot_access_channelwhen the API key lacks the required permission.
一般的な使用例
「一般的な使用例」セクション-
テストデバイスをプライベートベータチャンネルに移動する
{"app_id": "com.example.app","device_id": "device_456","channel": "beta"} -
デバイスを通常のチャンネル選択にリセットする
アプリとデバイスのIDを含むエンドポイントを使用する。
DELETEデバイスから続ける
「デバイスから続ける」セクション
あなたがチャンネルルーティングとステージドロールアウトを計画するためにデバイスを使用している場合、 Devices を接続する チャンネル チャンネル チャンネル チャンネル チャンネル ベータテストソリューション ベータテストソリューション バージョン目標ソリューション バージョン目標ソリューション 編集