A space to discuss online store customization, theme development, and Liquid templating.
Hello,
I'm trying to work with the assets API (https://shopify.dev/docs/api/admin-rest/2024-04/resources/asset) but cannot get it to work. I installed a development app with the write_themes scope granted in my store not using the public app, but somehow, when I send a PUT request to create a new JSON theme file, it never creates a new theme file. How can you guys get this to work?
Here is what I call the API on Postman.
Thanks for your help.
Hi Vietnguyen09,
That's strange as it looks like you're receiving back a 200 response that indicates the API call was successful. If you try to upload a file instead of defining a value for the file, (eg: adding a image to the /assets directory) do you see the file appearing?
Liam | Developer Advocate @ Shopify
- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
- To learn more visit Shopify.dev or the Shopify Web Design and Development Blog
Thank you for your attention to my problem. I found a solution. In the image above, I used my own domain instead of the myshopify domain, and it didn't work. When I changed it to xxx.myshopify.com/admin..., it worked well. I guess there is an issue when the Shopify system forwards the header/post data from my domain to the myshopify domain.