장치
복사할 수 있는 설치 지시와 이 플러그인의 전체 마크다운 가이드를 포함하는 설정 지시를 복사하세요.
장치(Devices)는 Capgo에 업데이터 메타데이터를 보고합니다. 이 API을 사용하여 그 메타데이터를 가져오거나 장치별 개인 채널 오버라이드 설정 및 제거를 수행합니다.
장치 메타데이터
장치 메타데이터각 레코드는 장치 ID, 플랫폼, 업데이터 및 OS 버전, 네이티브 빌드, 설치된 번들, 프로덕션 및 에뮬레이터 상태, 커스텀 ID 및 채널_OVERRIDE를 포함할 수 있습니다.
사용 가능한 경우, country_code code은 ISO 3166-1 국가 코드의 최신 유효한 두 자리 문자입니다. Cloudflare에서 받은 장치에 대한 요청을 처리한 후에 받은 국가 코드입니다. GPS나 앱에서 제공하는 위치 값이 아닙니다. Cloudflare에서 받은 장치의 국가 코드를 얻을 수 있습니다. null 장치 unavailable 할 때; 단일 장치 lookup 사용하세요.
장치 API
EndpointsPOST
POSThttps://api.capgo.app/device/
장치에 대한 특정 오버라이드 설정 개인 장치에 대한 버전을 선택하기 위해 채널에 버블을 할당하세요. 장치에 대한 직접적인 버블 오버라이드가 지원되지 않습니다. 오버라이드가 마지막으로 쓰인 후 90일이 지나면 만료됩니다. 다시 POST를 하시면 만료되지 않습니다.
Request Body
클립보드 복사interface 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/공개 채널은 장치 오버라이드로 사용할 수 없습니다.
성공 응답
성공 응답{ "status": "ok"}GET
GEThttps://api.capgo.app/device/
장치 메타데이터를 가져옵니다. omit할 경우 결과는 커서 페이지네이션됩니다. device_id.
쿼리 매개변수
쿼리 매개변수app_id: 반드시 역 도메인 앱 ID와 같은com.example.app.device_id: 장치 ID가 있을 경우, 응답은 단일 장치로 paginated 목록이 아닌 단일 장치가 됩니다.customIdMode: 옵션 boolean. __CAPGO_KEEP_0__을true만들기 위해custom_id.cursor: 이전 목록 응답에서 가져온 옵션 커서.limit: 페이지당 기기 수를 지정하는 옵션 숫자.
예제 요청
제목 ‘예제 요청’# 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에 의해 채워진 기기별로 조회할 때 Capgo이 유효한 국가가 없으면 마지막 유효한 값을 지우지 않습니다; 목록 응답은 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/
기기는 다시 정상 채널 선택을 사용합니다. 이 엔드포인트는 기기의 메타데이터 기록을 삭제하지 않습니다.
요청 본문 또는 쿼리 매개변수
요청 본문 또는 쿼리 매개변수 섹션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_idwhenapp_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"} -
기기 설정을 원래 채널 선택으로 초기화합니다.
__CAPGO_KEEP_0__와 함께 앱 및 기기 ID를 가진 엔드포인트를 사용합니다.
DELETE기기에서 계속하기
기기에서 계속하기 섹션 제목
__CAPGO_KEEP_0__가 사용 중인 경우__CAPGO_KEEP_0__를 사용하여 채널 라우팅과 스테이지 롤아웃을 계획하고 있습니다. __CAPGO_KEEP_0__를 __CAPGO_KEEP_1__와 연결하세요. __CAPGO_KEEP_1__에 대한 implementation detail은 __CAPGO_KEEP_1__에서 확인할 수 있습니다. __CAPGO_KEEP_1__ __CAPGO_KEEP_1__ __CAPGO_KEEP_1__ __CAPGO_KEEP_1__ 채널의 구현 세부 정보에 대해 채널 채널 베타 테스트 솔루션 채널의 제품 워크플로에 대해 버전 대상 솔루션 버전 대상 솔루션의 제품 워크플로에 대해