チャンネル
チャンネルは、Capgoでアプリの更新を管理するための中核メカニズムです。A/Bテスト、段階的ロールアウト、プラットフォーム固有の更新などの機能を有効にしながら、ユーザーが更新をどのように、いつ受け取るかを制御できます。
チャンネルの理解
Section titled “チャンネルの理解”チャンネルは、アプリ更新の配信トラックを表します。各チャンネルは、特定のルールと制約で構成できます:
- バージョン管理: ユーザーが受け取るバージョンを指定
- プラットフォームターゲティング: 特定のプラットフォーム(iOS/Android)をターゲットに
- 更新ポリシー: 更新の配信方法を制御
- デバイス制限: 更新にアクセスできるデバイスを管理
チャンネル設定オプション
Section titled “チャンネル設定オプション”- public: 新しいデバイスのデフォルトチャンネルとして設定
- disableAutoUpdateUnderNative: デバイスのネイティブアプリバージョンがチャンネルで利用可能な更新バージョンより新しい場合に更新を防止(例: デバイスはバージョン1.2.3だが、チャンネルは1.2.2を持つ)
- disableAutoUpdate: 更新動作を制御(“major”, “minor”, “version_number”, “none”)
- ios/android: 特定のプラットフォームで有効化/無効化
- allow_device_self_set: デバイスが自身のチャンネルを選択できるようにする
- allow_emulator: エミュレータデバイスでの更新を許可
- allow_dev: 開発ビルドでの更新を許可
ベストプラクティス
Section titled “ベストプラクティス”- テストチャンネル: 内部検証用のテストチャンネルを維持
- 段階的ロールアウト: 段階的な更新展開のために複数のチャンネルを使用
- プラットフォーム分離: 必要に応じてiOSとAndroid用に別々のチャンネルを作成
- バージョン管理: 明確な更新パスのためにセマンティックバージョニングを使用
エンドポイント
Section titled “エンドポイント”https://api.capgo.app/channel/
チャンネル設定を作成または更新します。
Request Body
Section titled “Request Body”type disable_update = "major" | "minor" | "version_number" | "none"interface ChannelSet { app_id: string channel: string version?: string public?: boolean disableAutoUpdateUnderNative?: boolean disableAutoUpdate?: disable_update ios?: boolean android?: boolean allow_device_self_set?: boolean allow_emulator?: boolean allow_dev?: boolean}リクエスト例
Section titled “リクエスト例”curl -X POST \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "app_id": "app_123", "channel": "beta", "version": "1.2.0", "public": false, "disableAutoUpdate": "minor", "ios": true, "android": true, "allow_emulator": true }' \ https://api.capgo.app/channel/成功レスポンス
Section titled “成功レスポンス”{ "status": "ok"}https://api.capgo.app/channel/
チャンネル情報を取得します。ページあたり50チャンネルを返します。
クエリパラメータ
Section titled “クエリパラメータ”app_id: 必須。アプリのIDpage: オプション。ページネーションのページ番号channel: オプション。取得する特定のチャンネル名
リクエスト例
Section titled “リクエスト例”# すべてのチャンネルを取得curl -H "authorization: your-api-key" \ "https://api.capgo.app/channel/?app_id=app_123"
# 特定のチャンネルを取得curl -H "authorization: your-api-key" \ "https://api.capgo.app/channel/?app_id=app_123&channel=beta"
# 次のページを取得curl -H "authorization: your-api-key" \ "https://api.capgo.app/channel/?app_id=app_123&page=1"レスポンスタイプ
Section titled “レスポンスタイプ”interface Channel { id: number; created_at: string; name: string; app_id: string; version: { id: number, name: string }; created_by: string; updated_at: string; public: boolean; disableAutoUpdateUnderNative: boolean; disableAutoUpdate: boolean; allow_emulator: boolean; allow_dev: boolean;}レスポンス例
Section titled “レスポンス例”{ "data": [ { "id": 1, "name": "production", "app_id": "app_123", "version": { "id": 1, "name": "1.0.0" }, "created_at": "2024-01-01T00:00:00Z", "updated_at": "2024-01-01T00:00:00Z", "created_by": "user_123", "public": true, "disableAutoUpdateUnderNative": false, "disableAutoUpdate": false, "allow_emulator": false, "allow_dev": false } ]}DELETE
Section titled “DELETE”https://api.capgo.app/channel/
チャンネルを削除します。これにより、このチャンネルを使用しているすべてのデバイスが影響を受けることに注意してください。
クエリパラメータ
Section titled “クエリパラメータ”interface Channel { channel: string app_id: string}リクエスト例
Section titled “リクエスト例”curl -X DELETE \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "app_id": "app_123", "channel": "beta" }' \ https://api.capgo.app/channel/成功レスポンス
Section titled “成功レスポンス”{ "status": "ok"}一般的なエラーシナリオとそのレスポンス:
// チャンネルが見つかりません{ "error": "Channel not found", "status": "KO"}
// 無効なバージョン形式{ "error": "Invalid version format. Use semantic versioning", "status": "KO"}
// 無効な更新ポリシー{ "error": "Invalid disableAutoUpdate value", "status": "KO"}
// 権限が拒否されました{ "error": "Insufficient permissions to manage channels", "status": "KO"}一般的な使用例
Section titled “一般的な使用例”- ベータテスト
{ "app_id": "app_123", "channel": "beta", "version": "1.2.0-beta", "public": false, "allow_emulator": true, "allow_dev": true}- 本番ロールアウト
{ "app_id": "app_123", "channel": "production", "version": "1.2.0", "public": true, "disableAutoUpdate": "minor"}- プラットフォーム固有の更新
{ "app_id": "app_123", "channel": "ios-hotfix", "version": "1.2.1", "ios": true, "android": false}