デバイス
このプラグインのインストール手順と全体のマークダウンガイドを含むセットアップコマンドをコピーします。
デバイスは、アップデートメタデータをCapgoに報告する個々のアプリインストールです。デバイス固有のプライベートチャンネルオーバーライドを設定および削除するには、このAPIを使用してアップデートメタデータを取得します。
デバイスメタデータ
セクション:デバイスメタデータ各レコードには、デバイスID、プラットフォーム、アップデートおよびOSバージョン、ネイティブビルド、インストール済みバンドル、生産およびエミュレーターの状態、カスタムID、チャンネルオーバーライドが含まれます。
利用可能な場合 country_code 最新の有効な2桁のISO 3166-1国コードcodeは、Cloudflareでハンドルされたデバイスの要求から受信されます。これはGPSやアプリから提供された場所の値ではありません。このフィールドは null 利用可能な場合; 1台のデバイスの検索を使用して、このフィールドを使用する必要がある場合。
エンドポイント
セクション:エンドポイントPOST
セクション:POSThttps://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
GEThttps://api.capgo.app/device/
Section titled “GET” device_id.
GET
パラメータのクエリapp_id:必要な逆引きドメインのアプリID、例えばcom.example.app.device_id:オプションのデバイスID。存在すると、レスポンスは単一のデバイスとしてではなく、ページネーションされたリストとして返されます。customIdMode:オプションのブール値。を設定trueを返すようにします。custom_id.cursorを返すデバイスのみを返します。limit:前のリストレスポンスから取得したオプションのカーソル。
:1ページあたりのデバイスの数を指定します。
例のリクエスト# 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 を保存している場合に、デバイス固有の検索によって埋められます。有効な国が存在しないリクエストは、最後に有効な値をクリアせずにリストレスポンスを返します。 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
DELETEhttps://api.capgo.app/device/
デバイスのチャンネルオーバーライドを削除します。デバイスは通常のチャンネル選択を使用します。このエンドポイントは、メタデータレコードを削除しません。
リクエストボディまたはクエリパラメータ
Section titled “リクエストボディまたはクエリパラメータ”interface DeviceOverrideRemoval { app_id: string; device_id: string;}例のリクエスト
Section titled “例のリクエスト”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_channelAPI が必要な権限を欠いている場合。
デバイスの__CAPGO_KEEP_0__キーが必要な権限を満たしていない場合。
一般的な使用例-
一般的な使用例
{"app_id": "com.example.app","device_id": "device_456","channel": "beta"} -
コピー
Capgoを使用して
DELETE使用する
アプリケーションとデバイスのIDを含むエンドポイント
「デバイスから続ける」あなたが「デバイス」を使用している場合 デバイス チャンネルルーティングとステージドロールアウトを計画するには チャンネル チャンネルにおける実装詳細のためです。 チャンネル チャンネルにおける実装詳細のためです。 チャンネル チャンネルにおける実装詳細のためです。 チャンネル ベータテストソリューション バージョン対象ソリューション バージョン対象ソリューション向け製品ワークフロー