Registrar dispositivo
Registrar un cliente anonimo por device token.
POST
/api/sdk/clients/register-deviceRegistra un dispositivo como cliente anonimo. Si el token ya existe, retorna el cliente existente.
Request body
| Parametro | Tipo | Descripcion |
|---|
Ejemplo
curl -X POST https://southgames.ai/api/sdk/clients/register-device \
-H "Authorization: Bearer sg_live_xxx" \
-H "X-Org-Id: mi-empresa" \
-H "Content-Type: application/json" \
-d '{
"deviceToken": "fcm_token_abc123",
"os": "android",
"locale": "es-CL"
}'
Respuesta
{
"success": true,
"data": {
"clientId": "abc123def456",
"created": true
}
}
| Campo | Tipo | Descripcion |
|---|---|---|
clientId | string | ID del cliente (nuevo o existente) |
created | boolean | true si se creo un nuevo cliente anonimo |
Notas
- Los clientes anonimos se crean con
anonymous: trueen Firestore. - Si el
deviceTokenya pertenece a un cliente existente, se retorna ese cliente sin crear uno nuevo. - Para identificar al cliente posteriormente, usa
/clients/registercon el campoanonymousClientId.