We want to create a template where colleagues can choose which templates should be used. Can we then, based on the chosen reconciliation handles, create an export via the API with those specific handles ?
So let’s say the user has 5 options and the user chooses 1,2 and 3, we then want to do an API call that exports them together and/or multiple API calls for the 3 different PDF instances.
The identifiers for such a export style cannot be obtained through the API, so they’ll have to be hard-coded in your application. The identifier can be found in the URL for each of these styles when editing a style:
Compare the selection with a mapping that holds the fixed identifiers for each of the export styles to obtain the export_pdf_id’s to be used for the next step.
These would be the basic layout of your application, there’s a couple things to take into consideration:
How will the liquid template be set up? The selection would ideally be stored in customs so they can be easily picked up via the API, and the input should be fixed so it can be mapped with the fixed list of export pdf styles.
What will the call-to-action be?
*This could either be a button within the template, or an AppLink that’s only registered for that specific template. I’m not sure what you had in mind for that? * An AppLink allows a user to perform a call-to-action using the action menu within the template: Register an app link A button within the template works in a similar way, where both are using a target_url to initiate the API flow.
Does this already provide you with a bit more information?
Please let me know if you have any more questions or if anything is unclear.
Thank you for help already. I still have one question: Do I have to create a style for all these options?
Let’s say we create a style with 10 documents included (by default). According to the template only 5 documents should be included (other 5 are or are not starred, may not matter). Can I trigger the style and configure it in a way that than only those 5 templates will be exported (as 1 PDF)?
In case we want to send the 5 documents separately, does this mean we’ll have to create a style for every single instance/option we have?