Files
FitTrack_GarminSync/specs/002-intialspecv2/contracts/sync_garmin_activities.json

85 lines
2.8 KiB
JSON

{
"openapi": "3.0.0",
"info": {
"title": "GarminSync Service API - Activity Sync",
"version": "1.0.0",
"description": "API for triggering and managing Garmin Connect activity synchronization."
},
"paths": {
"/api/sync/garmin/activities": {
"post": {
"summary": "Trigger Garmin Connect Activity Synchronization",
"operationId": "triggerActivitySync",
"requestBody": {
"description": "Optional parameters to control the synchronization process.",
"required": false,
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"force_resync": {
"type": "boolean",
"description": "If true, re-download activities even if they exist. Defaults to false.",
"default": false
},
"start_date": {
"type": "string",
"format": "date",
"description": "Optional start date (YYYY-MM-DD) to sync activities from. If not provided, syncs recent activities."
},
"end_date": {
"type": "string",
"format": "date",
"description": "Optional end date (YYYY-MM-DD) to sync activities up to."
}
}
}
}
}
},
"responses": {
"202": {
"description": "Activity synchronization initiated successfully. Returns a SyncJob ID.",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"job_id": {
"type": "string",
"format": "uuid",
"description": "Unique identifier for the initiated synchronization job."
},
"status": {
"type": "string",
"description": "Current status of the job (e.g., 'pending', 'in_progress')."
},
"message": {
"type": "string",
"description": "Confirmation message."
}
},
"required": [
"job_id",
"status",
"message"
]
}
}
}
},
"401": {
"description": "Unauthorized. User not authenticated with Garmin Connect."
},
"500": {
"description": "Internal server error."
}
},
"tags": [
"Synchronization"
]
}
}
}
}