Hello all !
(It’s my first post in this forum, if i’m not following guidelines please feel free to tell me !)
I quite new in the Airtable world.
I’m currentlty trying to create a script (with the script app powered by Airtable) in order to fetch data from my (test) shopify store.
But here is my point :
→ Airtable do not allow to use the class authentication used by Shopify, which is :
GET https://{username}:{password}@{shop}.myshopify.com/admin/api/2021-01/shop.json
→ So i need to use Basic Auth as it’s explained in theire documentation. But it’s not working, and i get this error message : “oapi] Invalid API key or access token (unrecognized login or wrong password)”.
Did someone ever face this issue and know how to solve it ?(I’m sur about my credentials, and i also delete and recreate my app in order to prevent this mistake).
I’m surely missing something but i don’t know what it is…
Here is my code :
const apiKeyShopify = "MY_SHOPIFY_API_KEY";
const passwordShopify = "MY_SHOPIFY_API_PASSWORD";
const nameShopifyStore = "test-dive-analytics.myshopify.com";
const versionApi = '2021-01'
const shopifyUrl = "https://"+nameShopifyStore+"/admin/api/"+versionApi+"/shop.json";
const encodedCredentialsShopify = btoa(`${apiKeyShopify}:${passwordShopify}`)
console.log(shopifyUrl);
console.log(encodedCredentialsShopify)
const httpHeader = {
/*"Access-Control-Allow-Headers" : "Content-Type",
"Access-Control-Allow-Methods": "GET",*/
"Content-Type": "application/json",
"Authorization": `Basic ${encodedCredentialsShopify}`
};
const response = await remoteFetchAsync(`${shopifyUrl}`, {
METHOD: "GET",
HEADER: httpHeader
});
await response.json().then(function(res) {
console.log(res);
});
PS: Second chat with shopify’s support but they don’t know how to solve my issue…
Thanks a lot for your help !