Dynamic Body Values in Rest API Resource?

We are trying to build a Rest API Resource where the values of the Body keys are dynamic and should be set in the Workflow or App where the Resource is used. For example, let's say we have a resource with the Body Key called: TemplateModel - the value of this key is not fixed and can be different depending on a value in a workflow or App. The problem we now face is that if we set the value of TemplateModel key in the Resource, then we can't adjust it dynamically in the App where it is used. If we try to use a variable in the Resource for the Value, the Key doesn't show up in the app where we can set the value dynamically. So we are left having to manually recreate the Rest API in every single app and workflow, which is a massive pain. How we can set up a resource, so the Body KEYs are set, but the Values of those keys will be dynamic based on the App? I hope my question makes sense. I couldn't find anything in the docs about this. The use case is that we don't want to set up a Rest API manually each time we use it. The Keys are always the same, but the Values of those keys are dynamic depending on the values send back by the app. Thanks.

1 Like

@ddsgadget You can utilize the Query Library to create or add your REST API, which can then be used in any app or workflow.

Thanks, but how do you use the query library in a workflow? I could see how to call a resource, but didn't see any option how to use a query from the query library in a workflow (in an app, we do this all the time with the + icon on the left panel).

You can use the query library in workflows.

import-query-libarary-in-workflows