기기
이 플러그인의 설치 단계와 전체 마크다운 가이드를 포함한 설정 명령어를 복사하세요.
Devices represent individual installations of your app that are managed by Capgo. The Devices API allows you to track and manage devices, including their bundles (versions), channels, and update status.
장치가 마지막으로 활동한 이후에 자동으로 제거된다. __CAPGO_KEEP_0__과 연결하지 않은 장치들은.
장치 이해장치 이해
- 각 장치에는 고유한 특성과 상태가 있다.플랫폼
- : iOS, Android, 또는 Electron: 현재 번들 (버전) 및 네이티브 빌드 버전
- 환경: 프로덕션 또는 개발, 에뮬레이터 또는 물리적 장치
- 채널: 현재 업데이트 채널 assignments
- 커스텀 ID: 사용자 지정 추적 목적으로 자신의 ID
최선의 방법
Section titled “최선의 방법”- 번들 (버전) 추적: 장치 번들 (버전) 채택을 보장하기 위해 업데이트 수용을 모니터링
- 채널 관리: __CAPGO_KEEP_0__을 위한 적절한 채널에 장치 할당
- 환경 인식: 개발/에뮬레이터/생산 환경에 따라 적절하게 처리
- 사용자 정의 식별: 기존 시스템과 통합하기 위해 사용자 정의 ID 사용
엔드포인트
엔드포인트 섹션POST
POST 섹션https://api.capgo.app/device/
특정 버전 또는 채널에 장치 연결
요청 본문
요청 본문 섹션interface DeviceLink { app_id: string device_id: string version_id?: string // bundle (version) name channel?: string // channel name}예제 요청
예제 요청 섹션curl -X POST \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "app_id": "app_123", "device_id": "device_456", "channel": "beta" }' \ https://api.capgo.app/device/성공 응답
성공 응답 섹션{ "status": "ok"}https://api.capgo.app/device/
쿼리 매개변수
__CAPGO_KEEP_0__
Section titled “Query Parameters”app_id: __CAPGO_KEEP_0__. __CAPGO_KEEP_0__device_id: 필수. __CAPGO_KEEP_0__cursor: 선택. 특정 장치 ID를 통해 단일 장치를 가져올 때limit: 선택. 이전 응답에서 커서를 가져오기 위한 페이징
: 선택. 한 페이지당 장치 수 (기본값: 50)
Example Requests# Get all devices (first page)curl -H "authorization: your-api-key" \ "https://api.capgo.app/device/?app_id=app_123"
# Get specific devicecurl -H "authorization: your-api-key" \ "https://api.capgo.app/device/?app_id=app_123&device_id=device_456"
# Get next page using cursorcurl -H "authorization: your-api-key" \ "https://api.capgo.app/device/?app_id=app_123&cursor=2024-01-01T00:00:00Z|device_456"Section titled “Response Type (List)” device_id __CAPGO_KEEP_0__ (parameter):
interface DeviceListResponse { data: Device[]; nextCursor?: string; // Pass this as 'cursor' param to get next page hasMore: boolean; // true if more pages available}
interface Device { updated_at: string; device_id: string; custom_id: string; version?: number; // bundle (version) id version_name: string | null; // bundle (version) name channel?: string; app_id: string; platform: "ios" | "android" | "electron"; plugin_version: string; os_version: string; version_build: string; is_prod: boolean; is_emulator: boolean; key_id: string | null; // First 4 chars of encryption key (e.g., "MIIB")}__CAPGO_KEEP_2__ (단일 기기)
__CAPGO_KEEP_3__ titled “__CAPGO_KEEP_2__ (단일 기기)”__CAPGO_KEEP_4__ 특정 기기를 요청할 때 device_id __CAPGO_KEEP_0__, __CAPGO_KEEP_5__ 기기 객체를 직접 반환합니다.
interface Device { updated_at: string; device_id: string; custom_id: string; version?: number; // bundle (version) id version_name: string | null; // bundle (version) name channel?: string; app_id: string; platform: "ios" | "android" | "electron"; plugin_version: string; os_version: string; version_build: string; is_prod: boolean; is_emulator: boolean; key_id: string | null; // First 4 chars of encryption key (e.g., "MIIB")}__CAPGO_KEEP_6__ (목록)
__CAPGO_KEEP_7__ titled “__CAPGO_KEEP_6__ (목록)”{ "data": [ { "device_id": "device_456", "custom_id": "test-device-1", "version": 1, "version_name": "1.0.0", "app_id": "app_123", "platform": "ios", "plugin_version": "5.0.0", "os_version": "17.0", "version_build": "1", "is_prod": true, "is_emulator": false, "updated_at": "2024-01-01T00:00:00Z" } ], "nextCursor": "2024-01-01T00:00:00Z|device_456", "hasMore": true}__CAPGO_KEEP_8__ (단일 기기)
__CAPGO_KEEP_9__ titled “__CAPGO_KEEP_8__ (단일 기기)”{ "device_id": "device_456", "custom_id": "test-device-1", "version": 1, "version_name": "1.0.0", "app_id": "app_123", "platform": "ios", "plugin_version": "5.0.0", "os_version": "17.0", "version_build": "1", "is_prod": true, "is_emulator": false, "updated_at": "2024-01-01T00:00:00Z", "channel": "production"}삭제
삭제 섹션https://api.capgo.app/device/
기본 채널을 사용하도록 기기에서 채널 오버라이드와 연결을 끊습니다. 이로 인해 기기는 기본 채널을 사용하도록 다시 설정됩니다.
활성 기기는 지속적으로 추적됩니다.
쿼리 매개변수interface Device { device_id: string app_id: string}예시 요청
예시 요청 섹션curl -X DELETE \ -H "authorization: your-api-key" \ -H "Content-Type: application/json" \ -d '{ "app_id": "app_123", "device_id": "device_456" }' \ https://api.capgo.app/device/성공 응답
성공 응답 섹션{ "status": "ok"}오류 처리
오류 처리 섹션일반 오류 시나리오 및 응답:
// Device not found{ "error": "Device not found", "status": "KO"}
// Invalid bundle (version){ "error": "Version not found", "status": "KO"}
// Invalid channel{ "error": "Channel not found", "status": "KO"}
// Permission denied{ "error": "Insufficient permissions to manage devices", "status": "KO"}일반적인 사용 사례
Section titled “공통 사용 사례”- 베타 장치 등록
{ "app_id": "app_123", "device_id": "device_456", "channel": "beta"}- 버전 오버라이드
{ "app_id": "app_123", "device_id": "device_456", "version_id": "1.1.0"}- 기본 채널으로 초기화
// Use DELETE endpoint to remove overrides장치 관리 팁
Section titled “장치 관리 팁”- 모니터링장치 상태 및 배포 버전을 정기적으로 확인합니다.
- 테스트: __CAPGO_KEEP_0__을 사용하여 테스트 장치를 쉽게 식별하세요.
- 문제 해결: 장치 업데이트와 채널 assignments를 추적하세요.
- 원본 버전 관리: 네이티브 앱 버전을 확인하여 호환성을 보장하세요.