Hi all,
I am trying to upload some files from our server to our Shopify store using the GraphQL api.
I am following this guide from the official documentation: https://shopify.dev/api/examples/product-media
aswell as this tutorial: https://dev.to/fatihsamur/bulk-product-upload-on-shopify-using-graphql-admin-api-with-php-33ki
The query seems to be executing and I am getting this response back:
{
"data":{
"stagedUploadsCreate":{
"stagedTargets":[
{
"url":"https:\/\/shopify.s3.amazonaws.com\/tmp\/984219684\/products\/33057b4b-0c1c-47ee-89e9-0fbd718d2ad6\/68-07-60459-196_ls1.jpg?x-amz-acl=private&X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAJYM555KVYEWGJDKQ%2F20220913%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20220913T085635Z&X-Amz-Expires=900&X-Amz-SignedHeaders=host&X-Amz-Signature=3b8592fd45e9214d6bff4a4bff7b098b3ac9959f6cc9057b0c5f3638dbbb9ed7",
"resourceUrl":"https:\/\/shopify.s3.amazonaws.com\/tmp\/984219684\/products\/33057b4b-0c1c-47ee-89e9-0fbd718d2ad6\/68-07-60459-196_ls1.jpg",
"parameters":[
{
"name":"content_type",
"value":"image\/jpg"
},
{
"name":"acl",
"value":"private"
}
]
}
],
"userErrors":[
]
}
},
"extensions":{
"cost":{
"requestedQueryCost":11,
"actualQueryCost":11,
"throttleStatus":{
"maximumAvailable":2000,
"currentlyAvailable":1989,
"restoreRate":100
}
}
}
}
I am now at the curl stage of the official shopify documentation.
I noticed that most of the curl parameters that I required were actually in the “url” part of my response.
So after untangling them I also noticed that I am missing several parameters and seem to have several new ones, for example the “AWSAccessKeyId” is not present but I have instead a “X-Amz-SignedHeaders” parameter, those are just a few examples.
I am not even sure why I am not receiving the response the same way as in this tutorial: https://dev.to/fatihsamur/bulk-product-upload-on-shopify-using-graphql-admin-api-with-php-33ki (because it seems strange that I have to untangle the parameters from the url).
I am quite lost on how to proceed with the curl multiform part and would appreciate any help.
I am new to GraphQL so please forgive me as I am still learning
Thanks in advance,
Matthias