Help

API Connection Cin7

Topic Labels: Scripting extentions
460 0
cancel
Showing results for 
Search instead for 
Did you mean: 
Brian_Ringler
4 - Data Explorer
4 - Data Explorer

Has anyone used Airscripts to pull data in from Cin7 via API? Also, does anyone have recommendation for best API to use? I think you have to use async and await in Scripts? JavaScript has so many options. Plus, I just started using Airtable yesterday. I was think about using the below but adding Cin7 requirements. They just use HTTP auth so I need to add that piece for accessing still.

import fetch from ‘node-fetch’;

const getPokemon = async() => {
try{
let id = 1;
let url = https://pokeapi.co/api/v2/pokemon/${id};
const res = await fetch(url); // Returns a promise so we need await
const data = await res.json(); // Returns a promise so we need await
console.log(data);
}catch(err) {
console.log(err);
}
};

getPokemon();

0 Replies 0