Emupad REST API
Version 1.0 — White-Label Cloud Phone API
Integrasikan layanan penyewaan cloud phone Emupad langsung ke dalam aplikasi atau sistem Anda secara programatik. API ini mendukung manajemen perangkat, billing, proxy, instalasi aplikasi, dan lainnya.
Authentication
Setiap request ke API wajib menyertakan token akses pada header HTTP:
Authorization: Bearer YOUR_API_TOKEN
Token bisa didapatkan dari halaman Akun Saya di dashboard. Setiap user hanya memiliki satu token aktif.
Rate Limiting
API dibatasi 60 request per menit per token. Jika melebihi batas, server akan merespons dengan status 429 Too Many Requests.
Error Codes
| Code | Deskripsi |
|---|---|
| 200 | OK — Request berhasil |
| 201 | Created — Resource berhasil dibuat |
| 401 | Unauthorized — Token tidak valid atau tidak ada |
| 402 | Payment Required — Saldo tidak mencukupi |
| 403 | Forbidden — Akun suspended atau belum verified |
| 404 | Not Found — Resource tidak ditemukan |
| 409 | Conflict — Stok habis / resource conflict |
| 422 | Unprocessable Entity — Parameter tidak valid |
| 429 | Too Many Requests — Rate limit terlampaui |
| 500 | Internal Server Error |
| 502 | Bad Gateway — Gagal komunikasi dengan upstream server |
| 503 | Service Unavailable — Layanan sedang maintenance |
Metadata & Tarif
/api/v1/metadata/regions
Mendapatkan daftar region (negara) yang tersedia untuk penyewaan cloud phone.
{
"status": "success",
"data": [
{ "code": "ID", "name": "Indonesia" },
{ "code": "SG", "name": "Singapore" },
{ "code": "US", "name": "United States" }
]
}
/api/v1/metadata/categories
Mendapatkan daftar kategori/tipe spesifikasi perangkat yang tersedia.
{
"status": "success",
"data": [
{ "name": "basic", "description": "Basic tier" },
{ "name": "vip", "description": "VIP tier" },
{ "name": "vvip", "description": "VVIP / High Spec tier" }
]
}
/api/v1/plans
Mendapatkan daftar paket sewa beserta harga API per kategori.
{
"status": "success",
"data": [
{
"plan_id": 1,
"name": "Paket Harian (1 Hari)",
"duration_days": 1,
"prices": { "basic": 15000, "vip": 22500, "vvip": 30000 }
}
]
}
Billing & Top Up
/api/v1/billing/balance
Mengecek saldo akun Anda.
{ "status": "success", "data": { "balance": 150000.00, "currency": "IDR" } }
/api/v1/billing/topup
Membuat invoice top-up saldo.
| Parameter | Tipe | Wajib | Deskripsi |
|---|---|---|---|
| amount | Integer | Ya | Nominal pengisian (min: 10000) |
| payment_method | String | Ya | Pilihan: qris, duitku |
{
"status": "success",
"message": "Invoice created successfully.",
"data": {
"invoice_ref": "NQ-5A90512E",
"amount": 50000,
"payment_url": "https://nusaqris.com/pay/NQ-5A90512E",
"qr_code_base64": "data:image/png;base64,...",
"expired_at": "2026-06-25 23:27:12"
}
}
/api/v1/billing/topup/status/{invoice_ref}
Mengecek status pembayaran invoice top-up.
{ "status": "success", "data": { "invoice_ref": "NQ-5A90512E", "status": "success", "amount": 50000, "paid_at": "2026-06-25 22:15:10" } }
Sewa & Kontrol Perangkat
/api/v1/devices
Mendapatkan daftar semua perangkat cloud phone aktif milik Anda.
{
"status": "success",
"data": [{
"device_code": "APP5BN4NS4IFAXOO",
"label": "Bot Server 1",
"region": "ID",
"category": "vip",
"android_version": "Android13",
"status": "active",
"auto_renew": false,
"expired_at": "2026-07-25 22:00:00"
}]
}
/api/v1/devices/rent
Menyewa cloud phone baru. Saldo akan dipotong otomatis sesuai harga API.
| Parameter | Tipe | Wajib | Deskripsi |
|---|---|---|---|
| plan_id | Integer | Ya | ID paket dari endpoint /plans |
| category | String | Ya | Kategori: basic, vip, vvip |
| region | String | Ya | Kode region: ID, SG, US, dll. |
| android_version | String | Ya | Contoh: Android13, Android12 |
| label | String | Tidak | Nama label perangkat (max 100 chars) |
{
"status": "success",
"message": "Device successfully provisioned and rented.",
"data": {
"device_code": "APP5BN4NS4IFAXOO",
"label": "Bot Server 1",
"region": "ID",
"category": "vip",
"android_version": "Android13",
"expired_at": "2026-07-25 22:00:00"
}
}
/api/v1/devices/{device_code}/reboot
Mengirim perintah reboot ke perangkat cloud phone.
{ "status": "success", "message": "Device reboot command sent successfully." }
/api/v1/devices/{device_code}/reset
Melakukan factory reset pada perangkat cloud phone.
{ "status": "success", "message": "Device factory reset command initiated." }
/api/v1/devices/{device_code}/stream-token
Mendapatkan token sesi streaming WebRTC dan URL API Armcloud SDK untuk perangkat cloud phone.
{
"status": "success",
"data": {
"device_code": "VP-US-BASIC-001",
"stream_token": "token_session_from_armcloud_sts_api...",
"api_url": "https://openapi-hk.armcloud.net"
}
}
Sistem Proxy
/api/v1/devices/{device_code}/proxy/bind
Memasang konfigurasi proxy pada perangkat.
| Parameter | Tipe | Wajib | Deskripsi |
|---|---|---|---|
| proxy_host | String | Ya | IP atau domain proxy |
| proxy_port | Integer | Ya | Port proxy |
| proxy_type | String | Ya | HTTP atau SOCKS5 |
| proxy_user | String | Tidak | Username auth proxy |
| proxy_pass | String | Tidak | Password auth proxy |
{ "status": "success", "message": "Proxy successfully configured and bound to device." }
/api/v1/devices/{device_code}/proxy/unbind
Menghapus konfigurasi proxy dari perangkat.
{ "status": "success", "message": "Proxy successfully cleared from device." }
Aplikasi (Instant Install)
/api/v1/apps
Mendapatkan daftar aplikasi yang tersedia untuk instalasi instan.
{
"status": "success",
"data": [
{ "app_id": 1, "name": "WhatsApp", "package_name": "com.whatsapp", "icon_url": "/assets/icons/whatsapp.png" }
]
}
/api/v1/devices/{device_code}/apps/install
Menginstall aplikasi ke perangkat. Kirim salah satu: app_id atau apk_url.
| Parameter | Tipe | Wajib | Deskripsi |
|---|---|---|---|
| app_id | Integer | * | ID aplikasi instan dari /apps |
| apk_url | String | * | Direct download link APK (.apk) |
* Kirim salah satu dari app_id atau apk_url.
{
"status": "success",
"message": "Installation task queued. App is being installed in the background.",
"data": { "task_id": "TASK-12948120", "app_name": "WhatsApp" }
}
Cloud Drive (File Manager)
/api/v1/devices/{device_code}/clouddrive/download
Mendownload file dari URL eksternal langsung ke storage perangkat virtual.
| Parameter | Tipe | Wajib | Deskripsi |
|---|---|---|---|
| file_url | String | Ya | Link file eksternal |
| dest_path | String | Ya | Path penyimpanan di device, contoh: /sdcard/Download/file.txt |
{ "status": "success", "message": "Download task queued successfully. File is downloading inside the device." }
WebRTC Streaming Guide
Perangkat cloud phone EmuPad menggunakan protokol WebRTC dengan Armcloud H5 SDK untuk merender layar secara real-time dan interaktif. Anda dapat mengintegrasikan player streaming ini ke dalam panel web kustom milik Anda.
Template Klien Mandiri (Tinggal Deploy)
Unduh satu berkas HTML lengkap yang sudah siap pakai. Anda cukup memasukkan base URL, token API, dan kode perangkat Anda untuk mulai streaming.
Langkah 1: Load SDK di Halaman Anda
Tambahkan script Armcloud WebRTC H5 SDK sebelum tag penutup body. Script ini bisa diunduh langsung dari aset EmuPad Anda:
<script src="https://emupad.com/public/assets/js/armcloud-rtc.js"></script>
Langkah 2: Buat Container HTML
Siapkan elemen HTML div sebagai penampung stream video cloud phone dengan ukuran rasio layar (disarankan 9:16):
<!-- Wadah render streaming video -->
<div id="phoneBox" style="width: 320px; height: 570px; background-color: #000; border-radius: 16px; overflow: hidden;"></div>
Langkah 3: Inisialisasi Engine SDK
Panggil endpoint REST API GET /api/v1/devices/{code}/stream-token untuk mendapatkan token streaming dan API URL, kemudian gunakan kode javascript di bawah untuk memutar streaming secara interaktif:
// 1. Ambil data respon token & api_url dari REST API Anda
const streamTokenData = {
device_code: "YOUR_DEVICE_CODE",
stream_token: "token_session_from_rest_api...",
api_url: "https://openapi-hk.armcloud.net"
};
// 2. Siapkan parameter konfigurasi engine SDK
const rtcParams = {
baseUrl: streamTokenData.api_url,
token: streamTokenData.stream_token,
retryCount: 3,
retryTime: 2000,
enableMicrophone: true,
enableCamera: true,
deviceInfo: {
padCode: streamTokenData.device_code,
userId: "session_user_identifier", // String pengenal bebas
mediaType: 3, // 3 = Audio + Video
videoStream: {
resolution: 12, // 540 * 960 (Rasio ideal HP)
frameRate: 2, // 25 fps
bitrate: 3 // 2 Mbps
}
},
viewId: "phoneBox", // ID element HTML div penampung stream
callbacks: {
onInit: function(res) {
if (res.code === 0) {
console.log("SDK terinisialisasi. Memulai koneksi WebRTC...");
rtcEngine.start(); // Memulai rendering streaming dan kontrol sentuh
} else {
console.error("Gagal inisialisasi SDK:", res.msg);
}
},
onConnectSuccess: function() {
console.log("Streaming WebRTC sukses terhubung!");
},
onConnectFail: function(res) {
console.error("Gagal menyambungkan stream:", res.msg);
},
onRenderedFirstFrame: function() {
console.log("Layar cloud phone berhasil dimuat sepenuhnya.");
}
}
};
// 3. Buat instance engine untuk memulai
let rtcEngine;
try {
rtcEngine = new ArmcloudRtc.ArmcloudEngine(rtcParams);
} catch (err) {
console.error("Error inisialisasi WebRTC Engine:", err);
}
Emupad REST API v1 Documentation
Base URL: https://emupad.com/api/v1