Hi, I’m facing a very strange problem that I can’t seem to figure out.
I’m trying to make a plugin to insert 2 collection scripts in the current Shopify theme, but every time I get the “Not found” error, but all the inputs are correct, I also checked the theme id and the path of an asset and everything OK
const test = await shopify.api.rest.Asset.all({session: session, theme_id: theme.id, asset: {"key": "layout/theme.liquid"}});
const asset = new shopify.api.rest.Asset({session: session});
asset.theme_id = test.data[0].theme_id;
asset.key = "layout/theme.liquid";
asset.value = "
We are busy updating the store for you and will be back within the hour.
";
await asset.save({
update: true,
});
My response
2023-05-10 06:11:17 │ backend │ HttpResponseError: Received an error response (404 Not Found) from Shopify:
2023-05-10 06:11:17 │ backend │ "Not Found"