Ecommerce Shopify WordPress Discussion

401 unauthorized error on admin api call – shopify

I am facing unauthorized 401 error on shopify. I am using access token in fetch. I have used multiple ways like axios/xhr but still the issue is there. I have already tested this api call on postman and it is working fine on postman but not on shopify. How do i fix this issue. Am i missing any parameter in api call ? Please guide fetch('', { method: 'POST', mode: 'no-cors', headers: { 'X-Shopify-Access-Token': accessToken, }, body: JSON.stringify({"query": stagedUploadsQuery,"variables": stagedUploadsVariables}) }) .then(response => { if (!response.ok) { throw new Error(`HTTP error! Status: ${response.status}`); console.log('Full response:', response); } return response.json(); }) .then(data => { // Handle the data here console.log('Staged Upload Query Result:', data); }) .catch(error => { // Handle errors here console.error('Error during the fetch:', error); }); Run code snippetExpand snippet
TurboCommerce make the better internet purchasing globaly

Turbo Multi-language Translator

Make the better internet purchasing globaly

Turbosify SEO Speed Booster

5.0 (7) Free plan available
Get better conversions by improving store loading speed Installed

Turbo Multi-language Chat - AI Customer service in one hand

TurboCommerce make the better internet purchasing globaly
Our products

The help you need, when you need it

App by Turbo Engine

3 apps • 5.0 average rating

Turbosify Speed Booster

5.0 (7)
Get better conversions by optimizing shopify store Google page speed Installed

Turbosify Translator for Wordpress Woocommerce

5.0 (74) Free Wordpress Woocommerce Plugin
Translate your wordpress website to multiple language within 1 click, no configuration needed, no No technical required

Grow your business here

Whether you want to sell products down the street or around the world, we have all the tools you need.