メインコンテンツにジャンプする

デバイス

デバイスは、Capgoにアップデートメタデータを報告する個々のアプリインストールです。 このAPIを使用して、そのメタデータを取得したり、デバイス固有のプライベートチャネルオーバーライドを設定および削除できます。

各レコードにはデバイスID、プラットフォーム、アップデータとOSバージョン、ネイティブビルド、インストールしたバンドル、生産とエミュレーターの状態、カスタムID、チャンネルオーバーライドが含まれる。

利用可能な場合、 country_code は、デバイスに対するCloudflareでハンドリングされたリクエストから受け取った最新の有効な2桁のISO 3166-1国codeである。GPSやアプリから提供された場所の値ではない。 null 利用可能な場合、

を使用する。デバイスごとの単一の検索を使用する必要がある場合にこのフィールドを使用する。

エンドポイントのセクション

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

デバイス固有のオーバーライドを設定します。デバイスごとにバンドルをオーバーライドすることはサポートされていません。オーバーライドは90日間有効です。最後の書き込みから90日以内にPOSTを再度実行しない限り、有効期限が切れます。 リクエストボディ リクエストボディのセクション

クリップボードにコピー

interface DeviceChannelOverride {
app_id: string; // reverse-domain app ID, for example com.example.app
device_id: string;
channel: string; // existing non-public channel name
}

ターミナル画面

protectedTokens
pagePath
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: 必須の真偽値。__CAPGO_KEEP_0__ に true デバイスが空でないものだけを返すために custom_id.
  • cursor: 前回のリスト応答から取得するオフセット値。
  • limit: 1 ページあたりのデバイス数。
ターミナルウィンドウ
# 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 を保持している場合、有効な国コードが存在しないリクエストでは最後に有効な値が保持されず、リスト応答では 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/

リクエストボディまたはクエリパラメータ

「リクエストボディまたはクエリパラメータ」セクション

DELETE
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 または cannot_access_channel API キーが必要な権限を含んでいない場合

一般的な使用例

「一般的な使用例」
  1. テスト デバイスをプライベート ベータ チャネルに移動する

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

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

チャネル チャネル チャネル チャネル チャネル チャネル チャンネルにおける実装詳細について チャンネル コンテキスト:Capgoのリリースチャンネル機能名。ページ/エリア:Capgoのソリューションマーケティングページ。役割:短いUIラベルまたはナビゲーションアイテム。見られる場所:ソリューション/ホワイトラベル.astro。メッセージキー`solutions_white_label_visual_cell2_value` (ソリューション ホワイトラベル ビジュアル セル2 値)。 チャンネルにおける実装詳細について ベータテスト ソリューション ベータテスト ソリューションにおける製品ワークフローについて、 バージョン ターゲット ソリューション