mirror of
https://github.com/sstent/FitTrack_GarminSync.git
synced 2026-01-25 16:41:41 +00:00
113 lines
3.2 KiB
JSON
113 lines
3.2 KiB
JSON
{
|
|
"endpoint": "/api/sync/status",
|
|
"method": "GET",
|
|
"description": "Retrieves the current status of ongoing or completed synchronization processes.",
|
|
"request": {
|
|
"headers": {
|
|
"Authorization": "Bearer <token>"
|
|
},
|
|
"query_parameters": {
|
|
"job_id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"description": "Optional: Filter status by a specific synchronization job ID."
|
|
},
|
|
"job_type": {
|
|
"type": "string",
|
|
"enum": ["activity_sync", "health_metrics_sync", "workout_upload"],
|
|
"description": "Optional: Filter status by job type."
|
|
},
|
|
"limit": {
|
|
"type": "integer",
|
|
"minimum": 1,
|
|
"maximum": 100,
|
|
"default": 10,
|
|
"description": "Optional: Maximum number of sync jobs to return."
|
|
},
|
|
"offset": {
|
|
"type": "integer",
|
|
"minimum": 0,
|
|
"default": 0,
|
|
"description": "Optional: Number of sync jobs to skip for pagination."
|
|
}
|
|
}
|
|
},
|
|
"response": {
|
|
"200": {
|
|
"description": "Returns a list of synchronization job statuses.",
|
|
"body": {
|
|
"type": "array",
|
|
"items": {
|
|
"type": "object",
|
|
"properties": {
|
|
"id": {
|
|
"type": "string",
|
|
"format": "uuid",
|
|
"description": "Unique identifier of the sync job."
|
|
},
|
|
"job_type": {
|
|
"type": "string",
|
|
"enum": ["activity_sync", "health_metrics_sync", "workout_upload"],
|
|
"description": "Type of synchronization."
|
|
},
|
|
"status": {
|
|
"type": "string",
|
|
"enum": ["pending", "in_progress", "completed", "failed"],
|
|
"description": "Current status of the job."
|
|
},
|
|
"started_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"nullable": true,
|
|
"description": "Timestamp when the job started."
|
|
},
|
|
"completed_at": {
|
|
"type": "string",
|
|
"format": "date-time",
|
|
"nullable": true,
|
|
"description": "Timestamp when the job completed."
|
|
},
|
|
"progress": {
|
|
"type": "number",
|
|
"format": "float",
|
|
"minimum": 0.0,
|
|
"maximum": 1.0,
|
|
"nullable": true,
|
|
"description": "Current progress (0.0-1.0)."
|
|
},
|
|
"error_message": {
|
|
"type": "string",
|
|
"nullable": true,
|
|
"description": "Details of any error encountered."
|
|
}
|
|
},
|
|
"required": ["id", "job_type", "status"]
|
|
}
|
|
}
|
|
},
|
|
"401": {
|
|
"description": "Unauthorized: User not authenticated.",
|
|
"body": {
|
|
"type": "object",
|
|
"properties": {
|
|
"detail": {
|
|
"type": "string",
|
|
"example": "Not authenticated."
|
|
}
|
|
}
|
|
}
|
|
},
|
|
"500": {
|
|
"description": "Internal Server Error: Unexpected error retrieving status.",
|
|
"body": {
|
|
"type": "object",
|
|
"properties": {
|
|
"detail": {
|
|
"type": "string",
|
|
"example": "An unexpected error occurred."
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
} |