API DOCUMENT
Reports
This API Document provides details about the endpoints, methods, parameters, and responses of the API, allows users to perform various operations related to Reports epic.
By providing a detailed breakdown of endpoints, methods, parameters, and responses, developers can efficiently leverage the API to perform a myriad of operations related to Reports epic. With clear documentation, developers can swiftly grasp the nuances of the API, enabling them to implement secure and robust authentication mechanisms, manage user lifecycles effectively, and harness chip-based authentication for enhanced security measures. Thus, API documentation serves as a cornerstone for developers, offering valuable insights and guidelines to leverage the API’s functionalities to their fullest potential.
Tenant User Login
This endpoint is where the tenant user can login with their credentials.
- Method: POST
- Endpoint: /api/auth/tenantUserLogin
Parameters: No additional parameters required.
Request Body: application/json
{
“password”: “P@ss1234”,
“email”: “test.tenant.user@sunbytes.io”
}
Responses
- 200 OK: Success response
{
“accessToken”: “eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c”,
“firstName”: “Test First Name”,
“lastName”: “Test Last Name”
}
- 404 Not Found: ID does not exist.
{
“statusCode”: 404,
“message”: “Incorrect login credentials”,
“error”: “Not found”
}
- 500 Internal server error: An unexpected error occurred on the server.
{
“statusCode”: 500,
“message”: “Internal server error”
}
- 520 Web Server Returned an Unknown Error The origin server returned an empty, unknown, or unexpected response to Cloudflare.
Get IoT User Authentication Report
This endpoint is used to get IOT user authentication report.
- Method: POST
- Endpoint: /api/reports/get-iot-user-authentication-report
Parameters: No additional parameters required.
Request Body: application/json
{
“page”: 1,
“limit”: 10,
“keyword”: “”,
“orderData”: {
“field”: “createdAt”,
“order”: “desc”
},
“createdAtFrom”: “2023-01-01 00:00”,
“createdAtTo”: “2023-12-31 00:00”,
“timezone”: “Etc/UTC”,
“iotId”: “BA782F0B-4E0F-EE11-A9B9-000D3A49003C”,
“authenticationTypes”: [
“REGULAR”,
“IMMEDIATE”
]
}
Responses
- 201 OK: Success response.
{
“total”: 10,
“list”: [
{
“id”: “BA782F0B-4E0F-EE11-A9B9-000D3A49003C”,
“result”: “OK”,
“reason”: “SUCCESS”,
“authenticationType”: “REGULAR”,
“createdAt”: “2023-06-06 00:00”,
“total”: 10,
“tenantCompanyName”: “Test Company”
}
]
}
- 401 Unauthorized: Request lacks proper authentication.
{
“statusCode”: 401,
“message”: “Unauthorized”
}
- 520 Web Server Returned an Unknown Error The origin server returned an empty, unknown, or unexpected response to Cloudflare.
Quick navigation
Still stuck in the code maze? No worries, our team is just an email away at support@sandgrain.eu. We speak fluent bug-fix!