Help

Scripting App and using Authorization Tokens from External API - Linnworks.NET

Topic Labels: Scripting extentions
3115 4
cancel
Showing results for 
Search instead for 
Did you mean: 
Dominic_Rannie
6 - Interface Innovator
6 - Interface Innovator

Hi,

We are looking for ways to pull data from our Linnworks.NET account (basically and order and inventory management platform) to Airtable. So far we have been using MiniExtensions to import csv files with data exported from Linnworks to Dropbox or FTP server. This has worked well, but MiniExtenions have a limit of 10 instances of their csv import app, meaning that we are limited in the type of data we can import. We have already hit this limit.

I realise that the best solution for transferring data would be via api, but I am not yet very familiar yet with writing api calls. The big stumbling block to this going ahead, from what I can see, is managing Linnworks Authorization. Linnworks Developer Resources - API Home

My question is a general one. Does Airtable scripting allow means to acquire auth tokens and use them in subsequent calls to Linnworks.NET for data, or would we need a 3rd party app as a go between?

Thanks in advance for any help or insights here.
Dominic

4 Replies 4

Hi @Dominic_Rannie, and welcome to the community!

Yes. But… the script must factor in the responses and the security workflow to accommodate such integrations.

I’ve never worked with Linnworks API but I suspect it’s pretty straightforward -

  1. Request an access token through the app auth process.
  2. Use that access token until it expires to retrieve the inventory items.
  3. Update the Airtable tables directly in the process.

This approach completely bypasses the need to push to FTP or a file system so there are more advantages than simply the ability to scale beyond ten instances of the integration process.

Many thanks Bill for your prompt response. I do realise that by developing an api connection we there are suddenly a whole number of possibilities to expand what we are already doing with Airtable. I already have quite a long list of applications in mind! For this reason I feel it would be well worth the time I would need to invest to understand how these scripts are built.

Probably a stupid question, but would the auth codes would be temporarily held in a JavaScript variable as part of the code being executed by the scripting app, rather than being stored and retrieved from a table (I am thinking that a traditional app may store these kind of data in a SQLite database for example). Are you aware of any good resources or example code that maybe a good starting point for somebody attempting to write scripts that handle authorisation and subsequent calls for data?

Any type of security-related information should be abstracted away from the app itself. Databases are a terrible choice if security matters. Airtable provides a script properties environment for managing authentication data and I’ve also experimented with encrypting such values as well in Airtable script blocks.

Most of the content in the forum related to integrations is pretty lightweight - just webhook posts and such. Your project requires a more stringent approach but the web is loaded with such examples and Airtable’s scripting environment is not much different NodeJS and other popular javascript engines.

My hunch is Linnworks already has some good examples and forum content to guide your move in this direction.

LinnDa
4 - Data Explorer
4 - Data Explorer

I am facing token expiring problem while integration linnworks