콘텐츠로 건너뛰기

Apps

Apps는 Capgo의 기본 엔티티입니다. 각 앱은 플랫폼을 통해 관리하고 업데이트할 수 있는 고유한 Capacitor 애플리케이션을 나타냅니다. Apps API를 사용하면 앱 구성을 생성, 검색, 업데이트 및 삭제할 수 있습니다.

Capgo의 앱은 Capacitor 애플리케이션을 나타내며 다음을 포함합니다:

  • App ID: 애플리케이션의 고유 식별자
  • Name: 애플리케이션의 사람이 읽을 수 있는 이름
  • Icons: 대시보드에서 앱의 시각적 식별자
  • Configuration: 업데이트 전달 방법을 제어하는 설정
  • Ownership: 조직 및 사용자 액세스 정보
  • Usage Statistics: 설치 및 업데이트에 대한 메트릭
  1. 명명 규칙: 앱에 명확하고 식별 가능한 이름 사용
  2. 보안: API 키 및 액세스 자격 증명 보호
  3. 조직화: 관련 앱을 동일한 조직 아래에 그룹화
  4. 모니터링: 앱 통계 및 성능을 정기적으로 확인
  5. 백업: 중요한 앱의 구성 백업 유지

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

앱에 대한 정보를 검색합니다.

  • page: 선택 사항. 페이지네이션을 위한 페이지 번호
  • limit: 선택 사항. 페이지당 결과 수 (기본값: 50)
  • org_id: 선택 사항. 조직 ID로 앱 필터링. 제공되지 않으면 사용자가 액세스할 수 있는 모든 조직의 앱을 반환합니다

특정 앱을 가져오려면:

  • URL 경로에 앱 ID 사용: https://api.capgo.app/app/:app_id
interface App {
app_id: string
created_at: string | null
default_upload_channel: string
icon_url: string
id: string | null
last_version: string | null
name: string | null
owner_org: string
retention: number
transfer_history: Json[] | null
updated_at: string | null
user_id: string | null
}
Terminal window
# Get all apps
curl -H "authorization: your-api-key" \
"https://api.capgo.app/app/"
# Get apps from a specific organization
curl -H "authorization: your-api-key" \
"https://api.capgo.app/app/?org_id=046a36ac-e03c-4590-9257-bd6c9dba9ee8"
# Get specific app
curl -H "authorization: your-api-key" \
"https://api.capgo.app/app/com.demo.app"
{
"data": [
{
"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"
}
]
}

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

새 앱을 생성합니다.

interface CreateApp {
app_id: string
name: string
icon?: string
owner_org: string
}
Terminal window
# Create new app
curl -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/
{
"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"
}

https://api.capgo.app/app/:app_id

기존 앱을 업데이트합니다. 앱 ID는 URL 경로에 지정됩니다.

interface UpdateApp {
name?: string
icon?: string
retention?: number
}
Terminal window
curl -X PUT \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"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",
"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 경로에 지정됩니다. 이 작업은 되돌릴 수 없으므로 극도로 주의하여 사용하십시오.

Terminal window
curl -X DELETE \
-H "authorization: your-api-key" \
https://api.capgo.app/app/com.demo.app
{
"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"
}
  1. Create New App
// Set up a new app
{
"name": "Production App",
"owner_org": "046a36ac-e03c-4590-9257-bd6c9dba9ee8"
}
  1. Update App Configuration
// Change app name and icon
{
"name": "Rebranded App Name",
"icon": "https://example.com/new-icon.png"
}
  1. Set Retention Policy
// Configure automatic bundle cleanup
{
"retention": 30 // Keep bundles for 30 days
}
  1. Get Apps by Organization
Terminal window
# List all apps in a specific organization
curl -H "authorization: your-api-key" \
"https://api.capgo.app/app/?org_id=046a36ac-e03c-4590-9257-bd6c9dba9ee8"
  1. 스토리지 최적화: 스토리지 사용량을 모니터링하고 적절한 보존 정책 설정
  2. 조직화: 관련 앱을 단일 조직 아래에 그룹화
  3. 액세스 제어: 앱 설정을 수정할 수 있는 팀 구성원 관리
  4. 백업 전략: 중요한 앱 구성 및 설정 백업