メイン コンテンツにスキップ

デバイス

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 利用できない場合に使用してください。必要な場合には、単一デバイスの検索を使用してください。

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"
}

https://api.capgo.app/device/

デバイスのメタデータを取得します。結果は、クエリパラメータを省略した場合にカーソルでページネーションされます。 device_id.

  • app_id: 必須の逆ドメインアプリID、例えば com.example.app.
  • device_id: オプションのデバイスID。存在する場合、レスポンスは単一のデバイスとしてではなく、ページネーションされたリストとして返されます。
  • customIdMode: オプションのブール値。セットする true を返すようにします。 custom_id.
  • cursorを返すようにします。
  • limit: オプションのカーソル。前のリストレスポンスから取得します。

: オプションのデバイス数。1ページあたりのデバイス数を指定します。

例のリクエスト
セクションのタイトルは “Example requests”
# Get the first page
curl -H "authorization: your-api-key" \
"https://api.capgo.app/device/?app_id=com.example.app"
# Get one device, including its request-derived country when available
curl -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 ID
curl -H "authorization: your-api-key" \
"https://api.capgo.app/device/?app_id=com.example.app&customIdMode=true"
# Get the next page
curl -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_app Capacitorライブアップデートの代替 cannot_access_channel when the API key lacks the required permission.
  1. テストデバイスをプライベートベータチャンネルに移動する

    {
    "app_id": "com.example.app",
    "device_id": "device_456",
    "channel": "beta"
    }
  2. デバイスを通常のチャンネル選択にリセットする

    アプリとデバイスのIDを含むエンドポイントを使用する。 DELETE デバイスから続ける

デバイスを使用している場合、 Devices を接続する チャンネル チャンネル チャンネル チャンネル チャンネル ベータテストソリューション ベータテストソリューション バージョン目標ソリューション バージョン目標ソリューション 編集