Ecommerce Shopify WordPress Discussion

Asset File Not Updating Via API

I cant update assets with 2023-04 version REST Admin Assets API PUT Request. The API can find assets with theme ID and key, but cant update. @shopify/shopify-api version: 2023-04 Node version: v18.14.2 Operating system: Windows app.get("/api/single_a", verifyRequest, async (req, res) => { try { const sessionId = await shopify.session.getCurrentId({ rawRequest: req, rawResponse: res, }); const session = await sessionHandler.loadSession(sessionId); const client = new shopify.clients.Rest({session}); const response = await client.get({ path: 'themes/id/assets', query:{ asset:{ key: "assets/animations.js" } } }); console.log("value", response.body.asset.value ) response.body.asset.value = "<p>Heloo world </p>" console.log("value changed", response.body.asset.value ) await client.put({ path: `themes/id/assets`, data: response.body.asset }); console.log("Layout of theme liquid", response); res.status(200).json({ response }); // Assuming you want to send themes as JSON } catch (error) { console.error("Error while fetching all Single Asset", error); res.status(500).json({ error: "An error occurred while fetching Single Asset" }); } }); The query return this response logs: Error: Received an error response (404 Not Found) from Shopify: "Not Found" If you report this error, please include this id: 7bfa3dfe-cda0-46cf-a522-ee4a1410b549 Please fix this problem :)
Far as I know, Shopify discontinued allowing Apps to use the API to write Assets. If you check your deprecation notices, you'll see that has been the thing for a year now. Perhaps you updated your API version from an old one that tolerated Asset API writes to the newer standard that does not? Something to check anyway.

January 7, 2024

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.