I was trying to update the theme code in Shopify layout/theme.liquid in 2024-01 version
https://{shopname}.myshopify.com/admin/api/2024-01/themes/{themeId}/assets.json
it returns 404 Not found error. but it was working in the 2023-01 version. now it’s deprecated. Is there any workaround for this issue?
Starting with Admin API 2023-04, Asset resource PUT or DEL requests are restricted using the write_themes access scope. If an app that’s distributed in the Shopify App Store needs to use Asset resource PUT or DEL requests, then it needs to be granted an exemption by Shopify to use the write_themes access scope.
As an alternative, you can use theme app extensions, or instruct merchants how to add code to their theme using the following tools:
- A custom Liquid section or block
- The custom CSS setting
- Deep-linking to a specific file and location in the code editor
Apps must obtain an exemption or migrate before March 31, 2024.
Review the sections below to learn whether your app is eligible for an exemption, and how to apply for an exemption, and some alternatives to the Asset resource that you might consider for your app.
You can still use the Asset resource to read theme files without an exemption.
For more details refer https://shopify.dev/docs/apps/online-store/other-integration-methods/asset