cURL
curl --request POST \ --url https://api.myidvirtual.com/user/favorite \ --header 'Authorization: <authorization>' \ --header 'Content-Type: application/json' \ --data ' { "serverId": "<string>" } '
{ "message": "Servidor adicionado aos favoritos com sucesso", "server": { "id": "srv_123e4567-e89b-12d3-a456-426614174000", "name": "São Paulo Premium", "country": "Brasil", "city": "São Paulo", "flag": "🇧🇷", "ip": "192.168.1.100", "port": "1194", "status": true } }
Gerencia servidores favoritos do usuário
{ "message": "Servidor removido dos favoritos com sucesso" }
{ "favorites": [ { "id": "srv_123e4567-e89b-12d3-a456-426614174000", "name": "São Paulo Premium", "country": "Brasil", "city": "São Paulo", "flag": "🇧🇷", "ip": "192.168.1.100", "port": "1194", "status": true, "ping": 25, "load": 45, "addedAt": "2024-01-15T10:30:00.000Z" }, { "id": "srv_987e6543-e21b-43d2-b654-321987654000", "name": "Rio de Janeiro Turbo", "country": "Brasil", "city": "Rio de Janeiro", "flag": "🇧🇷", "ip": "192.168.2.100", "port": "1194", "status": true, "ping": 30, "load": 32, "addedAt": "2024-01-10T15:20:00.000Z" } ], "total": 2 }
curl --location --request POST 'http://localhost:3333/user/favorite' \ --header 'Authorization: Bearer eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...' \ --header 'Content-Type: application/json' \ --data-raw '{ "serverId": "srv_123e4567-e89b-12d3-a456-426614174000" }'
// Estado não favoritado <button class="favorite-btn">☆</button> // Estado favoritado <button class="favorite-btn favorited">⭐</button>