Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
Hi,
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
based on this: https://shopify.dev/docs/admin-api/rest/reference/online-store/blog?api[version]=2020-07
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?
Solved! Go to the solution
This is an accepted solution.
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
Read More about Offline Access Here
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('/');
},
}),
);
Are you using a public app?
Does your secret key start wit shpss or shpsa
Yes, I am using a public app. Secret key starts with shpss.
This is an accepted solution.
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
Read More about Offline Access Here
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('/');
},
}),
);
Thanks to your reply above, was able to solve issue on scheduling background jobs.
In the documentation, it says accessMode is 'offline' by default but it is not the case!
i am facing this error "[API] Invalid API key or access token (unrecognized login or wrong password)" when i call "https://shop.myshopify.com/admin/api/2021-07/graphql.json" in postman
can we are use shopify in apollo??
if yes then how?
@sanketJ wrote:i am facing this error "[API] Invalid API key or access token (unrecognized login or wrong password)" when i call "https://shop.myshopify.com/admin/api/2021-07/graphql.json" in postman
can we are use shopify in apollo??
if yes then how?
Today, my app's getting that error hitting the same endpoint. Things were working perfectly yesterday-- I'm not sure if it's on our end or Shopify's.
i solved this error
you can add the Authorization in header section
currently i am facing this error in node with express js { product: 'Required parameter missing or invalid' }
anyone have any idea ? how to solve this error
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.
Are you facing this error while working with the theme kit?
Can you share the detail about your issue?
So, I can help you.
Learn how to expand your operations internationally with Shopify Academy’s learning path...
By Shopify Feb 4, 2025Hey Community, happy February! Looking back to January, we kicked off the year with 8....
By JasonH Feb 3, 2025Expand into selling wholesale with Shopify Academy’s learning path, B2B on Shopify: Lau...
By Shopify Jan 28, 2025