__CAPGO_KEEP_0__ - Live Updates for __CAPGO_KEEP_1__ Apps

장치

장치(Devices)는 Capgo에 업데이터 메타데이터를 보고합니다. 이 API을 사용하여 그 메타데이터를 가져오거나 장치별 개인 채널 오버라이드 설정 및 제거를 수행합니다.

장치 메타데이터

장치 메타데이터

각 레코드는 장치 ID, 플랫폼, 업데이터 및 OS 버전, 네이티브 빌드, 설치된 번들, 프로덕션 및 에뮬레이터 상태, 커스텀 ID 및 채널_OVERRIDE를 포함할 수 있습니다.

사용 가능한 경우, country_code code은 ISO 3166-1 국가 코드의 최신 유효한 두 자리 문자입니다. Cloudflare에서 받은 장치에 대한 요청을 처리한 후에 받은 국가 코드입니다. GPS나 앱에서 제공하는 위치 값이 아닙니다. Cloudflare에서 받은 장치의 국가 코드를 얻을 수 있습니다. null 장치 unavailable 할 때; 단일 장치 lookup 사용하세요.

장치 API

Endpoints

POST

POST

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

장치에 대한 특정 오버라이드 설정 개인 장치에 대한 버전을 선택하기 위해 채널에 버블을 할당하세요. 장치에 대한 직접적인 버블 오버라이드가 지원되지 않습니다. 오버라이드가 마지막으로 쓰인 후 90일이 지나면 만료됩니다. 다시 POST를 하시면 만료되지 않습니다.

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 request
Section titled “Example request”
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"
}

GET

GET

https://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 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에 의해 채워진 기기별로 조회할 때 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_id when 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. 기기 설정을 원래 채널 선택으로 초기화합니다.

    __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__ 채널의 구현 세부 정보에 대해 채널 채널 베타 테스트 솔루션 채널의 제품 워크플로에 대해 버전 대상 솔루션 버전 대상 솔루션의 제품 워크플로에 대해