Mayo's API Documentation
api.mayoadeniyi.com
Introduction
This is the documentation for Mayo's API.
Base URL https://api.mayoadeniyi.com
General Usage Notes
- All endpoints require an API key for authorisation. See the Mayo's API page for details
- Include the X-Api-Key header with your API key in your requests
- All responses are in JSON format.
- All timestamps are in AEST with the format: yyyy-MM-dd HH:mm:ss
Description of Usual Server Responses
- 200 OK: The request was successful.
- 201 Created: The request was successful and a new resource was created.
- 204 No Content: The request was successful but there is no content to return.
- 400 Bad Request: The request was malformed or missing required parameters.
- 401 Unauthorized: The API key is missing, invalid, or you don't have permission to access the resource.
- 404 Not Found: The requested resource does not exist.
- 500 Internal Server Error: I messed something up.
Authorisation
Obtaining an API Key
See the Mayo's API page for details on obtaining an API key.
If you want a key with elevated privelages that doesn't expire, send me an email.
Checking the validity of an API Key
A simple request with your API key, returns the owner's name if the key is valid.
Endpoint: /key-check
Method: GET
Headers:
- X-Api-Key: xxxx-xxxx:xxxxxxxx
Success Response:
Status code: 200 OK
Body:
- owner_name
Payslip Divider
Usage
Provide the total pay with the account partitions to divide it accordingly.
Endpoint: /payslip-divider
Method: POST
Headers:
- Content-Type: application/json
- X-Api-Key: xxxx-xxxx:xxxxxxxx
Body:
{- "totalPay": 5000.00
- "bankAccounts": {
- "Account name 1": 10,
- "Account name 2": 30,
- "Account name 3": 60
- }
}Success Response:
Status code: 200 OK
Body:
{- "partitions": {
- "Account name 1": 500.00,
- "Account name 2": 1500.00,
- "Account name 3": 3000.00
- },
- "calculatedTotal": 5000.00
}