Using the Shopify Theme API (Link), I’d like to be able to get the theme ID for the currently active (main) theme.
I’m using the api gem as follows:
Shopify::Theme.find(:all, :params => { :role => 'published' })
It returns every installed theme and not just the main, published theme. Can I access a Theme this way?
You can’t filter on role the way you’re trying to.
However, seeing as each shop can only have a maximum of 8 themes it’s not much effort to simply grab all the themes with
ShopifyAPI::Theme.alland then search through them for the one being used as the main one.