Open a link in a new tab after calling an API

Hi everyone,

I'm struggled with the next case, we have a gridField, where we are showing a list of objetcs returned by an API.

One of the columns in that gridField is desired to make able the user to download a file given a property of the object which is an url, lets say the "X" url, here is the issue that URL only responds with another url having a presigned URL for a file in s3 bucket, lets call it the "Y" URL

We were wondering if it is possible to make the user reach the "Y" only clicking 1 button (or link) in order to make the presign only when the user request the files, because we know it would be easy to call every "Y" URL the presigned ones if we load all those at the start time, the thing is we dont want to do it, we just want to generate the presigned file when the user request one by one.

By the way the X URL is already configured as an integration, and we dont want to use appian file system and try to avoid as much as we can create a model process for this

So, in short we are trying to find a way to:

1. Get the "Y" URL, after hitting the "X" URL

2. Open immediately the presigned file returned by the "Y" URL in a new tab

I would be really appreciated if you can help me with this, since I was trying to figure out for a couple of days

Please let me know if you need further explanation 

Thanks and regards

  Discussion posts and replies are publicly visible

Parents
  • +1
    Certified Lead Developer

    You can create a web API which returns HTML. When generating that HTML, you can fetch your URL and use the generated HTML to redirect the users browser to it. Then provide a link to the user that opens in a new tab.

    I did something similar to open a document inside a windows application. That application registered a URL schema in Windows. The user clicked the link opening in a new tab. The link points to my web API which generates that new URL and redirects the browser to it. Then, Windows picks up that URL and opens the document inside the application.

Reply
  • +1
    Certified Lead Developer

    You can create a web API which returns HTML. When generating that HTML, you can fetch your URL and use the generated HTML to redirect the users browser to it. Then provide a link to the user that opens in a new tab.

    I did something similar to open a document inside a windows application. That application registered a URL schema in Windows. The user clicked the link opening in a new tab. The link points to my web API which generates that new URL and redirects the browser to it. Then, Windows picks up that URL and opens the document inside the application.

Children