デバイス
このプラグインのインストール手順とフルマークダウンガイドを含む設定の質問をコピーします。
デバイスは、Capgo にアップデートメタデータを報告する個々のアプリインストールです。 このAPI を使用して、そのメタデータを取得したり、デバイス固有のプライベートチャネルオーバーライドを設定または削除します。
デバイスメタデータ
「デバイスメタデータ」セクション各レコードには、デバイスID、プラットフォーム、アップデータとOSバージョン、ネイティブビルド、インストールされたバンドル、生産とエミュレーターの状態、カスタムID、チャネルオーバーライドが含まれます。
利用可能な場合、 country_code は、code を取得したCloudflare-ハンドルされたリクエストのデバイスの最新の有効な2桁のISO 3166-1国コードです。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: __CAPGO_KEEP_0__ ID (任意)。__CAPGO_KEEP_0__ が指定されている場合、レスポンスは 1 つのデバイスのみであり、ページネーションリストではありません。customIdMode: __CAPGO_KEEP_0__ (任意)。__CAPGO_KEEP_0__ を "true" に設定すると、__CAPGO_KEEP_1__ が空でないデバイスのみを返します。true: __CAPGO_KEEP_0__ (任意)。__CAPGO_KEEP_0__ を指定すると、前のレスポンスから取得したカーソルが使用されます。custom_id.cursor: __CAPGO_KEEP_0__ (任意)。__CAPGO_KEEP_0__ を指定すると、1 ページあたりのデバイス数が指定されます。limit例
例のリクエスト
ターミナル画面# 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"}DELETE
セクション「DELETE」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__CAPGO_KEEP_0__ キーが必要な権限を欠いている場合。cannot_access_channelwhen the API key lacks the required permission.
「一般的な使用例」というセクション
Section titled “Common use cases”-
Move a test device to a private beta channel
{"app_id": "com.example.app","device_id": "device_456","channel": "beta"} -
Reset a device to normal channel selection
Use the
DELETEendpoint with the app and device IDs.
Keep going from Devices
Section titled “Keep going from Devices”If you are using Devices to plan channel routing and staged rollout, connect it with Channels for the implementation detail in Channels, チャンネル __CAPGO_KEEP_0__ チャンネル __CAPGO_KEEP_0__ ベータテスト ソリューション __CAPGO_KEEP_0__ バージョン ターゲット ソリューション __CAPGO_KEEP_0__