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

デバイス

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

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

利用可能な場合、 country_code is the latest valid two-letter ISO 3166-1 country code received from a Cloudflare-handled request for the device. It is not GPS or a location value supplied by your app. It can be null 利用できない場合、単一デバイスの検索を使用してください。

エンドポイント

エンドポイント

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

デバイス固有のオーバーライドを設定します。 プライベート チャンネルにバンドルを選択するには、そのバンドルをチャンネルに割り当ててください。デバイスごとに直接バンドルをオーバーライドすることはサポートされていません。オーバーライドは、最後の書き込みから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
}
ターミナルウィンドウ
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/

デバイスのチャンネルオーバーライドを削除します。デバイスは通常のチャンネル選択を使用します。このエンドポイントは、メタデータレコードを削除しません。

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

「リクエストボディまたはクエリパラメータ」
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 値)。 チャンネルにおける実装詳細について ベータテスト ソリューション ベータテスト ソリューションにおける製品ワークフローについて、 バージョン ターゲット ソリューション