__CAPGO_KEEP_2__

장치

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

디바이스 메타데이터

제목 ‘디바이스 메타데이터’

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

사용 가능한 경우 country_code 최신 유효한 두 개의 문자 ISO 3166-1 국가 code를 받은 Cloudflare-처리된 요청에서 디바이스입니다. GPS 또는 앱에서 제공하는 위치 값이 아닙니다. 사용할 수 있는 경우 null 사용할 수 없는 경우; 단일 디바이스 조회를 사용할 때 이 필드를 필요로 할 때

POST

POST

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

장치에 대한 특정 오버라이드 설정 개인 장치에 대한 버전을 선택하려면 채널에 버전을 assign하세요. 장치에 대한 직접적인 버전 오버라이드가 지원되지 않습니다. 오버라이드가 마지막으로 작성된 후 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
}

예제 요청

터미널 창
protectedTokens
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/

장치 메타데이터를 검색합니다. 결과는 omit할 때 커서 페이지네이션됩니다. device_id.

쿼리 매개변수

쿼리 매개변수 섹션
  • app_id: 반드시 역 도메인 앱 ID와 같은 com.example.app.
  • device_id: 장치 ID가 있을 때, 응답은 단일 장치 rather than 페이지네이션된 목록입니다.
  • customIdMode: 옵션 boolean. true로 설정하면 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/

기기 채널 오버라이드 제거

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

요청 본문 또는 쿼리 매개변수
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 권한이 부족한 경우.

권한이 부여되지 않은 경우 __CAPGO_KEEP_0__ 키.

일반적인 사용 사례
  1. 일반적인 사용 사례

    {
    "app_id": "com.example.app",
    "device_id": "device_456",
    "channel": "beta"
    }
  2. 기기 설정을 일반 채널 선택으로 초기화하세요

    앱과 기기 ID를 포함한 DELETE 엔드포인트를 사용하세요.

기기에서 계속 진행하세요

기기에서 계속 진행하기

Capgo 마케팅 웹사이트에서 사용 중인 경우 기기 채널 라우팅과 스테이지 롤아웃을 계획하고 연결하려면 채널 채널 구현 세부 정보를 참조하세요. 채널 채널 구현 세부 정보를 참조하세요. 채널 채널에 대한 구현 세부 정보 베타 테스트 솔루션 베타 테스트 솔루션의 제품 워크플로 버전 목표 솔루션 버전 목표 솔루션의 제품 워크플로