Getting MissingSecurityHeader when I try to upload a video after calling stagedUploadsCreate

Hi there,

when I try to upload a video MP4 file using the I receive an HTTP Status Code of 400 (Bad Request) and the response body

<Error>
  <Code>MissingSecurityHeader</Code>
  <Message>Your request was missing a required header.</Message>
  <Details>Authorization</Details>
</Error>

I did a mutation call before to

stagedUploadsCreate

and got back this parameters for example

googleAccessId video-production@video-production-225115.iam.gserviceaccount.com

key c/o/v/69aba68a688f4e97a19d69e369ad495e.mp4

policy eyJjb25kaXRpb25zIjpbWyJlcSIsIiRidWNrZXQiLCJzaG9waWZ5LXZpZGVvLXByb2R1Y3Rpb24tY29yZS1vcmlnaW5hbHMiXSxbImVxIiwiJGtleSIsImMvby92LzY5YWJhNjhhNjg4ZjRlOTdhMTlkNjllMzY5YWQ0OTVlLm1wNCJdLFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLDc2NTI2NzEsNzY1MjY3MV1dLCJleHBpcmF0aW9uIjoiMjAyMi0xMi0wNFQxMzo1ODoyNFoifQ==

signature FdhAHcCFl1wRyoTBIO8ptItSoS6KZveVFIz/xxhJQYwwlkrm+RADj8IOwXVqmfVznI9X2TY9BHch4ySBeY33+RdWs1gcBm1j8aV/Js6h6JAWNrZurhmqw5eWP5iWRBG4HKt77I44R90hdf1f+8/a3Qd5RopmVTlpZT4eS+imSsBX+4rRlUeDbVS0rk0zoIAvNisliWVsN9c+13v03JQn0xXKvwjhw8a5G2h0e4M542LU3x7icjgH++NCgOnzUMcmC6jotFrNBA4wY68uG3Ic044VcqKJJchRkBOl1WGuim6KBeNw9a98Xcz3b5zdcsqTGQCxOKpmMbOvEtusM9+7fg==

url https://shopify-video-production-core-originals.storage.googleapis.com

Then I do a PUT call to the received URL and I got the aboved mentioned error.

My curl call looks like this for example

curl -X "PUT" "https://shopify-video-production-core-originals.storage.googleapis.com/" \
     -H 'X-Shopify-Access-Token: <DONT_TELL_ANYONE>' \
     -H 'Content-Type: multipart/form-data; charset=utf-8; boundary=__X_PAW_BOUNDARY__' \
     -F "GoogleAccessId=video-production@video-production-225115.iam.gserviceaccount.com" \
     -F "key=c/o/v/69aba68a688f4e97a19d69e369ad495e.mp4" \
     -F "policy=eyJjb25kaXRpb25zIjpbWyJlcSIsIiRidWNrZXQiLCJzaG9waWZ5LXZpZGVvLXByb2R1Y3Rpb24tY29yZS1vcmlnaW5hbHMiXSxbImVxIiwiJGtleSIsImMvby92LzY5YWJhNjhhNjg4ZjRlOTdhMTlkNjllMzY5YWQ0OTVlLm1wNCJdLFsiY29udGVudC1sZW5ndGgtcmFuZ2UiLDc2NTI2NzEsNzY1MjY3MV1dLCJleHBpcmF0aW9uIjoiMjAyMi0xMi0wNFQxMzo1ODoyNFoifQ====" \
     -F "signature=FdhAHcCFl1wRyoTBIO8ptItSoS6KZveVFIz/xxhJQYwwlkrm+RADj8IOwXVqmfVznI9X2TY9BHch4ySBeY33+RdWs1gcBm1j8aV/Js6h6JAWNrZurhmqw5eWP5iWRBG4HKt77I44R90hdf1f+8/a3Qd5RopmVTlpZT4eS+imSsBX+4rRlUeDbVS0rk0zoIAvNisliWVsN9c+13v03JQn0xXKvwjhw8a5G2h0e4M542LU3x7icjgH++NCgOnzUMcmC6jotFrNBA4wY68uG3Ic044VcqKJJchRkBOl1WGuim6KBeNw9a98Xcz3b5zdcsqTGQCxOKpmMbOvEtusM9+7fg==" \
     -F "file=@/Users/cha/Downloads/iban_2.mp4"

Also, when I use the returned resourceUrl (from the mutation call stagedUploadsCreate) I’ve got the same error message and status code.

So, I have no clue what might be wrong here since the documentation I found at

https://shopify.dev/apps/online-store/media/products#step-1-upload-media-to-shopify

says nothing about any additional needed headers or any other requirements.

By the way: If I do a post call as mentioned in the documentation I got back this error message (even if I provided POST as the httpMethod within the mutation call stagedUploadsCreate):

<?xml version='1.0' encoding='UTF-8'?>
<Error>
	<Code>InvalidArgument</Code>
	<Message>Invalid argument.</Message>
	<Details>Cannot create buckets using a POST.</Details>
</Error>

Any help will be appreciated.

Regards

Christian

I found the problem by itself. It was an error in the HTTP Framework I used… Sorry for that.