Skip to main content
Solved

Making a GET request to Indicium from an app integrated in the GUI


SanderAdam
Warrior
Forum|alt.badge.img+5

We have developed a small external web app. This web app needs to retrieve a file which has been imported and stored on a reachable location on the server using the file name and path. The file name and path are stored in the database. Using this file name and path the web app can read the file from the location it's stored. This needs to be done with an XHR GET request.

Is there a way that this integrated web app can do a GET request to the Indicium API to retrieve the file path it needs? It just needs to get a piece of text from the database that contains the path to the file, then it can read the file and view the data using said file.

Best answer by Jasper

Hi SanderAdam,

If the web app is hosted on the same (sub)domain as the Universal GUI, it will automatically inherit the authentication cookies from the Universal GUI to access the Indicium API.

Information on Indicium's File API can be found in the docs: File API | Thinkwise Documentation (thinkwisesoftware.com).

This post demonstrates the use of a (POST) XHR request: Upload multiple files using the Universal GUI | Thinkwise Community (thinkwisesoftware.com) 

View original
Did this topic help you find an answer to your question?
This topic has been closed for comments

2 replies

Freddy
Forum|alt.badge.img+16
  • Thinkwise Local Partner Brasil
  • 529 replies
  • May 22, 2023
SanderAdam wrote:

We have developed a small external web app. This web app needs to retrieve a file which has been imported and stored on a reachable location on the server using the file name and path. The file name and path are stored in the database. Using this file name and path the web app can read the file from the location it's stored. This needs to be done with an XHR GET request.

Is there a way that this integrated web app can do a GET request to the Indicium API to retrieve the file path it needs? It just needs to get a piece of text from the database that contains the path to the file, then it can read the file and view the data using said file.

As you wil need to generate a URL to load the external web app to load into the Universal GUI (I kind of guess this is scenario here) it's easier to perhaps give the path and file name in the URL  like /app/show.html?Location=$var1&Name=$var2 then you don't need to do the get action in your application.. just read the variables. 

In all other cases you can use the already existing login credentials..

  const getVar = `${serviceUrl}/${application}/subject(var1=${var1})$select=field`;
  const responseVar = await fetch(getVar, { credentials: "include" });

 

 

 


Jasper
Superhero
  • 678 replies
  • Answer
  • May 22, 2023

Hi SanderAdam,

If the web app is hosted on the same (sub)domain as the Universal GUI, it will automatically inherit the authentication cookies from the Universal GUI to access the Indicium API.

Information on Indicium's File API can be found in the docs: File API | Thinkwise Documentation (thinkwisesoftware.com).

This post demonstrates the use of a (POST) XHR request: Upload multiple files using the Universal GUI | Thinkwise Community (thinkwisesoftware.com) 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings