コンテンツに進む

デバイス

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

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

利用可能な場合 country_code 最新の有効な2桁のISO 3166-1国コードcodeは、Cloudflareでハンドルされたデバイスの要求から受信されます。これはGPSやアプリから提供された場所の値ではありません。このフィールドは null 利用可能な場合; 1台のデバイスの検索を使用して、このフィールドを使用する必要がある場合。

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

GET

GET

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

Section titled “GET” device_id.

  • app_id:必要な逆引きドメインのアプリID、例えば com.example.app.
  • device_id:オプションのデバイスID。存在すると、レスポンスは単一のデバイスとしてではなく、ページネーションされたリストとして返されます。
  • customIdMode:オプションのブール値。を設定 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"
}

DELETE

DELETE

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

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

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

Section titled “リクエストボディまたはクエリパラメータ”
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 が必要な権限を欠いている場合。

デバイスの__CAPGO_KEEP_0__キーが必要な権限を満たしていない場合。

一般的な使用例
  1. 一般的な使用例

    {
    "app_id": "com.example.app",
    "device_id": "device_456",
    "channel": "beta"
    }
  2. コピー

    Capgoを使用して DELETE 使用する

アプリケーションとデバイスのIDを含むエンドポイント

「デバイスから続ける」

あなたが「デバイス」を使用している場合 デバイス チャンネルルーティングとステージドロールアウトを計画するには チャンネル チャンネルにおける実装詳細のためです。 チャンネル チャンネルにおける実装詳細のためです。 チャンネル チャンネルにおける実装詳細のためです。 チャンネル ベータテストソリューション バージョン対象ソリューション バージョン対象ソリューション向け製品ワークフロー