내용으로 건너뛰기

기기

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
  1. 번들 (버전) 추적: 장치 번들 (버전) 채택을 보장하기 위해 업데이트 수용을 모니터링
  2. 채널 관리: __CAPGO_KEEP_0__을 위한 적절한 채널에 장치 할당
  3. 환경 인식: 개발/에뮬레이터/생산 환경에 따라 적절하게 처리
  4. 사용자 정의 식별: 기존 시스템과 통합하기 위해 사용자 정의 ID 사용

엔드포인트

엔드포인트 섹션

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/

쿼리 매개변수

  • app_id: __CAPGO_KEEP_0__. __CAPGO_KEEP_0__
  • device_id: 필수. __CAPGO_KEEP_0__
  • cursor: 선택. 특정 장치 ID를 통해 단일 장치를 가져올 때
  • limit: 선택. 이전 응답에서 커서를 가져오기 위한 페이징

: 선택. 한 페이지당 장치 수 (기본값: 50)

Example Requests
Section titled “Example Requests”
# Get all devices (first page)
curl -H "authorization: your-api-key" \
"https://api.capgo.app/device/?app_id=app_123"
# Get specific device
curl -H "authorization: your-api-key" \
"https://api.capgo.app/device/?app_id=app_123&device_id=device_456"
# Get next page using cursor
curl -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_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")
}
{
"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
}
{
"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"
}
  1. 베타 장치 등록
{
"app_id": "app_123",
"device_id": "device_456",
"channel": "beta"
}
  1. 버전 오버라이드
{
"app_id": "app_123",
"device_id": "device_456",
"version_id": "1.1.0"
}
  1. 기본 채널으로 초기화
// Use DELETE endpoint to remove overrides
  1. 모니터링장치 상태 및 배포 버전을 정기적으로 확인합니다.
  2. 테스트: __CAPGO_KEEP_0__을 사용하여 테스트 장치를 쉽게 식별하세요.
  3. 문제 해결: 장치 업데이트와 채널 assignments를 추적하세요.
  4. 원본 버전 관리: 네이티브 앱 버전을 확인하여 호환성을 보장하세요.