video upload using stagedUploadsCreate access denied error

video upload using stagedUploadsCreate access denied error

AymanHoff
Visitor
2 0 0

Hey guys, i'm trying to upload a file using the graphql stagedUploadsCreate mutation. I get the signedUrl, then I fill the http request using the response shopify gives me.

However, I'm getting the error:
data: '<?xml version="1.0" encoding="UTF-8"?>\n' +
'<Error><Code>AccessDenied</Code><Message>Access Denied</Message><RequestId>KWFH2ZGPZNGY1QRK</RequestId><HostId>HKknUB/ek/4zi7cg0TjKf5luSJyFV4cLp5KLz4Zujyys61XHF3ZhwynkeullCtWIvaMUa/lrVyw=</HostId></Error>'

My "Shopify App" should have all the required access to upload files (read_permissions and write_permissions) any idea why It's not working?

Replies 2 (2)

genevievem
Shopify Partner
5 1 1

(The post is old but this might help someone.)

If you get a response from the stagedUploadsCreate mutation, your app must have the right scopes. But getting an "Access Denied" error when sending the HTTP request means that there's a problem with your access token/ authorisation header parameter. If you're using Nodejs, make sure to use the useAuthenticatedFetch hook.

 

See https://shopify.dev/apps/auth/basic-http#step-3-make-authenticated-requests 

Muhammad-Bilal
Shopify Partner
1 0 0

Make sure your app has "write_files" scopes.