API Workflow
The PayrollDetect API workflow consists of several steps that allow you to upload historical data, train models, create predictions, and fetch results. The core steps are:
- Upload historical data: Submit approved payroll objects ("payslips") to establish a baseline for model training.
- Train models: Use the historical data to train models capable of predicting anomalies in new payslips.
- Create predictions: Generate predictions for new payslips based on the trained models.
- Get results: Retrieve the prediction results to review anomalies.
- Upload new data: Continuously update the system with new (approved) payslips.
- Update models: Maintain model accuracy by updating as new data is introduced.
Workflow details
The following sequence diagram provides a more detailed view of the API workflow with comments below:
- 1st step retrieves a Bearer Token from Visma Connect using credentials you have obtained from Visma Connect integration. The retrieved bearer token must be included in the header of all subsequent requests.
- 3rd step, retrieves a presigned URL for uploading historical data and then use the retrieved URL to upload the data (see 5th step). The data upload will trigger data validation, that will check the data schema and format, but will not start the model training. Data validation happens asynchronously and will send a webhook notification when it is complete. As an alternative to the webhook notification, you can poll the API to check the validation status.
- 8th step, starts the model training process. The training process can only be started after the data has been uploaded and validated. The training process will also happen asynchronously and will send a webhook notification when it is complete. Alternatively, you can poll the API to check the training status.
- 11th step, starts the batch prediction process. The batch prediction process will also happen asynchronously and will send a webhook notification when it is complete. Alternatively, you can poll the API to check the prediction status.
- 15th step, uses real-time endpoint for doing predictions. The real-time predictions are suitable for smaller datasets, or if you need to do prediction on a couple of payslips.