Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Upload Reports API #223

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

taketo1113
Copy link
Contributor

This Pull Request adds the Upload Reports API. (Fix #211)
With this addition, external systems can automate and integrate the process of uploading reports.

Usage

The Upload Reports API allows you to upload a file specified in the file field as a report.
Authentication is performed using an API token, consistent with other APIs.

$ curl -X POST \
         -F [email protected] \
         -H "Authorization: Bearer {access_token}" \
         http://localhost:8000/api/upload/
{
  "message": "File saved for processing.",
  "job-id": 9,
  "doc-id": 9
}

Details

The behavior of the Upload Reports API is based on the existing Upload Reports functionality (/upload/).
The existing upload method has been refactored to be reusable and is now also invoked from the upload_api endpoint.

Additionally, error handling has been improved to return a clear error message when the required file field is missing in the request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using the API to Upload reports
1 participant