デバイス
このプラグインのインストール手順と完全なMarkdownガイドを含むセットアッププロンプトをコピー
Deviceとは、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/
デバイス固有のオーバーライドを private channel に設定します。デバイスに特定の bundle を割り当てるには、その bundle を channel に割り当ててください。デバイスごとの直接的な bundle オーバーライドはサポートされていません。オーバーライドは、再度 POST しない限り、最後に書き込まれてから 90 日後に期限切れとなります。
リクエストボディ
「Request body」セクション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/パブリックチャンネルはデバイスの上書き(override)には使用できません。
成功時のレスポンス
「成功時のレスポンス」セクション{ "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"}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ステータスコードと、以下のフィールドを含む error と message JSONボディで返されます。主なエラーコードは以下の通りです:
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の実装の詳細については、 ベータテスト・ソリューション Beta Testing Solutionのプロダクトワークフロー向けに、また バージョン指定ソリューション Version Targeting Solutionのプロダクトワークフロー向けに。