API call with customized reconciliations

Hi

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.

Can someone help?

Hi @JelleBe

Thank you for posting this question on the community!

This should be possible through the API, although it will require a couple steps to eventually perform the different PDF instance exports.

It’s also important to note that PDF instances rely on an export style, this means that the identifiers are not linked to a handle.

There’s two types of export instances which can be created via the API:

As indicated, the PDF instance is generated from an export style:

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:

live.getsilverfin.com/f/{firm_id}/export_configurations/{export_pdf_id}/edit_template_hash

For the export file instance endpoint, the identifiers are listed with this API endpoint: List all existing export file templates

Let’s apply this to what you’re trying to set up.

  1. The liquid template will have to contain a fixed selection or dropdown with fixed list
  2. Once you receive the call-to-action, you can obtain the results or customs from the template to obtain the selection made: Get all custom parameters of a reconciliation for this period
  3. 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.
  4. Create the export pdf instance(s): Create a new export pdf instance
  5. Perform the get requests for each of the export pdf instances from step 4 to obtain the actual PDF content: Get details of an export pdf instance

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.

Hi Jelle

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?

Thanks!

Jelle

Found it already. Thanks!

No worries - let me know if there’s anything else that’s unclear! :+1: