I am been having issue to fetch my store blog data in my app as I kept getting this error:
'[API] Invalid API key or access token (unrecognized login or wrong password
But when I enter the blog api in the address bar, I am able to get data to show in the browser.
I did see some post saying to include api key and password in the url. But I cant find any documentation on it. I also would like to know which password needed to be used for that?
Does your access token have accessMode set to offline? This problem generally occurs as access tokens are short-lived and set to online accessMode by default and expire in sometime
If you are using shopify-koa-auth you can set it here →
app.use(
shopifyAuth({
// if specified, mounts the routes off of the given path
// eg. /shopify/auth, /shopify/auth/callback
// defaults to ''
prefix: '/shopify',
// your shopify app api key
apiKey: SHOPIFY_API_KEY,
// your shopify app secret
secret: SHOPIFY_SECRET,
// scopes to request on the merchants store
scopes: ['write_orders, write_products'],
// set access mode, default is 'online'
accessMode: 'offline',
// callback for when auth is completed
afterAuth(ctx) {
const {shop, accessToken} = ctx.session;
console.log('We did it!', accessToken);
ctx.redirect('/');
},
}),
);
While Developing the theme using a Theme kit. I’m facing the same error:
[API] Invalid API key or access token (unrecognized login or wrong password)
Solution: Remove the http/https from the store URL. Again hit the command. Shopify Tip: Don’t include the URL protocol (HTTP or HTTPS) in the store parameter.