본문 바로가기

기기

Devices는 Capgo에 업데이트 메타데이터를 보고하는 개별 앱 설치입니다. 이 API을 사용하여 해당 메타데이터를 가져오거나, 기기별 프라이빗 채널 오버라이드를 설정 및 제거할 수 있습니다.

디바이스 메타데이터

“디바이스 메타데이터” 섹션

각 레코드에는 디바이스 ID, 플랫폼, updater 및 OS 버전, Native Build, 설치된 bundle, 프로덕션 및 에뮬레이터 상태, custom ID, channel override가 포함될 수 있습니다.

사용 가능한 경우, country_code 는 해당 디바이스에 대해 Cloudflare에서 처리된 요청으로부터 수신한 최신 유효 2자리 ISO 3166-1 국가 code입니다. 이는 GPS 또는 앱에서 제공한 위치 값이 아닙니다. 다음과 같을 수 있습니다. null 사용할 수 없을 때, 이 필드가 필요하면 단일 디바이스 조회를 사용하세요.

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

디바이스별 오버라이드를 다음으로 설정: 비공개 channel. 디바이스에 사용할 bundle을 선택하려면 해당 bundle을 channel에 할당하세요. 디바이스별 직접 bundle 오버라이드는 지원되지 않습니다. 오버라이드는 다시 POST하지 않으면 마지막 쓰기 후 90일이 지나면 만료됩니다.

interface DeviceChannelOverride {
app_id: string; // reverse-domain app ID, for example com.example.app
device_id: string;
channel: string; // existing non-public channel name
}
터미널 창
curl -X POST \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"app_id": "com.example.app",
"device_id": "device_456",
"channel": "beta"
}' \
https://api.capgo.app/device/

공개 채널은 디바이스 오버라이드로 사용할 수 없습니다.

{
"status": "ok"
}

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

디바이스 메타데이터를 가져옵니다. 다음을 생략하면 결과가 커서 페이지네이션됩니다. device_id.

  • app_id: 필수 역도메인 앱 ID, 예: com.example.app.
  • device_id: 선택적 디바이스 ID. 지정 시 응답이 페이지네이션된 목록이 아닌 단일 디바이스가 됩니다.
  • customIdMode: 선택적 불리언 값. true 으로 설정하면 비어 있지 않은 custom_id.
  • cursor: 이전 목록 응답에서 가져온 선택적 커서.
  • limit: 페이지당 디바이스 수(선택적).
터미널 창
# Get the first page
curl -H "authorization: your-api-key" \
"https://api.capgo.app/device/?app_id=com.example.app"
# Get one device, including its request-derived country when available
curl -H "authorization: your-api-key" \
"https://api.capgo.app/device/?app_id=com.example.app&device_id=device_456"
# Get only devices with a custom ID
curl -H "authorization: your-api-key" \
"https://api.capgo.app/device/?app_id=com.example.app&customIdMode=true"
# Get the next page
curl -H "authorization: your-api-key" \
"https://api.capgo.app/device/?app_id=com.example.app&cursor=2024-01-01T00:00:00Z%7Cdevice_456"
interface DeviceListResponse {
data: Device[];
nextCursor?: string;
hasMore: boolean;
}
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" | "electron";
plugin_version: string;
os_version: string;
version_build: string;
is_prod: boolean;
is_emulator: boolean;
key_id: string | null;
install_source: string | null;
country_code: string | null;
}

country_code Capgo에 유효한 Cloudflare 기반 국가 code가 저장된 경우, 디바이스별 조회를 통해 값이 설정됩니다. 유효한 국가 정보가 없는 요청은 마지막 유효 값을 지우지 않으며, 목록 응답은 다음 값을 반환할 수 있습니다. null 이 필드에 대해.

{
"data": [
{
"device_id": "device_456",
"custom_id": "test-device-1",
"version": 1,
"version_name": "1.0.0",
"app_id": "com.example.app",
"platform": "ios",
"plugin_version": "5.0.0",
"os_version": "17.0",
"version_build": "1",
"is_prod": true,
"is_emulator": false,
"key_id": null,
"install_source": null,
"country_code": null,
"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": "com.example.app",
"platform": "ios",
"plugin_version": "5.0.0",
"os_version": "17.0",
"version_build": "1",
"is_prod": true,
"is_emulator": false,
"key_id": "MIIB",
"install_source": null,
"country_code": "FR",
"updated_at": "2024-01-01T00:00:00Z",
"channel": "beta"
}

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

기기의 채널 오버라이드를 제거합니다. 기기는 다시 일반적인 채널 선택을 사용하며, 이 엔드포인트는 메타데이터 기록을 삭제하지 않습니다.

Request body 또는 쿼리 파라미터

“Request body 또는 쿼리 파라미터” 섹션
interface DeviceOverrideRemoval {
app_id: string;
device_id: string;
}
터미널 창
curl -X DELETE \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"app_id": "com.example.app",
"device_id": "device_456"
}' \
https://api.capgo.app/device/
{
"status": "ok"
}

에러는 HTTP 에러 상태 코드와 JSON 바디를 사용합니다. error 및 message 다음과 같은 필드를 포함합니다. 일반적인 에러 코드는 다음과 같습니다:

  • invalid_app_id 할 때 app_id 역도메인 식별자가 아닙니다.
  • device_not_found 알 수 없는 디바이스 조회 시 발생합니다.
  • channel_not_found 요청한 채널이 존재하지 않을 때 발생합니다.
  • public_channel_override 디바이스를 공개 채널로 오버라이드하려고 할 때 발생합니다.
  • invalid_version_id 직접 번들 오버라이드를 시도할 때 발생합니다. 대신 채널을 사용하세요.
  • cannot_access_app 또는 cannot_access_channel API 키에 필요한 권한이 없는 경우.

일반적인 사용 사례

“주요 사용 사례” 섹션
  1. 테스트 기기를 프라이빗 베타 채널로 이동

    {
    "app_id": "com.example.app",
    "device_id": "device_456",
    "channel": "beta"
    }
  2. 기기 채널 선택을 기본값으로 초기화

    트레이드오프를 평가하려면 DELETE 앱 및 기기 ID가 포함된 엔드포인트.

Devices에서 계속하기

“Devices에서 계속하기” 섹션

사용 중이라면 기기 채널 라우팅과 단계적 배포를 계획하려면, 다음을 연결하세요: 채널 Channels의 구현 세부 사항은 다음을 참고하세요: 채널 Channels의 구현 세부 사항은 다음을 참고하세요: 채널 Channels의 구현 세부 사항은 다음을 참고하세요: Beta Testing 솔루션 Beta Testing 솔루션의 제품 워크플로우를 위한, 그리고 버전 타겟팅 솔루션 Version Targeting Solution의 제품 워크플로우용.