A space to discuss online store customization, theme development, and Liquid templating.
Hi All,
How can I troubleshoot the 'Not Found' error when attempting to update a theme asset using the Shopify API with the scope 'write_themes'?
I have verified the correct theme ID and asset key, and ensured that the asset exists in the specified theme. Are there any additional considerations or permissions required to modify theme assets?
I am using shopify-app-template-php - I followed the documentation, please find my code below:
$asset = new Asset($session); //verified, OK
$asset->theme_id = $themeId; //verified, OK
$asset->key = "templates/product.liquid"; //verified, exists, OK
$asset->value = $updatedContent; //my updated content to product.liquid file. Basically I would like to add someghing like: {% include "my_custom_liquid" %} to product.liquid
$asset->save(true);
Response from Shopify\Exception\RestResourceRequestException:
REST request failed: "Not Found"
Many thanks!