Free Trial

Alteryx Designer Desktop Discussions

Find answers, ask questions, and share expertise about Alteryx Designer Desktop and Intelligence Suite.

Download tool with output error HTTP/1.1 302

brian
5 - Atom

I'm using the download tool in order to download the excel file via internal URL within my company

 

The URL when I paste in Chrome, it's automatically downloaded so I consider it's reachable 

 

However when I apply the logic to workflow with the output To a File, I couldn't get the file but only the .tmp file (which is HTML file)

 

So I change the output to To a Field to see what Download tool got, in DownloadHeader i got HTTP/1.1 302 as below:

 

HTTP/1.1 302 X-ASEN:SEN-8378852

Cache-Control:private,max-age=315360000

Expires: Thu, 01 Jan 1970 00:00:00 GMT X-Request-Time:X-Cluster-Node:

 

X-Confluence-Cluster-Node-

Location:/login.action?os_destination=%2Fdownload%2Fattachments%2F160007958%2F<filename>

 

brian_0-1641223112473.png

 

 

Do you have any idea why the link is reachable but I couldn't get it via Download tool? 

 

Thank in advance

10 REPLIES 10
notSoPowerUser
6 - Meteoroid

I am running into this same issue with a tokenized url that is redirected via a 302. The Download tool does not seem to want to follow the redirect resulting in a login page instead of the file download (as it does in a web browser).

apathetichell
19 - Altair

you'll need to add something to your headers.

throw this in postman - test.

confirm it works

see what postman is creating as additional headers. Is there something like follow redirects (add it to alteryx)

does it still not work? - add a user agent - see postman for example.

notSoPowerUser
6 - Meteoroid

I have been playing around with the headers for the past half hour.

 

It does not seem like Alteryx is following the redirect and I am still looking for what I need to do to instruct Alteryx to do so. 

 

Good idea on the user agent. I will give that a try.

 

It would be great for Alteryx to give visibility to the exact headers that are sent by the Download tool (aka after configurations have been applied).

apathetichell
19 - Altair

if this is is a public site/link - send it over to me and i'll tell you what you need.  Usually

User-AgentPostmanRuntime/7.41.2

and

Connectionkeep-alive

 

do the trick.

notSoPowerUser
6 - Meteoroid

Using Postman (not Chrome Dev tools to audit the headers as I was previously), the original url (not public; tokenized from a paid data provider) redirects fine and provides the desired output. However, when I turn off the setting "Automatically follow redirects" in Postman and run the request again...I get the same result I see Alteryx Designer receiving. 

So it seems Alteryx Designer is not following the redirect. I have tried parsing the received header in Alteryx to get the redirected url and use a second Download tool with that url while pass in header values received back from the first Download tool. No dice...yet.

Should the Download tool in Alteryx follow 302 redirects? Is there a configuration I need to set?

I did test adding the User-Agent and Connection values recommended by apathetichell in Alteryx Designer with the Download tool and it did not change the outcome. :-(

apathetichell
19 - Altair

Do you have Accept Application/Json or whatever Postman has in its header? Check out any other hidden headers which Postman is using - and replicate them. Alteryx "should" follow redirects - so it might not be that. I'd also look at timeouts.

 

you can use chrome dev tools - but it's just not as easy as Postman. Postman is much clearer.

and make sure you have the postman useragent set up in your headers.

 

 

notSoPowerUser
6 - Meteoroid

I do have "Accept:*/*" being added to the Download header which is replicating Postman. 

I have replicated what Postman is sending for headers in the Alteryx Designer Download tool and still not getting the data. In Postman I ensured that cookies were deleted (looks like the default was to share with web browser) for the given domain.

Values being added in Alteryx Designer Download "Headers" tab via a field:

"User-Agent:PostmanRuntime/7.41.2
Accept:*/*
Accept-Encoding:gzip, deflate, br
Connection:keep-alive
"

I did notice if I turn off cookies in Postman I get the same results I am getting in Alteryx Designer. 

apathetichell
19 - Altair

so followup questions - is this a chained api call (ie it's the second call) - can you try throwing the cookie in alteryx and seeing if that helps?

 

if that does work - it sounds like the cookie is actually a hard requirement here. I've seen apis with sessioncookies required - usually they are SOAP related and for ERPs (Oracle Financials). If Postman can generate the cookie - you'd need to figure out how - and have Alteryx generate/capture/add the cookie.

notSoPowerUser
6 - Meteoroid

The url is not an api call. It is a "tokenized" url for allowing non authenticated users to view/download data from the platform. 

Does Alteryx Designer's Download tool accept/set cookies?


Since we started talking modifying headers, I have been focusing on the first Download tool's configuration since I do see the initial 302 redirect in the "DownloadHeaders" field followed by a 200 OK which is the login page. 

Labels
Top Solution Authors