Create a module of REST API's ?

Create a module of REST API's ?

  

Hi there,

I want to have, for want of a better phrase, a library of REST API's that I consume saved, so that I can just for instance, import a module with them all in it and then use them.

How do I go about creating a module with say, 20 Consume REST API's in it that I can just keep importing to use ?


Thanks,

Roy.

Solution

Hi Roy,

You can create a blank module and consume the REST API in there. For some guidance on consuming the REST API, you can reference this documentation:

https://success.outsystems.com/Documentation/10/Extensibility_and_Integration/REST/Consume_REST_APIs/Consume_a_REST_API

From there, you will want to create public actions in the logic tab as wrappers for each call to the REST API methods that you need, creating whatever input/output parameters necessary for your use case.

Once you have that all set, you will now be able to reference the public actions that you've created, wrapping the API call's, in any/all modules that will consume the calls.

Let me know if this helps,

Justin

Solution

Thanks Justin, I've just done that for one as an example now. It does seem a shame that you cannot just make a REST API call public in a module. I have to now go and create all the REST API calls, plus identical wrapper s for every one of them. And I need to manually do all the input / output fields of the correct data types around every wrapper also.

If I'm looking to build a public module wrapping up a lot of calls for re-use, it's a reasonable amount of work.

Roy.