Tài khoản — thiết bị đăng nhập
Màn Tài khoản → Devices liệt kê session trình duyệt của user đã đăng nhập. Integrator gọi upstream với access_token và action list, register, rename, hoặc disable.
Dùng domain đăng ký trong form — không phải hostname API.
Playground & Profile
Playground — Home feed → Nền tảng → Thiết bị đăng nhập khi chạy npm run docs:stack. Profile → Account hiển thị danh sách ngắn khi đã đăng nhập (list / disable — chưa có rename trên UI).
Upstream
POST https://api.gommo.net/api/v2/devices
Content-Type: application/x-www-form-urlencoded
| Field | Bắt buộc | Ghi chú |
|---|---|---|
access_token | có | Token session user |
domain | có | Domain đăng ký |
action | có | register | list | rename | disable |
device_id | tùy action | UUID session; đích rename/disable (không phải id_base) |
device_name | rename | Tên mới |
device_info | tùy chọn | Chuỗi JSON metadata |
current_device_id | list/register | Session id browser hiện tại |
language | tùy chọn | vd. EN, VI |
PowerShell (list):
$domain = $env:GOMMO_API_DOMAIN
if (-not $domain) { throw 'Set GOMMO_API_DOMAIN to your registration domain' }
$h = @{ 'Content-Type' = 'application/x-www-form-urlencoded' }
$body = "access_token=$env:TOKEN&domain=$domain&action=list&language=VI¤t_device_id=$env:DEVICE_ID&device_id=$env:DEVICE_ID&device_name=Browser%201"
Invoke-RestMethod -Method Post -Uri 'https://api.gommo.net/api/v2/devices' -Headers $h -Body $bodycurl.exe (list):
curl.exe -X POST "https://api.gommo.net/api/v2/devices" ^
-H "Content-Type: application/x-www-form-urlencoded" ^
--data-urlencode "access_token=%TOKEN%" ^
--data-urlencode "domain=%REGISTRATION_DOMAIN%" ^
--data-urlencode "action=list" ^
--data-urlencode "language=VI" ^
--data-urlencode "current_device_id=%DEVICE_ID%" ^
--data-urlencode "device_id=%DEVICE_ID%" ^
--data-urlencode "device_name=Browser 1"Response list
Thường { success, message, data: { items[], current_device_id } }.
Ví dụ:
{
"success": true,
"message": "OK",
"data": {
"items": [
{
"device_id": "550e8400-e29b-41d4-a716-446655440000",
"device_name": "Browser 1",
"status": "active",
"is_current": true
}
],
"current_device_id": "550e8400-e29b-41d4-a716-446655440000"
}
}Response mutation
register, rename, disable thường trả { success, data: { …một device… } }.
Quy tắc UI (tab Devices dealer)
| Trạng thái | Badge | Hành động |
|---|---|---|
is_current | Current | Chỉ Rename |
status === 'active' và không phải current | Inactive | Rename, Disable |
status === 'disabled' | Disabled | Không nút Disable |
Rename/disable dùng form device_id (UUID từ list), không dùng id_base.
Mode B (gateway tùy chọn)
POST {gateway}/gateway/devices — cần Bearer; body JSON:
{
"action": "list",
"language": "VI",
"current_device_id": "550e8400-e29b-41d4-a716-446655440000",
"device_id": "550e8400-e29b-41d4-a716-446655440000",
"device_name": "Browser 1",
"device_info": "{\"device_type\":\"desktop\"}"
}rename / disable: đặt action và device_id (UUID đích). Gateway điền access_token + domain. JSON upstream hợp lệ → pass-through; lỗi validation → { success: false, message, … }.
OpenAPI: openapi.yaml — /gateway/devices.
SDK: auth.listDevices(), auth.registerDevice(), auth.renameDevice(), auth.disableDevice(). Xem SDK authentication.
→ Ticket hỗ trợ · Chương trình đối tác · Creator Rewards · Đổi mật khẩu · Chuyển credit · Lịch sử giao dịch · Endpoint map · Deploy → Self-host (advanced)
