Swagger UI for Protocol Reader Service
The protocol reader API can be accessed using a swagger UI. The Swagger UI displays information about the API definition and allows to quickly test the API with manual input.
For more information about Swagger UI, please see external link: https://swagger.io/tools/swagger-ui/
The Swagger UI for protocol reader service can be accessed by this link:
http://<ip address>:<port>/swagger-ui/index.html?urls.primaryName=protocolreader
Using the link belov the main title, you can download the Open API definition file of the service as a yaml file.
Below the defined resource are listed and the parameters for these requests.
Click at the Try out button to enable the input fields in the parameter section, so that you can easily create a request.
As execution of the request by required authentication, the Authorize button allows you to specify the credentials while working with this Swagger UI page.
After clicking Execute at the bottom of the Parameters section, the request is created and executed. The screenshot below shows the created request as curl
-command as well as the request URL, as well the response received after execution.
Note: The Authorization header is not included in the curl
-command. When using it from terminal, use -u
parameter to add credentials.
Example:
curl -X 'GET' \ 'http://<tia host>:<port>/protocolreader/records/?repository=CE&offset=0&pageSize=5&startTime=2023-06-14T12%3A03%3A09.774Z&endTime=2023-06-14T12%3A05%3A09.774Z&commandStatus=success' \ -H 'accept: application/json' \ -H 'X-TiaClientId: MyCompany' \ -u 'admin:15cB5aKTb(Ousk7q'
Note: The Swagger UI is running in the container and creating requests with the internal port (that is 8080). If at deployment time of the tia container the port 8080 was not mapped to the host port 8080, the request created by Swagger UI will not automatically execute.
When copying the curl
-command, edit the port number to execute the request successfully.