cancel
Showing results for 
Search instead for 
Did you mean: 

API(s) for Prognosis?

Michael_Cunning
05 Base Camper

Re: API(s) for Prognosis?

there is no file named that in that location.
Shoaib_Dilawar
12 Sherpa

Re: API(s) for Prognosis?

Ok, then that is your starting point. You need to create a file in that directory and populate it with views you'd require Rest API access to.

e.g - In attached example, it lists all the devices available in PNODES record as defined in PrognosisNodeView that must exist as a persistent view.

RestApiDataSets.xml_.txt

If my reply answered your question please click on the 'Accept as Solution' button to help others find the answer.
Thanks,
Shoaib
Michael_Cunning
05 Base Camper

Re: API(s) for Prognosis?

great thanks, is this documented somewhere? I read through the PQL and the api documents and didn't see anything about having to create files.
Shoaib_Dilawar
12 Sherpa

Re: API(s) for Prognosis?

It was in the email Adam sent, but looks like the documentation fails to mention it. That document may not be most accurate or up to date, so keep reaching out and we'll make sure we get all the rest data available for you.

If my reply answered your question please click on the 'Accept as Solution' button to help others find the answer.
Thanks,
Shoaib
Amol
05 Base Camper

Re: API(s) for Prognosis?

I follow your insteruction for API access https://server-name/Prognosis/rest/v1/data/

however, I am getting below error 

 

PrognoAPI error.png

 

The dataset setting looks good to me in RestApiDataSets.xml.

Can you guid me access the data using API?

Tags (1)
Shoaib_Dilawar
12 Sherpa

Re: API(s) for Prognosis?

@Amol 

 

if there is syntax error in the query inside your restapi xml file, then it may give that error. Can you try running the query manually (that you have in the dataset xml) to make sure it works fine on cmdline?

 

https://help.prognosis.com/prognosis/116/prognosis-rest-api-17236289.html 


If my reply answered your question please click on the 'Accept as Solution' button to help others find the answer.
Thanks,
Shoaib
Amol
05 Base Camper

Re: API(s) for Prognosis?

@Shoaib_Dilawar 

As sugested by you I tried running the querries from CMD using ..\irpqlcli.

They are working fine as expected, see below.PrognoError.png

Shoaib_Dilawar
12 Sherpa

Re: API(s) for Prognosis?

@Amol,

 

sometime restarting IIS>PrognosisSite can reset the views. try that, if it doesn't work, you can open a support case, send us the dataset XML and we can have a look.


If my reply answered your question please click on the 'Accept as Solution' button to help others find the answer.
Thanks,
Shoaib
Shoaib_Dilawar
12 Sherpa

Re: API(s) for Prognosis?

Hi @Amol ,

 

I was working with our support team on your issue and I am guessing you were not logged into prognosis when you tried to run that URL? To access REST objects, you first need to login to prognois webUI, otherwise server will come back as 500.

 

Once you log in, we were able to verify that your rest xml (same as out of box xml) loads fine. Look out for a closure from support team on this as well.


If my reply answered your question please click on the 'Accept as Solution' button to help others find the answer.
Thanks,
Shoaib
David_Sun
Community Manager

Re: API(s) for Prognosis?

The current Prognosis Online help document has the following statement about the REST API Authorization and Security:

"If the Rest API request contains the cookie that belongs to the existing Prognosis Web Application session, the cookie will be accepted and the role will be recognized and authenticated. Otherwise request is not coming from the existing Web Application session, and HTTP Basic authentication will be required in the REST request."

 

We will update this statement to clearly include the Prognosis Web Application login step to get REST API to work.

Thank you for bringing this to our attention.