1.3 KiB
1.3 KiB
API Documentation
Authentication
All protected endpoints require a Bearer token in the Authorization header.
POST /login
Authenticate with login and password.
Request Body:
{
"login": "string",
"password": "string"
}
Response (200):
{
"token": "string"
}
Response (401):
{
"error": "Invalid credentials"
}
POST /reg
Register a new user.
Request Body:
{
"login": "string",
"password": "string"
}
Response (201):
{
"message": "User registered"
}
GET /watch?unique_id=...
Get the latest position for a share link.
Response (200):
{
"x": "number",
"y": "number",
"last_update": "string",
"expires_at": "string"
}
Response (404):
{
"error": "Share link not found"
}
PUT /geo?id=...
Update a position.
Response (200):
{
"message": "Position updated"
}
POST /share
Create a new position with a share link.
Response (201):
{
"geo_id": "string",
"share_id": "string"
}
Error Responses
Auth Middleware (401)
{
"error": "Authorization header missing or invalid"
}
{
"error": "Token expired"
}
{
"error": "Invalid token"
}