Files
FitTrack_GarminSync/contracts/sync_garmin_health_metrics.json

82 lines
2.3 KiB
JSON

{
"endpoint": "/api/sync/garmin/health-metrics",
"method": "POST",
"description": "Triggers synchronization of Garmin Connect health metrics to CentralDB.",
"request": {
"headers": {
"Authorization": "Bearer <token>"
},
"body": {
"type": "object",
"properties": {
"start_date": {
"type": "string",
"format": "date",
"description": "Optional start date to sync health metrics from (YYYY-MM-DD). Defaults to last sync date."
},
"end_date": {
"type": "string",
"format": "date",
"description": "Optional end date to sync health metrics until (YYYY-MM-DD). Defaults to today."
}
},
"additionalProperties": false
}
},
"response": {
"202": {
"description": "Synchronization process initiated successfully.",
"body": {
"type": "object",
"properties": {
"message": {
"type": "string",
"example": "Garmin health metrics synchronization initiated."
},
"sync_job_id": {
"type": "string",
"format": "uuid",
"description": "ID of the created synchronization job."
}
},
"required": ["message", "sync_job_id"]
}
},
"401": {
"description": "Unauthorized: User not authenticated or Garmin Connect account not linked.",
"body": {
"type": "object",
"properties": {
"detail": {
"type": "string",
"example": "Not authenticated or Garmin Connect account not linked."
}
}
}
},
"429": {
"description": "Too Many Requests: Rate limit exceeded for Garmin Connect API.",
"body": {
"type": "object",
"properties": {
"detail": {
"type": "string",
"example": "Rate limit exceeded. Please try again later."
}
}
}
},
"500": {
"description": "Internal Server Error: Unexpected error during synchronization initiation.",
"body": {
"type": "object",
"properties": {
"detail": {
"type": "string",
"example": "An unexpected error occurred."
}
}
}
}
}
}