According to https://help.shopify.com/en/api/guides/modifying-online-store/app-sections#appsectiondata. You can use the rest API to add an app section to a page with an API call by passing the AppSectionPath to the section_file property of the app section. However There is no documentation to state the format or how to get the AppSectionPath of your created app section.
What value do we need to use here in order to add an app section via the api and how can I get the section_file/appSectionPath of my app section?
Hey there @Andrew-Corknine
The method for how we are surfacing the path for app sections is something our internal dev team are currently working on. What would be a use-case of working with the REST API to insert app sections in pages that would be helpful in your workflow? An insight into use-cases will help inform our internal dev team who are implementing a solution that would provide the best experience for merchants and partners using the new online store editor.
Shopify | Partner Education
I see many use cases, however the first one is the following.
- Our app creates an app section(a button for the customer account page that links to an app proxy page also created by the app)
- We would like to add this button programatically to the top of the page so the merchant doesn't need to do anything to add it, they could then change or adjust it in their theme editor.
We are trying to use the API as it is described in the sections api documentation, as the documentation is written this would be possible, however the docs say to use the app section path but I cannot find out what the AppSectionPath of my app section is.
These examples will be helpful when reviewing how best to surface app section paths and outline best practices for use. I'll post here when there's a further update.
After exploring options for app section paths, we've decided not to expose the app section path via the API at this time. The model we will be advising will be that app sections are added to pages through the Online Store Editor by merchants, rather than programatically inserted into pages via the API. This will give merchants greater control over their store and allow them to decide where exactly app sections will be added.
Thanks for your input and feedback on this,
Hi @Liam ,
I have to say that is a bit disappointing. The ability to add a very simple section programatically would make it much easier for customers to get setup using apps immediately without having to adjust their theme. We could even put this behind a confirmation(Are you sure you want to add the section to your theme?)
The real win for us with being able to do this programatically is that we could add the section with sane default settings(specific for the shop) and then when they wen't to the online store editor they would easily be able to change, manage and move this already populated section.
As an example. We run a digital delivery app. We want to add an app section to the Customer Account page that is just a link to the customers downloadable content. With the current implementation the user would have to install our app, then read instructions to go to the online store editor, Create an account and an order with for the product with digital goods, navigate to the customer account page, click add section, select app sections and then add our app section.
If we could do this responsibly using the api we could just add have an option to add the section for them which would be much easier for the merchant.
Please re-consider. I can see how this could be abused by a bad app, however I feel that should be stopped in the review process and apps that abuse this should not be tolerated by Shopify, instead of restricting an interaction that makes things easier for merchants.
Thanks for the description of this use-case, it's certainly a valid use for being able to add a section programatically. For the time being however the app section path will not be exposed, but we'll review the best process to facilitate use-cases like the one you have described.