API(s) for Prognosis?

05 Base Camper

Re: API(s) for Prognosis?

there is no file named that in that location.

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
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.

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
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)

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
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

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

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

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.

Webinar: The Journey to Microsoft Teams - Readiness Phase (part 2)

Having looked at the planning phase in session one of this series, we will turn our focus to the readiness phase. The all important technical capabilities assessment, ensuring the network, endpoints and users are adequately prepared for the move.

Hear first hand from IR's Global Head of Information Systems and Technology, Jason Schwendinger, on how he has been tackling these issues.

Join webinar