Linnworks API token authorization

Hello,

I need to create a simple dashboard, primarily with data from the Linnworks API, and I am considering using Retool. I would like to get some advice on whether this is the right choice because I got stuck at one step when I tried using other apps.

I managed to pull, via creating a new API connection from scratch, and we are getting the data we need. However, I have one issue: before I can call any method, I need to perform authorization. This authorization is done by calling a separate method, which gives an API token in the response. This token needs to be used in the header as authorization for all other functions.

The problem is that the API token is only valid for 30 minutes and then needs to be refreshed, causing all functions that require this token to stop working. Do you have any advice on how this can be solved? Can I store this API token in a variable and then use this variable in other API connections? I read something about "/api/Main/Ping" but I'm not sure how to implement it.

Thanks a lot.

Best,
Dasa

Hello @Dasa_gd2u!

I am not familiar with Linnworks API but if you API token expires and needs to be replaced every 30 minutes, I have two ideas for possible work arounds to refresh this.

One would be using a timer component, which would be started on the first query and then re-trigger the token request when it runs out.

The other option would be to use a workflow, you can set up incremental runs on time schedules similar to a CRON job and can trigger the workflow from the main app to connect it with the timer or other event handling!

1 Like

Is there any other way to increase the API token time?

is there anyone who is expert of linnworks amazon inventory accounting software? i've to optimze the software

Hello @linnda!

If the API token is coming from Linnworks, you would have to check their website to see if there are other options for authorizing API requests and authorizing users/requests.

Not much Retool can do for third party auth besides holding the token and running queries. You can read more about our custom auth setup on our docs here!