디바이스
이 플러그인의 설치 단계와 전체 markdown 가이드가 포함된 설정 프롬프트를 복사하세요.
Device는 Capgo에 업데이트 메타데이터를 보고하는 개별 앱 설치 단위입니다. 이 API을 사용하여 해당 메타데이터를 조회하거나, 디바이스별 전용 private-channel 오버라이드를 설정 및 삭제할 수 있습니다.
디바이스 메타데이터
“디바이스 메타데이터” 섹션각 레코드에는 디바이스 ID, 플랫폼, updater 및 OS 버전, Native Build, 설치된 bundle, 프로덕션 및 에뮬레이터 상태, custom ID, channel override가 포함될 수 있습니다.
사용 가능한 경우, country_code 는 해당 디바이스에 대해 Cloudflare에서 처리한 요청에서 받은 최신 유효 2자리 ISO 3166-1 국가 code입니다. GPS나 앱에서 제공한 위치 값이 아닙니다. 값은 null 사용할 수 없을 때는 비어 있을 수 있습니다. 이 필드가 필요하면 단일 디바이스 조회를 사용하세요.
엔드포인트
EndpointsPOST
POSThttps://api.capgo.app/device/
특정 기기에 대한 override 설정하기 private 설정합니다. 디바이스별 번들을 선택하려면 해당 번들을 채널에 할당하세요. 디바이스별 직접 번들 오버라이드는 지원되지 않습니다. 오버라이드는 다시 POST를 호출하지 않는 한 마지막 쓰기 작업 후 90일이 지나면 만료됩니다.
요청 본문
Request bodyinterface DeviceChannelOverride { app_id: string; // reverse-domain app ID, for example com.example.app device_id: string; channel: string; // existing non-public channel name}요청 예시
Example requestcurl -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/Public 채널은 디바이스 오버라이드용으로 사용할 수 없습니다.
성공 응답
“성공 응답” 섹션{ "status": "ok"}GET
“GET” 섹션https://api.capgo.app/device/
디바이스 메타데이터를 가져옵니다. 쿼리 파라미터를 생략하면 device_id.
쿼리 파라미터
“쿼리 파라미터” 섹션app_id: 필수 역도메인(reverse-domain) 앱 ID (예:com.example.app.device_id: 선택 사항인 device ID입니다. ID를 입력하면 페이지네이션된 목록 대신 단일 디바이스 정보를 반환합니다.customIdMode: 선택 사항인 boolean 값입니다.true를 사용하여 비어 있지 않은 디바이스만 반환하려면custom_id.cursor: 이전 목록 응답에서 받은 선택 사항인 cursor입니다.limit: 페이지당 디바이스 개수를 지정하는 선택 사항인 number입니다.
요청 예시
“요청 예시” 섹션# Get the first pagecurl -H "authorization: your-api-key" \ "https://api.capgo.app/device/?app_id=com.example.app"
# Get one device, including its request-derived country when availablecurl -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 IDcurl -H "authorization: your-api-key" \ "https://api.capgo.app/device/?app_id=com.example.app&customIdMode=true"
# Get the next pagecurl -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"}DELETE
“DELETE” 제목 섹션https://api.capgo.app/device/
디바이스의 채널 오버라이드를 제거합니다. 디바이스는 다시 일반적인 채널 선택 방식을 사용하게 됩니다. 이 엔드포인트는 디바이스의 메타데이터 레코드를 삭제하지는 않습니다.
Request body 또는 query parameters
“Request body 또는 query parameters” 섹션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 body를 사용합니다: error 및 message fields. 주요 에러 코드는 다음과 같습니다:
invalid_app_id일 때app_id은(는) 역도메인 식별자가 아닙니다.device_not_found알 수 없는 디바이스 조회 시 발생합니다.channel_not_found요청한 채널이 존재하지 않을 때 발생합니다.public_channel_override디바이스를 공개 채널로 강제 지정하려 할 때 발생합니다.invalid_version_id번들을 직접 오버라이드하려 할 때 발생합니다. 대신 채널을 사용하세요.cannot_access_app또는cannot_access_channelAPI 키에 필요한 권한이 없을 때 발생합니다.
주요 사용 사례
“주요 사용 사례” 섹션-
테스트 기기를 프라이빗 베타 채널로 이동
{"app_id": "com.example.app","device_id": "device_456","channel": "beta"} -
기기 채널 선택을 기본값으로 초기화
다음
DELETE엔드포인트에 앱 및 기기 ID를 사용하세요.
Devices 섹션에서 계속하기
“Devices 섹션에서 계속하기” 제목의 섹션사용 중인 경우 디바이스 채널 라우팅과 단계적 롤아웃을 계획하려면, 이를 다음 항목과 연결하세요 채널 Channels의 구현 세부 사항은, 채널 Channels의 구현 세부 사항은, 채널 Channels의 구현 세부 사항은, Beta Testing 솔루션 Beta Testing 솔루션의 제품 워크플로우는, Version Targeting 솔루션 Version Targeting 솔루션의 제품 워크플로우를 확인하세요.