Lompat ke konten

Perangkat

Devices represent individual installations of your app that are managed by Capgo. The Devices API allows you to track and manage devices, including their bundles (versions), channels, and update status.

Setiap perangkat memiliki karakteristik dan keadaan unik:

  • Sistem: iOS, Android, atau Electron
  • Paket (versi): Paket saat ini (versi) dan versi pembangunan asli
  • Lingkungan: Produksi atau pengembangan, emulator atau perangkat fisik
  • Saluran: Penugasan saluran pembaruan saat ini
  • ID Kustom: Identifikasi opsional untuk keperluan pelacakan sendiri
  1. Pantauan Paket (versi): Pantau pengadopsian paket perangkat (versi) untuk memastikan peningkatan pembaruan
  2. Pengelolaan Saluran: Tugaskan perangkat ke saluran yang tepat berdasarkan kebutuhan tes
  3. Ketajaman Lingkungan: Atasi lingkungan yang berbeda (prod/dev/emulator) dengan tepat
  4. Pengidentifikasi Kustom: Gunakan ID kustom untuk mengintegrasikan dengan sistem yang ada Anda

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

Tautkan perangkat ke bundle (versi) atau saluran tertentu.

interface DeviceLink {
app_id: string
device_id: string
version_id?: string // bundle (version) name
channel?: string // channel name
}
Jendela Terminal
curl -X POST \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"app_id": "app_123",
"device_id": "device_456",
"channel": "beta"
}' \
https://api.capgo.app/device/
{
"status": "ok"
}

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

Mengambil informasi perangkat. Menggunakan pagination berbasis kursor untuk pengambilan perangkat yang efektif dalam jumlah besar.

  • app_id: Diperlukan. ID aplikasi Anda
  • device_id : Opsional. ID perangkat spesifik untuk mengambil perangkat tunggal
  • cursor: Wajib. Kursor dari respons sebelumnya untuk pagination
  • limit: Wajib. Jumlah perangkat per halaman (default: 50)
Jendela terminal
# Get all devices (first page)
curl -H "authorization: your-api-key" \
"https://api.capgo.app/device/?app_id=app_123"
# Get specific device
curl -H "authorization: your-api-key" \
"https://api.capgo.app/device/?app_id=app_123&device_id=device_456"
# Get next page using cursor
curl -H "authorization: your-api-key" \
"https://api.capgo.app/device/?app_id=app_123&cursor=2024-01-01T00:00:00Z|device_456"

Ketika meminta beberapa perangkat (tanpa device_id parameter):

interface DeviceListResponse {
data: Device[];
nextCursor?: string; // Pass this as 'cursor' param to get next page
hasMore: boolean; // true if more pages available
}
interface Device {
updated_at: string;
device_id: string;
custom_id: string;
version?: number; // bundle (version) id
version_name: string | null; // bundle (version) name
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; // First 4 chars of encryption key (e.g., "MIIB")
}

Jenis Respons (Perangkat Tunggal)

Jenis Tanggapan (Perangkat Satu)

Ketika meminta perangkat tertentu dengan device_id parameter, mengembalikan objek perangkat secara langsung:

interface Device {
updated_at: string;
device_id: string;
custom_id: string;
version?: number; // bundle (version) id
version_name: string | null; // bundle (version) name
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; // First 4 chars of encryption key (e.g., "MIIB")
}

Contoh Tanggapan (Daftar)

Jenis Tanggapan (Daftar)
{
"data": [
{
"device_id": "device_456",
"custom_id": "test-device-1",
"version": 1,
"version_name": "1.0.0",
"app_id": "app_123",
"platform": "ios",
"plugin_version": "5.0.0",
"os_version": "17.0",
"version_build": "1",
"is_prod": true,
"is_emulator": false,
"updated_at": "2024-01-01T00:00:00Z"
}
],
"nextCursor": "2024-01-01T00:00:00Z|device_456",
"hasMore": true
}

Contoh Tanggapan (Perangkat Satu)

Jenis Tanggapan (Perangkat Satu)
{
"device_id": "device_456",
"custom_id": "test-device-1",
"version": 1,
"version_name": "1.0.0",
"app_id": "app_123",
"platform": "ios",
"plugin_version": "5.0.0",
"os_version": "17.0",
"version_build": "1",
"is_prod": true,
"is_emulator": false,
"updated_at": "2024-01-01T00:00:00Z",
"channel": "production"
}

HAPUS

HAPUS

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

Menghilangkan perangkat dari pengaturan saluran override-nya. Ini mengatur ulang perangkat untuk menggunakan saluran defaultnya.

Anda tidak bisa menghapus perangkat dengan endpoint ini, karena hanya mempengaruhi pengaturan saluran override.

Parameter Pemintaan
interface Device {
device_id: string
app_id: string
}

Salin ke clipboard

Contoh Permintaan
Bagian berjudul “Contoh Permintaan”
curl -X DELETE \
-H "authorization: your-api-key" \
-H "Content-Type: application/json" \
-d '{
"app_id": "app_123",
"device_id": "device_456"
}' \
https://api.capgo.app/device/
{
"status": "ok"
}

Skenario kesalahan umum dan responsnya:

// Device not found
{
"error": "Device not found",
"status": "KO"
}
// Invalid bundle (version)
{
"error": "Version not found",
"status": "KO"
}
// Invalid channel
{
"error": "Channel not found",
"status": "KO"
}
// Permission denied
{
"error": "Insufficient permissions to manage devices",
"status": "KO"
}
  1. Pendaftaran Perangkat Beta
{
"app_id": "app_123",
"device_id": "device_456",
"channel": "beta"
}
  1. Versi Override
{
"app_id": "app_123",
"device_id": "device_456",
"version_id": "1.1.0"
}
  1. Kembalikan ke Saluran Bawaan
// Use DELETE endpoint to remove overrides
  1. Pengawasan: Periksa secara teratur status perangkat dan distribusi paket (versi)
  2. Pengujian: Gunakan ID khusus untuk mengidentifikasi perangkat uji dengan mudah
  3. Pengembangan: Ikuti pembaruan perangkat dan pengaturan saluran
  4. Versi Kontrol Sumber Daya AsliMonitor versi aplikasi asli untuk memastikan konsistensi

Jika Anda menggunakan Perangkat untuk merencanakan routing saluran dan peluncuran tahap demi tahap, hubungkannya dengan Saluran untuk detail implementasi di Saluran, Saluran untuk detail implementasi di Saluran, Saluran untuk detail implementasi di Channels, Solusi Pengujian Beta untuk alur produk di Solusi Pengujian Beta, dan Solusi Target Versi untuk alur produk di Solusi Target Versi.