API Guide Introduction
Welcome to the API guide. This documentation will help you understand how to use our API effectively.
Overview
Our API allows you to interact with our service programmatically. You can perform various operations such as uploading data, training models, and checking training status.
Getting Started
To get started, you need to authenticate with our API. Follow these steps:
- Click on the "Authorize" button in the top-right corner of the API documentation page.
- Enter your username and password in the provided fields.
Once authenticated, you'll be able to access and use the exposed APIs that require authentication.
Note: Some endpoints, such as those under
/users, may require superuser authorization. Ensure you have the necessary permissions before attempting to access these endpoints.
Using the API
After authentication, you can interact with the API in two main ways:
1. Interactive Documentation
Our API documentation provides an interactive interface for testing and exploring the available endpoints:
- Navigate to the API you want to use in the documentation.
- Expand the endpoint's section to view its details.
- Click the "Try it out" button on the top right of the endpoint's section.
- Fill in the required parameters and request body (if applicable).
- Click "Execute" to send the request and see the response.
The documentation page provides detailed information for each endpoint, including:
- Expected parameters
- Example responses with status codes and descriptions
- Response media types
- A space to view the actual result of the API call
2. External API Calls
You can also interact with the API using external tools or your own applications:
- Use tools like cURL, Postman, or your preferred programming language's HTTP library.
- Ensure you include your authentication credentials with each request.
- Refer to the API documentation for the correct endpoints, request methods, and required parameters.
Note: Please keep your API credentials secure and never share them publicly.
Main APIs
1. Upload Data
Endpoint: POST /upload
This API allows you to upload a new dataset for training the model.
Parameters:
file: The CSV file to upload (UploadFile)
Response:
- Success:
{"message": "Successfully uploaded {filename}. Training process started."} - Error:
{"message": "There was an error uploading the file: {error_message}"}
2. Upload New Data
Endpoint: POST /upload-new
This API allows you to upload new data and merge it with the existing dataset.
Parameters:
file: The CSV file with new data to upload (UploadFile)
Response:
- Success:
{"message": "Successfully uploaded and merged new data. Training process started."} - Error:
{"message": "There was an error uploading and processing the file: {error_message}"}
3. Get Training Status
Endpoint: GET /training-status
This API allows you to check the status of the current training process.
Response:
- Success: Returns the current training status
- Error:
{"detail": "Unauthorized"}if the user is not authenticated
Note: For all these APIs, ensure you are authenticated. If a training process is already running, you'll receive a message indicating that you should try again later.
4. Optimize Confidence Intervals
Endpoint: PUT /item_options/optimize-confidence-for-all
This API allows you to optimize confidence interval for all items for Model 3 predictions.
Support
If you encounter any issues or have questions about using our API, please don't hesitate to contact our support team at software@techneos.eu.