Solved

Download settings_data.json file from API

aurelien-r
Shopify Partner
7 0 1

Hi, is there a way to download the settings_data.json file with an API? Or in absolute terms, a way to access these settings programmatically (not through the Shopify interface). Thank you!

Accepted Solution (1)

garyrgilbert
Shopify Partner
397 40 165

This is an accepted solution.

Hi Aurelien,

 

Yes you would use the asset api to get/put theme assets

 

https://shopify.dev/api/admin-rest/2023-01/resources/asset

 

you need the theme's id and then you should be able to get it with:

 

/admin/api/2023-01/themes/[theme_id]/assets.json?asset[key]=config/settings_data.json

 

Cheers,

 

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution

View solution in original post

Replies 3 (3)

garyrgilbert
Shopify Partner
397 40 165

This is an accepted solution.

Hi Aurelien,

 

Yes you would use the asset api to get/put theme assets

 

https://shopify.dev/api/admin-rest/2023-01/resources/asset

 

you need the theme's id and then you should be able to get it with:

 

/admin/api/2023-01/themes/[theme_id]/assets.json?asset[key]=config/settings_data.json

 

Cheers,

 

Gary

- Was my reply helpful? Click Like to let me know!
- Was your question answered? Mark it as an Accepted Solution
aurelien-r
Shopify Partner
7 0 1

Thanks a lot works like a charm!

EcomGraduates
Shopify Partner
590 48 80

Hello there!

 

Yes, you can access the settings_data.json file programmatically through the Shopify API. The Shopify API allows you to retrieve and update data in a Shopify store, including the settings data stored in the settings_data.json file. You can use the Shopify API with any programming language that can make HTTP requests and parse JSON data.

 

To access the settings_data.json file through the API, you would need to make a GET request to the /admin/themes/{theme_id}/settings.json endpoint, where "theme_id" is the ID of the theme for which you want to retrieve the settings data. You'll need to provide authentication for the API request, such as an API key and password, or an OAuth token.