콘텐츠로 건너뛰기

Devices

Devices는 Capgo에서 관리하는 앱의 개별 설치를 나타냅니다. Devices API를 사용하면 버전, 채널 및 업데이트 상태를 포함한 기기를 추적하고 관리할 수 있습니다.

각 기기는 고유한 특성과 상태를 가지고 있습니다:

  • Platform: iOS 또는 Android
  • Version: 현재 번들 버전 및 네이티브 빌드 버전
  • Environment: 프로덕션 또는 개발, 에뮬레이터 또는 물리적 기기
  • Channel: 현재 업데이트 채널 할당
  • Custom ID: 자체 추적 목적을 위한 선택적 식별자
  1. 버전 추적: 업데이트 채택을 보장하기 위해 기기 버전을 모니터링합니다
  2. 채널 관리: 테스트 요구 사항에 따라 적절한 채널에 기기를 할당합니다
  3. 환경 인식: 다양한 환경(프로덕션/개발/에뮬레이터)을 적절하게 처리합니다
  4. 사용자 정의 식별: 기존 시스템과 통합하기 위해 사용자 정의 ID를 사용합니다

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

기기를 특정 버전 또는 채널에 연결합니다.

interface DeviceLink {
app_id: string
device_id: string
version_id?: string // version name
channel?: string // channel name
}
Terminal window
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: 필수. 앱의 ID
  • device_id: 선택사항. 단일 기기를 검색하기 위한 특정 기기 ID
  • cursor: 선택사항. 페이지네이션을 위한 이전 응답의 커서
  • limit: 선택사항. 페이지당 기기 수 (기본값: 50)
Terminal window
# 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"

여러 기기를 요청할 때 (device_id 매개변수 없음):

interface DeviceListResponse {
data: Device[];
nextCursor?: string; // 다음 페이지를 가져오려면 이것을 'cursor' 매개변수로 전달하세요
hasMore: boolean; // 더 많은 페이지가 있으면 true
}
interface Device {
updated_at: string;
device_id: string;
custom_id: string;
version?: number;
version_name: string | null;
channel?: string;
app_id: string;
platform: "ios" | "android";
plugin_version: string;
os_version: string;
version_build: string;
is_prod: boolean;
is_emulator: boolean;
}

device_id 매개변수로 특정 기기를 요청하면 기기 객체를 직접 반환합니다:

interface Device {
updated_at: string;
device_id: string;
custom_id: string;
version?: number;
version_name: string | null;
channel?: string;
app_id: string;
platform: "ios" | "android";
plugin_version: string;
os_version: string;
version_build: string;
is_prod: boolean;
is_emulator: boolean;
}
{
"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
}
Terminal window
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 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. Beta Device Registration
{
"app_id": "app_123",
"device_id": "device_456",
"channel": "beta"
}
  1. Version Override
{
"app_id": "app_123",
"device_id": "device_456",
"version_id": "1.1.0"
}
  1. Reset to Default Channel
// Use DELETE endpoint to remove overrides
  1. 모니터링: 기기 상태와 버전 분포를 정기적으로 확인합니다
  2. 테스트: 사용자 정의 ID를 사용하여 테스트 기기를 쉽게 식별합니다
  3. 문제 해결: 기기 업데이트 및 채널 할당을 추적합니다
  4. 버전 관리: 호환성을 보장하기 위해 네이티브 앱 버전을 모니터링합니다