デバイス
インストール手順と、このプラグインの完全なMarkdownガイドを含むセットアッププロンプトをコピーします。
デバイスとは、Capgo にアップデータのメタデータを報告する個々のアプリインストールです。この API を使うと、そのメタデータを取得したり、デバイス固有のプライベートチャネルのオーバーライドを設定・削除したりできます。
デバイスのメタデータ
「Device metadata」というタイトルのセクション各レコードには、デバイスID、プラットフォーム、updaterおよびOSのバージョン、Native Build、インストール済みのbundle、本番環境およびエミュレータの状態、カスタムID、channelのオーバーライドを含めることができます。
利用可能な場合、 country_code は、デバイスに対してCloudflareが処理したリクエストから受け取った、最新の有効なISO 3166-1 2文字の国codeです。GPSやアプリが提供する位置情報ではありません。値は null 利用できない場合。このフィールドが必要なときは、単一デバイスのルックアップを使用してください。
エンドポイント
「Endpoints」セクションPOST
「POST」セクションhttps://api.capgo.app/device/
デバイス固有のオーバーライドを プライベート チャネルに設定します。デバイス用の bundle を選ぶには、その bundle をチャネルに割り当ててください。デバイスごとの bundle 直接オーバーライドはサポートされていません。オーバーライドは、再度 POST しない限り、最後の書き込みから 90 日後に期限切れになります。
リクエストボディ
「リクエストボディ」セクション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: 任意。デバイスIDを指定した場合、レスポンスはページネーション形式ではなく、単一のデバイスが返されます。customIdMode: 任意(boolean)。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"}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指定されたchannelが存在しません。public_channel_overrideデバイスをパブリックなchannelへ上書きしようとしています。invalid_version_id直接bundleを上書きしようとしています。代わりにchannelを使用してください。cannot_access_appまたはcannot_access_channelAPI キーに必要な権限がありません。
よくあるユースケース
「一般的なユースケース」セクション-
テストデバイスをプライベートベータチャネルに移動する
{"app_id": "com.example.app","device_id": "device_456","channel": "beta"} -
デバイスを通常のチャネル選択に戻す
以下の
DELETEアプリIDとデバイスIDを指定するエンドポイント。
Devices の次のステップ
「Devices」からの次のステップ使用している場合 デバイス チャンネルルーティングと段階的ロールアウトを計画するには、次と組み合わせてください: チャンネル Channelsの実装の詳細については、 チャンネル Channelsの実装の詳細については、 チャンネル Channelsの実装の詳細については、 ベータテストソリューション ベータテストソリューションのプロダクトワークフロー向け、および バージョンターゲティングソリューション バージョンターゲティングソリューションのプロダクトワークフロー向け。