Alteryx Designer Desktop Discussions

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

Download tool- how to refresh auth token

shivshankar
6 - Meteoroid

auth token get expires for large sets of subsequent API calls. Is there way to replace token before API calls.

5 REPLIES 5
pedrodrfaria
13 - Pulsar

Hi @shivshankar 

 

I think the best solution is the obvious one, get the part where you are calling the token as close to the part where you are making the second API call as possible.

 

When you are dealing with a smaller size, does it work perfectly?

 

Pedro.

jineshnp31
8 - Asteroid

Hi @shivshankar @pedrodrfaria ,

 

Were you able to resolve this issue? I am facing the same issue, where the API endpoint returns only 1000 records per call and the token expires in 15 mins.. Due to high volume of data; exporting 375000 records, I am creating 375 line items and passing it to the Download tool with the initial token. But the process obviously runs over 15 mins to loop through and keeps failing. What can be done to refresh and pass a new token midway? 

PanPP
Alteryx Alumni (Retired)

Hi @jineshnp31 

 

One way to do this is to make the subsequent API calls in an Iterative Macro, pass in a DateTime field [TokenTime] which contains the time you first get the token.  Before every subsequent API call, check the difference between the DateTimeNow() and [TokenTime].  If it's greater than 25 minutes, make a call to get a new Token and update [TokenTime] with the current time.  

 

 

Hope this helps. If it does, please like the post.

jineshnp31
8 - Asteroid

Thank you @PanPP  - Yeah this is what I thinking as well. I will test it. My only worry is if the endpoint considers this as a new session then it will send the records all over again. 

sophabraham95
7 - Meteor

@PanPP , can you help provide a sample of how you are updating this token using the batch call.

Because, when I have 60 requests, what's happening when i do it is, for the first 30 requests it uses one token, then for the remaining 30 requests as the 15 mins are up, its generating a NEW token for EACH request, am not able to keep the same newly generated token for the next 30.

Labels