Update asset endpoint not working /admin/api/2023-04/themes/828155753/assets.json

Update asset endpoint not working /admin/api/2023-04/themes/828155753/assets.json

lhincapie
Shopify Partner
3 0 2

 

I'm migrating an embedded app to cli 3.0.
Everything is working except when I try to use PUT assets endpoint to update a css asset.

Following the documentation in https://shopify.dev/docs/api/admin-rest/2023-07/resources/asset#put-themes-theme-id-assets, was always throwing me a 404 - not found error

After investigating could not find the error, and trying in postman the request:

 

 

 

PUT: `https://api_key:access_token@shop_name/admin/api/2023-07/themes/theme_id/assets.json`;

const body = JSON.stringify({
asset: {
key: themeFileName,
value: `.... some css`
}
});

 

 


Did not work as well (also tried 2023-04).

The only way is working is using API_VERSION = 2022-10, documentation is the same for both versions, so I would think is a bug because it is not finding the asset (event when the GET request is returning it)

Could you please let me know if there is something missing in the body for these new versions? or is definitely a bug?

Thank you, I would really appreciate the help to be up to date with the latest api version.

Reply 1 (1)

so_dev
Shopify Partner
1 0 0

Looks like this is a result of the Asset API Scope Change, more details in this thread 

 

Asset API Scope changes hurt merchants
https://community.shopify.com/c/graphql-basics-and/asset-api-scope-changes-hurt-merchants/m-p/195890...