Spaces:
Sleeping
Sleeping
Backend endpoints (upload service β your backend)
Your backend implements two endpoints. The upload service calls them.
POST /update (progress, multiple times per job)
Headers: Content-Type: application/json; optional Authorization: <task_auth_token>
Body:
{
"doc_id": "string",
"finished": 1,
"total": 4,
"message": "string",
"project_id": "string"
}
doc_idβ document/job idfinishedβ current step (1β4)totalβ always 4messageβ e.g. "Downloading...", "Parsing document...", "Upload complete"project_idβ optional, if client sent it
Respond: 200
POST /finish (once per job)
Headers: Content-Type: application/json; optional Authorization: <task_auth_token>
Body (success):
{
"status": "complete",
"doc_id": "string",
"project_id": "string"
}
Body (failure):
{
"status": "failure",
"doc_id": "string",
"message": "string",
"project_id": "string"
}
doc_idβ same as the doc_id used to start the jobproject_idβ optional
Respond: 200