Semua yang Anda butuhkan untuk beralih dari nol ke humanToken pertama Anda.
Human Token memiliki tiga endpoint. Halaman ini menunjukkan bagaimana ketiganya saling terhubung agar Anda dapat segera mulai mengintegrasikan.
URL Dasar
| Lingkungan | URL Dasar |
|---|---|
| Produksi | https://humantoken.unico.app |
Semua permintaan memerlukan header x-unico-accesskey. Lihat Autentikasi untuk membuat kunci Anda.
Alur mulai cepat
Langkah 1 — Autentikasi
Buat x-unico-accesskey Anda di Human Dashboard atau melalui Authentication API. Setiap permintaan di bawah menggunakan kunci ini.
x-unico-accesskey: uip_ak.prod.a1b2c3d4.e5f6g7h8.i9j0k1l2
Langkah 2 — Buat proses
Panggil Create Process untuk memulai verifikasi. Pilih salah satu dari dua model:
| Model | Flow | Cara kerjanya |
|---|---|---|
| API Only | api+humantoken, api+liveness+humantoken, api+liveness+humantoken+revalidation | Backend Anda mengirim selfie sebagai imageBase64. humanToken dikembalikan dalam respons yang sama. |
| Human Token Journey | humantoken, humantoken+revalidation | Pengguna menyelesaikan pengambilan di platform Unico. Anda mendapatkan token dan link untuk menyajikan journey, lalu mengambil hasilnya dengan Get Process. |
Contoh API Only:
curl -X POST https://humantoken.unico.app/client/v1/process \
-H "x-unico-accesskey: $UNICO_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{
"flow": "api+humantoken",
"imageBase64": "<base64-encoded-selfie>",
"companyBranchId": "<your-branch-id>"
}'
Contoh Human Token Journey:
curl -X POST https://humantoken.unico.app/client/v1/process \
-H "x-unico-accesskey: $UNICO_ACCESS_KEY" \
-H "Content-Type: application/json" \
-d '{
"flow": "humantoken",
"callbackUri": "https://yourapp.com/callback",
"companyBranchId": "<your-branch-id>"
}'
Lihat Create Process untuk semua flow, parameter, dan detail respons.
Langkah 3 — Sajikan journey kepada pengguna (hanya flow Journey)
Untuk flow humantoken dan humantoken+revalidation, respons Create Process mencakup:
token— menginisialisasi Web SDK atau integrasi nativelink— URL untuk mengarahkan pengguna
Pilih integrasi yang sesuai dengan platform Anda:
| Platform | Pendekatan |
|---|---|
| Web — SDK | Sematkan journey secara inline dengan idpay-b2b-sdk → Web Integration |
| Web — Redirect | Arahkan pengguna ke link → Web Integration |
| Android | Custom Tabs → Android |
| iOS | ASWebAuthenticationSession → iOS |
| Ionic | Capacitor plugin → Ionic |
| React Native | Native module → React Native |
| Flutter | Platform Channels → Flutter |
Ketika journey selesai, pengguna kembali ke callbackUri Anda. Lanjutkan ke Langkah 4.
Lewati langkah ini — hasilnya sudah ada dalam respons Create Process.
Langkah 4 — Ambil hasilnya (hanya flow Journey)
Panggil Get Process dengan id proses untuk mengambil hasilnya:
curl https://humantoken.unico.app/client/v1/process/$PROCESS_ID \
-H "x-unico-accesskey: $UNICO_ACCESS_KEY"
Respons mencakup data.humanToken.value (flow standar) atau data.humanTokenMatch (flow revalidasi). Lihat Get Process untuk skema respons lengkap dan nilai status.
Langkah 5 — Gunakan humanToken
humanToken adalah pengenal yang stabil dan buram (hingga 100 karakter). Orang yang sama selalu menghasilkan nilai yang sama.
const { humanToken } = process.data;
if (!humanToken?.value) {
// Inconclusive — retry or reject per your business rules
return;
}
const existing = await db.persons.findByHumanToken(humanToken.value);
if (existing) {
// Same person seen before — returning user or duplicate
} else {
// First time — create a new record
await db.persons.create({ humanToken: humanToken.value });
}
Selalu periksa bahwa data.humanToken.value tidak kosong sebelum menyimpan atau mencocokkannya.
Langkah 6 — Ambil selfie (opsional)
Panggil Get Selfie untuk mengunduh gambar yang diambil. Selfie tersedia selama 24 jam setelah proses selesai — setelah itu, selfie dihapus secara permanen.
curl https://humantoken.unico.app/client/v1/process/$PROCESS_ID/selfie \
-H "x-unico-accesskey: $UNICO_ACCESS_KEY"
Lihat Get Selfie untuk detail respons dan kode error.
Endpoint sekilas
| Metode | Endpoint | Deskripsi |
|---|---|---|
POST | /client/v1/process | Create Process — mulai verifikasi |
GET | /client/v1/process/{processId} | Get Process — ambil hasilnya |
GET | /client/v1/process/{processId}/selfie | Get Selfie — unduh selfie (24 jam) |
Selanjutnya
- Create Process — referensi parameter lengkap untuk kelima flow
- Authentication — buat dan kelola kunci akses Anda
- Build With LLM — tempel prompt ke asisten AI Anda untuk menghasilkan integrasi lengkap