コンテンツにジャンプ

チャンネル

チャンネルは、Capgoでアプリのアップデートを管理するための基本的なメカニズムです。ユーザーがアップデートを受け取る方法と時期を制御できるようにし、A/Bテスト、ステージドロールアウト、プラットフォーム固有のアップデートなどの機能を有効にします。

チャンネルは、アプリのアップデートの配布トラックを表します。各チャンネルは、特定のルールと制約とともに構成できます:

  • バンドル(バージョン)制御: 指定されたバンドル(バージョン)を受け取るユーザー
  • プラットフォームターゲット: iOS/Android/Electronなどの特定のプラットフォームをターゲット
  • アップデートポリシー: __CAPGO_KEEP_0__を制御する
  • デバイス制限: __CAPGO_KEEP_0__にアクセスできるデバイスを管理する
  1. テスト チャンネル: 内部検証用にテスト チャンネルを維持する
  2. ステージド ロールアウト: 逐次的なアップデートの展開に複数のチャンネルを使用する
  3. プラットフォーム セパレーション: iOS、Android、Electron など必要な場合に別々のチャンネルを作成する
  4. バンドル (バージョン) コントロール: 明確なアップデート パスを確保するためにセマンティック バージョニングを使用する 「ベスト プラクティス」セクション テスト チャンネル:内部検証用にテスト チャンネルを維持する

https://api.capgo.app/channel/

チャンネル設定の作成または更新

リクエストボディ

コピー
type DisableAutoUpdate = "major" | "minor" | "metadata" | "patch" | "none"
type AutoPauseAction = "pause" | "rollback" | "notify"
interface ChannelSet {
app_id: string
channel: string
version?: string | null // stable bundle name
public?: boolean
disableAutoUpdateUnderNative?: boolean
disableAutoUpdate?: DisableAutoUpdate
ios?: boolean
android?: boolean
electron?: boolean
allow_device_self_set?: boolean
allow_emulator?: boolean
allow_device?: boolean
allow_dev?: boolean
allow_prod?: boolean
// Progressive rollout (camelCase is preferred)
rolloutVersion?: string | number | null // target bundle name or ID
rolloutPercentage?: number // 0–100
rolloutPercentageBps?: number // 0–10000; takes precedence when both are set
rolloutEnabled?: boolean
rolloutPaused?: boolean // input-only convenience flag
rolloutPausedAt?: string | null // ISO timestamp or null
rolloutPauseReason?: string | null
rolloutCacheTtlSeconds?: number // 60–31536000
rollback?: boolean
promoteToStable?: boolean
// Rollout auto-pause policy
autoPauseEnabled?: boolean
autoPauseWindowMinutes?: number
autoPauseFailureRateBps?: number | null
autoPauseConfidence?: number
autoPauseMinAttempts?: number | null
autoPauseMinFailures?: number | null
autoPauseAction?: AutoPauseAction
autoPauseCooldownMinutes?: number
}

For rollout and auto-pause fields, the API also accepts the equivalent snake_case または rollout_version 。両方の形式が提供された場合、キャメルケース値が優先される。. auto_pause_enabled. rollback はキャメルケースのみです。

ロールアウトのターゲットには既存のチャネルが必要です。既存のチャネルには安定したバンドルが割り当てられている必要があります。また、POSTリクエストの同じリクエストで割り当ててもかまいません。 version POSTリクエストの同じリクエストで rollbackpromoteToStable は終端アクションです。1つずつ組み合わせることはできません。

既存のチャネルに5%のロールアウトを設定します。既存のチャネルには安定したバンドルが割り当てられている必要があります。 production ターミナル画面

クリップボードにコピー
curl -X POST \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"app_id": "com.example.app",
"channel": "production",
"rolloutVersion": "1.3.0",
"rolloutPercentage": 5,
"rolloutEnabled": true,
"rolloutCacheTtlSeconds": 2592000,
"autoPauseEnabled": true,
"autoPauseFailureRateBps": 500,
"autoPauseMinAttempts": 100,
"autoPauseAction": "pause"
}' \
https://api.capgo.app/channel/
{
"status": "ok"
}

POSTはアップセットであり、ステータスのみを返します。結果のチャネル構成を読むには、GET要求を実行してください。

アプリプレビュー キー境界

アプリプレビュー キー境界のセクション

最小特権のPRプレビューのために、このエンドポイントを認証する必要があります。 authorization: $CAPGO_API_KEY または capgkey: $CAPGO_API_KEYヘッダーはチャンネルの__CAPGO_KEEP_0__によって受け入れられません。 x-api-key header is not accepted by the Channels API.

新しい非公開プレビュー チャネルを作成するには、アプリプレビュー キーが必要です。作成は自動的に、そのキーにそのチャネルにのみスコープされているライフサイクル バインディングを与えます。ロールには app_preview 、含まれていないため、POSTを使用して既存のチャネルを更新することはできません。 channel.update_settingsアプリプレビュー キーは、既存のデフォルトまたはメインチャネルを含む既存のチャネルを更新するにはPOSTを使用できません。

PRプレビュー チャンネルを設定しない場合は、または public を使用して、POSTを一般的なプレビュー チャンネル アップセットとして扱うのではなく、作成とアップロード フローを作成します。 falseGET bundle upload --channel GET

https://api.capgo.app/channel/

パラメータ channelパラメータ channelチャンネルID

必須。アプリのID

__CAPGO_KEEP_0__
  • app_id__CAPGO_KEEP_0__
  • page: __CAPGO_KEEP_0__ (ページ番号)
  • channel: __CAPGO_KEEP_0__ (特定のチャンネル名)
ターミナル画面
# Get all channels
curl -H "authorization: your-api-key" \
"https://api.capgo.app/channel/?app_id=com.example.app"
# Get a specific channel
curl -H "authorization: your-api-key" \
"https://api.capgo.app/channel/?app_id=com.example.app&channel=production"
# Get the next page
curl -H "authorization: your-api-key" \
"https://api.capgo.app/channel/?app_id=com.example.app&page=1"
interface Channel {
id: number
created_at: string
updated_at: string
name: string
app_id: string
created_by: string
public: boolean
disableAutoUpdateUnderNative: boolean
disableAutoUpdate: DisableAutoUpdate
allow_device_self_set: boolean
allow_emulator: boolean
allow_device: boolean
allow_dev: boolean
allow_prod: boolean
version: { id: number, name: string } | null // stable bundle
// These three response identifiers intentionally use snake_case.
rollout_version: number | null
rollout_id: string
rollout_version_info: { id: number, name: string } | null
rolloutPercentageBps: number
rolloutEnabled: boolean
rolloutPausedAt: string | null
rolloutPauseReason: string | null
rolloutCacheTtlSeconds: number
autoPauseEnabled: boolean
autoPauseWindowMinutes: number
autoPauseFailureRateBps: number | null
autoPauseConfidence: number
autoPauseMinAttempts: number | null
autoPauseMinFailures: number | null
autoPauseAction: AutoPauseAction
autoPauseCooldownMinutes: number
autoPauseLastTriggeredAt: string | null
autoPauseLastCheckedAt: string | null
}

rolloutPaused ロールアウトが一時停止している場合、非 null の値が返されます。 rolloutPausedAt.

[
{
"id": 1,
"name": "production",
"app_id": "com.example.app",
"version": { "id": 1, "name": "1.2.0" },
"rollout_version": 2,
"rollout_id": "e60c19c9-2e65-4e0d-bc06-d1f5b4f96276",
"rollout_version_info": { "id": 2, "name": "1.3.0" },
"rolloutPercentageBps": 500,
"rolloutEnabled": true,
"rolloutPausedAt": null,
"rolloutCacheTtlSeconds": 2592000,
"autoPauseEnabled": true,
"autoPauseFailureRateBps": 500,
"autoPauseAction": "pause"
}
]

https://api.capgo.app/channel/

このチャンネルを使用しているすべてのデバイスに影響を与えるため、チャンネルを削除します。

interface Channel {
channel: string
app_id: string
delete_bundle?: boolean // also delete the linked bundle
}
ターミナル画面
curl -X DELETE \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"app_id": "com.example.app",
"channel": "beta"
}' \
https://api.capgo.app/channel/
{
"status": "ok"
}

delete_bundle: truekeyは、自身が作成したチャンネルと紐付けられた、共有されていないバンドルを含む、自身が作成したチャンネルのみを、原子的にクリーンアップすることができます。keyは、一般的な app_preview 許可を受けません。 bundle.delete ターミナルウィンドウ

コピー
curl -X DELETE \
-H "capgkey: $CAPGO_API_KEY" \
-H "Content-Type: application/json" \
-d '{
"app_id": "com.example.app",
"channel": "pr-123",
"delete_bundle": true
}' \
https://api.capgo.app/channel/

Section titled “エラーハンドリング”

Section titled “__CAPGO_KEEP_0__”

一般的なエラーシナリオとその対応:

// Channel not found
{
"error": "Channel not found",
"status": "KO"
}
// Invalid bundle (version) format
{
"error": "Invalid version format. Use semantic versioning",
"status": "KO"
}
// Invalid update policy
{
"error": "Invalid disableAutoUpdate value",
"status": "KO"
}
// Permission denied
{
"error": "Insufficient permissions to manage channels",
"status": "KO"
}
  1. ベータテスト
{
"app_id": "com.example.app",
"channel": "beta",
"version": "1.2.0-beta",
"public": false,
"allow_emulator": true,
"allow_dev": true
}
  1. 本番展開
{
"app_id": "com.example.app",
"channel": "production",
"version": "1.2.0",
"public": true,
"disableAutoUpdate": "minor"
}
  1. プラットフォーム固有の更新
{
"app_id": "com.example.app",
"channel": "ios-hotfix",
"version": "1.2.1",
"ios": true,
"android": false
}

__CAPGO_KEEP_0__ __CAPGO_KEEP_1__ __CAPGO_KEEP_2__ __CAPGO_KEEP_3__ __CAPGO_KEEP_4__ __CAPGO_KEEP_5__ __CAPGO_KEEP_6__ __CAPGO_KEEP_7__ __CAPGO_KEEP_8__ __CAPGO_KEEP_9__ __CAPGO_KEEP_10__ Capgo Environment Best Practices: Staging with One Mobile App ID Capgo 環境のベストプラクティス: ステージング用に 1 つのモバイル アプリ ID を使用する。