アプリ
このプラグインのインストール手順とフルマークダウンガイドを含むセットアッププロンプトをコピーします。
アプリはCapgoの基本的なエンティティです。各アプリは一意のCapacitorアプリケーションを表し、プラットフォームを通じて管理および更新できます。アプリのAPIにより、アプリ設定の作成、取得、更新、削除が可能になります。
アプリの理解
「アプリの理解」のセクションCapgoのアプリは、Capacitorアプリケーションを表し、以下の要素を含みます:
- アプリ ID: アプリケーションに一意の識別子
- Name: アプリケーションの人間が読める名前
- Icons: ダッシュボード内のアプリの視覚的識別子
- Configuration: アップデートの配信方法を制御する設定
- Ownership: 組織とユーザーへのアクセス情報
- Usage Statistics: インストールとアップデートに関するメトリクス
ベスト プラクティス
「ベスト プラクティス」- ネーミング コン벤ション: アプリケーションに明確で識別可能な名前を使用する
- セキュリティ: API キーとアクセス クレデンシャルを保護する
- 組織: 関連するアプリケーションを同じ組織下にグループ化する
- 監視: アプリケーションの統計とパフォーマンスを定期的に確認する
- バックアップ: 重要なアプリケーションの構成バックアップを維持する
エンドポイント
「エンドポイント」GET
「GET」https://api.capgo.app/app/
アプリの情報を取得します。
クエリパラメータ
「クエリパラメータ」page: オプション。ページ番号limit: オプション。1ページあたりの結果数 (デフォルト: 50)org_id: オプション。組織IDでアプリをフィルタリングします。指定しない場合は、ユーザーがアクセス可能なすべての組織のアプリを返します。
特定のアプリを取得する場合:
- URLパスにアプリIDを使用してください:
https://api.capgo.app/app/:app_id
レスポンスタイプ
「レスポンスタイプ」セクション注意: 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"}DELETE
Section titled “DELETE”https://api.capgo.app/app/:app_id
アプリとすべての関連リソースを削除します。アプリIDはURLパスで指定されます。このアクションは元に戻すことができないため、極度に注意してください。
Example Request
Section titled “Example Request”curl -X DELETE \ -H "authorization: your-api-key" \ https://api.capgo.app/app/com.demo.appSuccess Response
Section titled “Success Response”{ "status": "ok"}エラー処理
エラー処理一般的なエラーシナリオとその応答:
// App not found{ "error": "App not found", "status": "KO"}
// Duplicate custom ID{ "error": "Custom ID already in use", "status": "KO"}
// Invalid parameters{ "error": "Invalid app configuration", "status": "KO"}
// Permission denied{ "error": "Insufficient permissions to manage app", "status": "KO"}
// Organization access denied{ "status": "You do not have access to this organization"}一般的な使用例
アプリケーションを作成- コピー
// Set up a new app{ "name": "Production App", "owner_org": "046a36ac-e03c-4590-9257-bd6c9dba9ee8"}- コピー
// 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}- 組織のアプリを取得する
# List all apps in a specific organizationcurl -H "authorization: your-api-key" \ "https://api.capgo.app/app/?org_id=046a36ac-e03c-4590-9257-bd6c9dba9ee8"リソース管理
「リソース管理」のセクション- ストレージ最適化: ストレージ使用量を監視し、適切な保持ポリシーを設定する
- 組織: 関連するアプリを単一の組織下にグループ化する
- アクセス制御: チームメンバーがアプリ設定を変更できるように管理する
- バックアップ戦略: バックアップする重要なアプリ設定と設定
Apps
アプリから続けるアプリから続ける Capgoを使用している場合 to plan dashboard and API operations, connect it with API Overview for the implementation detail in API Overview, Capgoの概要の実装詳細 導入 API Keys for the implementation detail in API Keys, デバイス デバイスの実装詳細について バンドル バンドルの実装詳細について