앱
이 플러그인의 설치 단계와 전체 마크다운 가이드가 포함된 설정 프롬프트를 복사하세요.
Capgo에서 앱은 기본 엔티티입니다. 각 앱은 플랫폼에서 관리하고 업데이트할 수 있는 고유한 Capacitor 애플리케이션을 나타냅니다. Apps API를 사용하면 앱 설정을 생성, 조회, 수정, 삭제할 수 있습니다.
앱 이해하기
“앱 이해하기” 섹션Capgo의 앱은 Capacitor 애플리케이션을 나타내며 다음을 포함합니다:
- App ID: 애플리케이션의 고유 식별자
- 이름: 사람이 읽을 수 있는 앱 이름
- 아이콘: 대시보드에서 앱의 시각적 식별자
- 설정: 업데이트 전달 방식을 제어하는 설정
- 소유권: 조직 및 사용자 액세스 정보
- 사용량 통계: 설치 및 업데이트 관련 메트릭
모범 사례
“권장 사항” 섹션- 명명 규칙: 앱에 명확하고 식별 가능한 이름을 사용하세요
- 보안: API 키와 액세스 자격 증명을 보호하세요
- 조직: 관련 앱을 동일한 조직 아래에 그룹화하세요
- 모니터링: 앱 통계와 성능을 정기적으로 확인하세요
- 백업: 중요한 앱의 구성 백업을 유지하세요
엔드포인트
“엔드포인트” 섹션GET
“GET” 섹션https://api.capgo.app/app/
앱 정보를 조회합니다.
쿼리 파라미터
“쿼리 파라미터” 섹션page: 선택 사항. 페이지네이션용 페이지 번호limit: 선택 사항. 페이지당 결과 수 (기본값: 50)org_id: 선택 사항. 조직 ID로 앱을 필터링합니다. 제공하지 않으면 사용자가 접근할 수 있는 모든 조직의 앱을 반환합니다.
특정 앱을 조회하려면:
- URL 경로에 앱 ID를 사용하세요:
https://api.capgo.app/app/:app_id
응답 타입
“응답 타입” 섹션참고: last_version 앱에 마지막으로 업로드된 bundle(버전)을 의미합니다.
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}요청 예시
Example Request 섹션# 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/
새 앱을 만듭니다.
요청 본문
Request Body 섹션interface CreateApp { app_id: string name: string icon?: string owner_org: string}요청 예시
Example Request 섹션# 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/성공 응답
Success Response 섹션{ "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 경로에 지정됩니다.
요청 본문
Request Body 섹션interface UpdateApp { block_provider_infra_requests?: boolean name?: string icon?: string retention?: number}요청 예시
Example Request 섹션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성공 응답
Success Response 섹션{ "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
DELETE 섹션https://api.capgo.app/app/:app_id
앱과 모든 관련 리소스를 삭제합니다. 앱 ID는 URL 경로에 지정됩니다. 이 작업은 되돌릴 수 없으므로 각별히 주의해서 사용하세요.
요청 예시
Example Request 섹션curl -X DELETE \ -H "authorization: your-api-key" \ https://api.capgo.app/app/com.demo.app성공 응답
Success Response 섹션{ "status": "ok"}에러 핸들링
“Error Handling” 섹션모든 에러는 다음에 설명된 표준 에러 형식을 사용합니다 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 }}주요 사용 사례
“일반적인 사용 사례” 섹션- 새 앱 생성
// 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에서 계속하기
“Apps에서 계속하기” 섹션사용 중이라면 앱 대시보드 및 API 운영을 계획하려면, 이를 다음과 연결하세요 API 개요 구현 세부 사항은 API 개요에서 소개 구현 세부 사항은 소개에서 API 키 구현 세부 사항은 API 키에서 기기 구현 세부 사항은 기기에서, 그리고 번들 Bundles의 구현 세부 사항은