API Documentation
All API requests must contain the API Key as a Bearer token in the Authorization header.
Glossary
- Organisation The organisation or company who will manage and view the Reporters and Load Checks.
- Membership The connection between a Reporter and an Organisation.
- Load Check A record of a load check containing the location and images.
- Reporter The person submitting Load Checks.
Validate Reporter
Reporters must first be created by an administrator through the web application.
The mobile app can submit a mobile number which, if valid, will send back the Reporter's ID and a list of Organisations they're a member of.
The JWT corresponding to the Organisation is used to validate the Reporter when submitting a Load Check.
The validation process can be repeated as many times as necessary to keep the Reporter's memberships up to date.
Request
- Endpoint api/app/reporters/validate
- Method Post
- Content Type application/json
-
Body
- mobileNumber string
{ "mobileNumber":"0402 043 779" }
Response
-
Body
- id int
- memberships Dictionary of Name:Token pairs
{ "id": 298, "memberships": { "Example Organisation": "eyJhbGciOiJIUzI1Ni..." } }
Submit Check
When submitting a Load Check one of the Reporter's membership tokens must be included to ensure the check is added to the relevant Organisation.
Ensure the correct filename (including extension) is included for each bay, e.g. capture-01.jpg
Request
- Endpoint api/app/checks
- Method Post
- Content Type multipart/form-data
-
Body
- token string
- latitude double
- longitude double
- timestamp string
- isCompliant bool
-
bays
array of objects
- fileName string
- area double
- leftAngle double
- rightAngle double
- stabilityRating string
- trailerType string
- suspensionType string
- [image files]
Response
The Load Check ID will be returned, as well as any error messages from uploading/saving the images.
Images can be reuploaded in the case of any errors.
-
Body
- id int
- errors [string (filename: error message)]
{ "id": 235, "errors": [] }
Submit Images
Use this method if image uploading fails when submitting a Load Check.
Request
- Endpoint api/app/checks/:check-id/bays/:bay-id
- Method Post
- Content Type multipart/form-data
-
Body
- [image files]
Response
Any error messages from uploading/saving the images.
-
Body
- errors [string (filename: error message)]
{ "errors": [ "image.html: Not a valid image file" ] }