Access Token not recognized

Hi to everybody.I’m in trouble because the code received is not recognized by Shopify.I create the code by calling this url:https://{shop_name}.myshopify.com/admin/oauth/authorize

The redirect url receive the call containing the code. The code received is like this: **********************

Then I try to retrieve products with this call:

https://{shop_name}.myshopify.com/admin/api/2026-01/products.json?limit=250

passing in the header this:

‘X-Shopify-Access-Token:{code}’ and 'Content-Type: application/json’

I receive this answer:

{“errors”:“[API] Invalid API key or access token (unrecognized login or wrong password)”}

The time passed between code is received and the call for products list is done is 30 seconds around.I don’t know where I can find the API key, I pass the access token only (the code I receive with create code call)Where I’m wrong ?

Thanks in advance

Hi @Servitel

Please refrain from sharing access codes in public forums like this, I’m not sure if that’s a real credential or for your a test store but you’ve just exposed it to the public web. I highly recommend you rotate that credential.

I went ahead and edited that out, but it has already been exposed.

That said, I noticed the format of the access token wasn’t what I normally see. Typically access tokens start with shpat_so that way you can tell they are shop private access tokens.

The code you’re seeing is most likely the OAuth grant code, which is used to prove the redirect after the merchant authorizes your app.

1 Like

Hey folks :waving_hand: - I agree with @Dylan here (though I can’t see the token anymore - thanks for hiding that!).

@Servitel, I’d just double check to make sure you’re converting your Authorization Code into an access token after the OAuth redirect:

Hope this helps!