アプリ
インストール手順と、このプラグインの完全なMarkdownガイドを含むセットアッププロンプトをコピーします。
Apps は Capgo の基盤となるエンティティです。各 App は、プラットフォームを通じて管理・更新できる独自の Capacitor アプリケーションを表します。Apps API を使用して、アプリ設定の作成、取得、更新、削除を行うことができます。
Appsの概要
「Apps の理解」セクションCapgo における App は、あなたの Capacitor アプリケーションを表し、以下を含みます:
- App ID:アプリケーションの一意な識別子
- 名称: アプリケーションの人間が読める名前
- アイコン: ダッシュボード上のアプリのビジュアル識別子
- 設定: アップデート配信を制御する設定
- 所有権: 組織とユーザーのアクセス情報
- 利用統計: インストールとアップデートのメトリクス
ベストプラクティス
「ベストプラクティス」セクション- 命名規則: アプリには明確で識別しやすい名前を付けてください
- セキュリティ: API キーとアクセス認証情報を保護します
- 組織: 関連するアプリを同じ組織内にグループ化します
- モニタリング: アプリの統計情報とパフォーマンスを定期的に確認します
- バックアップ: 重要なアプリの設定バックアップを維持します
エンドポイント
「Endpoints」セクションGET
「GET」セクションhttps://api.capgo.app/app/
アプリに関する情報を取得します。
クエリパラメータ
「Query Parameters」セクションpage: 任意。ページネーション用のページ番号limit: 任意。1ページあたりの結果数(デフォルト: 50)org_id: 任意。組織IDでアプリをフィルタリングします。指定しない場合、ユーザーがアクセス可能なすべての組織のアプリが返されます
特定のアプリを取得するには:
- URLパスにアプリIDを使用します:
https://api.capgo.app/app/:app_id
レスポンス型
「Response Type」セクション注意: last_version アプリにアップロードされた最後のバンドル(バージョン)を指します。
interface App { app_id: string block_provider_infra_requests: boolean created_at: string | null default_upload_channel: string icon_url: string id: string | null last_version: string | null // last bundle (version) name name: string | null owner_org: string retention: number transfer_history: Json[] | null updated_at: string | null user_id: string | null}リクエスト例
「リクエスト例」のセクション# Get all appscurl -H "authorization: your-api-key" \ "https://api.capgo.app/app/"
# Get apps from a specific organizationcurl -H "authorization: your-api-key" \ "https://api.capgo.app/app/?org_id=046a36ac-e03c-4590-9257-bd6c9dba9ee8"
# Get specific appcurl -H "authorization: your-api-key" \ "https://api.capgo.app/app/com.demo.app"レスポンス例
「レスポンス例」というタイトルのセクション{ "data": [ { "block_provider_infra_requests": true, "app_id": "com.demo.app", "created_at": "2024-01-01T00:00:00Z", "default_upload_channel": "dev", "icon_url": "https://example.com/icon.png", "id": "550e8400-e29b-41d4-a716-446655440000", "last_version": "1.0.0", "name": "Demo App", "owner_org": "046a36ac-e03c-4590-9257-bd6c9dba9ee8", "retention": 2592000, "transfer_history": null, "updated_at": "2024-01-01T00:00:00Z", "user_id": "6aa76066-55ef-4238-ade6-0b32334a4097" } ]}POST
「POST」セクションhttps://api.capgo.app/app/
新しいアプリを作成します。
リクエストボディ
「リクエストボディ」のセクションinterface CreateApp { app_id: string name: string icon?: string owner_org: string}リクエスト例
「リクエスト例」のセクション# Create new appcurl -X POST \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "name": "My New App", "app_id": "com.demo.myapp", // this id is unique in Capgo This cannot be reused by any account. "icon": "https://example.com/icon.png", "owner_org": "046a36ac-e03c-4590-9257-bd6c9dba9ee8" }' \ https://api.capgo.app/app/成功時のレスポンス
「成功時のレスポンス」のセクション{ "block_provider_infra_requests": true, "app_id": "My New App", "created_at": "2024-01-01T00:00:00Z", "default_upload_channel": "dev", "icon_url": "https://example.com/icon.png", "id": "550e8400-e29b-41d4-a716-446655440000", "name": "My New App", "owner_org": "046a36ac-e03c-4590-9257-bd6c9dba9ee8", "retention": 2592000, "updated_at": "2024-01-01T00:00:00Z"}PUT
「PUT」のセクションhttps://api.capgo.app/app/:app_id
既存のアプリを更新します。アプリIDはURLパスで指定します。
リクエストボディ
「リクエストボディ」のセクションinterface UpdateApp { block_provider_infra_requests?: boolean name?: string icon?: string retention?: number}リクエスト例
「リクエスト例」のセクションcurl -X PUT \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "block_provider_infra_requests": true, "name": "Updated App Name", "icon": "https://example.com/updated-icon.png", "retention": 45 }' \ https://api.capgo.app/app/com.demo.app成功時のレスポンス
「成功時のレスポンス」のセクション{ "app_id": "com.demo.app", "created_at": "2024-01-01T00:00:00Z", "default_upload_channel": "dev", "block_provider_infra_requests": true, "icon_url": "https://example.com/updated-icon.png", "id": "550e8400-e29b-41d4-a716-446655440000", "name": "Updated App Name", "owner_org": "046a36ac-e03c-4590-9257-bd6c9dba9ee8", "retention": 45, "updated_at": "2024-01-01T00:00:00Z"}https://api.capgo.app/app/:app_id
アプリと関連するすべてのリソースを削除します。アプリIDはURLパスで指定します。この操作は取り消せないため、細心の注意を払って使用してください。
リクエスト例
「リクエスト例」のセクションcurl -X DELETE \ -H "authorization: your-api-key" \ https://api.capgo.app/app/com.demo.app成功時のレスポンス
「成功時のレスポンス」のセクション{ "status": "ok"}エラーハンドリング
「エラーハンドリング」セクションすべてのエラーは、以下で説明する標準エラー形式に従います API の概要.
よくあるエラーシナリオとそのレスポンス:
// Missing or invalid API key (HTTP 401){ "error": "invalid_apikey", "message": "Invalid apikey", "moreInfo": {}}
// app_id is not a reverse-domain identifier{ "error": "invalid_app_id", "message": "App ID must be a reverse domain string", "moreInfo": { "app_id": "my app" }}
// The API key has no access to this app (HTTP 401){ "error": "cannot_access_app", "message": "You can't access this app", "moreInfo": { "app_id": "com.example.app" }}
// Creating an app in an organization the key cannot write to (HTTP 403){ "error": "cannot_access_organization", "message": "You can't access this organization", "moreInfo": { "org_id": "046a36ac-e03c-4590-9257-bd6c9dba9ee8" }}
// Retention above the two-year limit on update{ "error": "retention_to_big", "message": "Retention cannot be bigger than 63113903 (2 years)", "moreInfo": { "retention": 99999999 }}よくあるユースケース
「よくあるユースケース」セクション- 新しいAppを作成
// Set up a new app{ "name": "Production App", "owner_org": "046a36ac-e03c-4590-9257-bd6c9dba9ee8"}- Appの設定を更新
// Change app name and icon{ "name": "Rebranded App Name", "icon": "https://example.com/new-icon.png"}- 保持ポリシーを設定
// Configure automatic bundle cleanup{ "retention": 30 // Keep bundles for 30 days}- Organization別にAppを取得
# List all apps in a specific organizationcurl -H "authorization: your-api-key" \ "https://api.capgo.app/app/?org_id=046a36ac-e03c-4590-9257-bd6c9dba9ee8"リソース管理
「リソース管理」セクション- ストレージの最適化: ストレージ使用量を監視し、適切な保持ポリシーを設定します
- 組織: 関連するアプリを1つの組織にまとめます
- アクセス制御: アプリ設定を変更できるチームメンバーを管理します
- バックアップ戦略: 重要なアプリの構成と設定をバックアップします
Appsから続ける
「Appsからの続き」セクション使用している場合 アプリ ダッシュボードと API の運用を計画するには、これを次と連携させます API の概要 「API の概要」の実装の詳細については、 はじめに 「はじめに」における実装の詳細については、 API キー API Keys の実装の詳細については、 デバイス Devices の実装詳細については、および Bundle Bundlesの実装詳細については