cancel
Showing results for 
Search instead for 
Did you mean: 

How to use the Swagger tool in Prognosis?

David_Sun
Expert

How to use the Swagger tool in Prognosis?

The Swagger interface provides an easy way to test and use the Prognosis API. This interface is accessible after logging in to the Prognosis WebUI and then modifying the browser URL Address to:
https://<prognosis-server>/Prognosis/swagger

 

swagger1.PNG

 

Next, click on the Prognosis data that you are going to test. For example, the RestData, it shows as below:

 

swagger2.PNG

 

then select the GET /Rest/{ver}/data, type in the Parameters, in this example the ver, the value is v1, the click on Try it out button, it returns as below:

swagger3.PNG

Please note the Response Body section returns the Dataset ID that is definied in the RestAPIDataSets file located in <Prognosis>\WebUI\IIS\Administration\Config folder. If you need to add self defined dataset, it needs to be added in this file.


Use the https://<ipAddress>/prognosis/rest/v1/data/<dataSetID> to query the data for this particular ID, eg:

swagger4.PNG

 

1 ACCEPTED SOLUTION

Accepted Solutions

Re: How to use the Swagger tool in Prognosis?

Hi @JP_Toutenhoofd,

 

If you need to disable the swagger interface, you can use the following steps:

 

1) Open the following file in a text editor:

   \Prognosis\WebUI\IIS\Web.config

2) Locate and change the following parameter from 'true' to 'false':

<add key="EnableSwagger" value="false" />

3) Close and save the file.

4) Restart the Prognosis Web site. You can do this either through IIS Manager, by restarting the World Wide Web service or by executing 'iisreset' from an administrative command shell.

 

Now you'll receive an error if you try to navigate to that address.

 

Hope this helps!

Regards,

Scott Clement

View solution in original post

2 REPLIES 2
JP_Toutenhoofd
05 Base Camper

Re: How to use the Swagger tool in Prognosis?

Swagger is indead a very helpfull TEST tool. But...how to disable it in PROD?

Mvg Jappie Toutenhoofd
Rabobank Netherlands

Re: How to use the Swagger tool in Prognosis?

Hi @JP_Toutenhoofd,

 

If you need to disable the swagger interface, you can use the following steps:

 

1) Open the following file in a text editor:

   \Prognosis\WebUI\IIS\Web.config

2) Locate and change the following parameter from 'true' to 'false':

<add key="EnableSwagger" value="false" />

3) Close and save the file.

4) Restart the Prognosis Web site. You can do this either through IIS Manager, by restarting the World Wide Web service or by executing 'iisreset' from an administrative command shell.

 

Now you'll receive an error if you try to navigate to that address.

 

Hope this helps!

Regards,

Scott Clement

View solution in original post

Webinar: Keep the modern workforce connected

Unified Communications has always been an important part of companies' digital transformation efforts due to its ability to enable rich virtual collaboration and communication. But with COVID-19, we've reached a break-through point.

Join Bill Haskins, Sr. Analyst & Partner, Unified Communications at Wainhouse Research, and John Ruthven, CEO at IR discuss UC challenges companies are experiencing due to the COVOID-19 crisis.

Join webinar