Endpoint: GET /
Home page API to check the server status. This route is used to verify that the web server is running correctly by responding with a simple message.
$ curl -X GET https://trigger-io.difa.unibo.it/dev/api/
{ "message": "No request made yet." }
Endpoint: POST /auth
Handles authentication via POST request. This endpoint receives an email and password from the client and checks their validity against the accounts table in the database. If the credentials are correct, the server generates a unique authentication token, stores it in the accounts table, and updates the last login timestamp.
$ curl -X POST https://trigger-io.difa.unibo.it/dev/api/auth
{ "message": "No request made yet." }
Endpoint: POST /logout
Handles user logout via POST request. This endpoint logs out a user by invalidating their authentication token. Given a valid token, the corresponding entry in the accounts table is replaced or removed to ensure security. This API enhances the security of user communications by allowing explicit session termination.
$ curl -X POST https://trigger-io.difa.unibo.it/dev/api/logout
{ "message": "No request made yet." }
Endpoint: POST /credentials
Handles the creation of a new account in the dedicated table. This endpoint allows the creation of a new account identified by email and password, returning the "unique" string as output for the transfer of the information to humans. The response is the "unique" string for the patient authentication.
$ curl -X POST https://trigger-io.difa.unibo.it/dev/api/credentials
{ "message": "No request made yet." }
Endpoint: POST /private/issues
Handles insertion of new issue in the dedicated table. This endpoint allows inserting new issue records in the dedicated table, specifying the details about it in the route parameter. The endpoint does not require authentication since it must be available to all the users of the service. The response is just a status code about the success or not of the insertion.
$ curl -X POST https://trigger-io.difa.unibo.it/dev/api/private/issues
{ "message": "No request made yet." }
Endpoint: GET /private/issues-close
Handles the redirect to the HTML page for issue closing. This endpoint allows to redirect to the correspoding HTML page for the closing procedure of an opened issue. The endpoint does not require authentication since it must be available to all the users of the service. The response is just a status code about the success or not of the insertion.
$ curl -X GET https://trigger-io.difa.unibo.it/dev/api/private/issues-close
{ "message": "No request made yet." }
Endpoint: POST /private/issues-close
Handles the closing of an opened issue in the dedicated table. This endpoint allows to close an existing issue record in the dedicated table, specifying the details about it in the body parameter. The endpoint does not require authentication since it must be available to all the users of the service. The response is just a status code about the success or not of the insertion.
$ curl -X POST https://trigger-io.difa.unibo.it/dev/api/private/issues-close
{ "message": "No request made yet." }
Endpoint: POST /:table
Handles insertion of data into a specified table via POST request. This endpoint allows inserting data into a dynamic table, specified in the route parameter. The authentication token provided in the request body is used to retrieve the corresponding user ID from the accounts table, ensuring only authenticated users can perform the insertion. This operation updates the user_{table} association table between users and devices.
$ curl -X POST https://trigger-io.difa.unibo.it/dev/api/:table
{ "message": "No request made yet." }
Endpoint: GET /:table
Handles retrieval of data from a specified table via GET request. This endpoint allows generic querying of any whitelisted table using flexible query parameters. It supports filtering (including comparison operators), searching, grouping, ordering, limiting and pagination. The authentication token provided in the request headers is used to validate access. The response data is filtered according to the query parameters provided in the request. Allowed query parameters:
$ curl -X GET https://trigger-io.difa.unibo.it/dev/api/:table
{ "message": "No request made yet." }