The correct way to reuse RESTFul call microflow?

0
I’m building an app which is calling a lot of RESTful API endpoints. I can call these endpoints easily with “Call REST service” activity, however, these endpoints calls share a same header param list(very long), I have to set for every one. What I can figure out is that I could use a javaaction to archive this, that I can just pass path, method, and query body. Is there a correct/simpler way to do this, like without writing any java code?
asked
2 answers
2

As Eline mentioned, create a microflow which you can reuse as sub-microflow at all locations where you want to call the same REST endpoint.

Using input parameters, you can define the required input of the sub-microflow, depending on the calling main microflow = making your inputs dynamic.

OR (not very clear in your question what your scenario is)

If you want to call different REST api’s with the same header, then I would create a sub-microflow which defines and returns the header and add that sub-microflow before each REST call and use the output of the sub as header parameter.

answered
1

You could simply use the same subflow for each of them and set the parameters in that one. You'll have to pass some parameters to the subflow, such as the endpoint, so that it can call various endpoints.

answered