[Data Grid] How to handle APIs that require parameters in body?

Forge Component
(34)
Published on 12 Feb (9 days ago) by OutSystems R&D
34 votes
Published on 12 Feb (9 days ago) by OutSystems R&D

I have an API that requires 7 input parameters that should be received in the header.   I've been successful implementing the DG with Params in the URL but haven't seen any examples of header parameters.   Anyone had luck with this?

Also, is it possible to just ingest a web service in OS and pass the JSON to the Datagrid vs just providing the URL?   It seems like this would be a easier way to handle complex APIs.

Solution

Hi Josh. 

You can expose your own Rest endpoint in Outsystems. That service would call the external API and return the JSON, then consume that endpoint in the data grid.

Keep in mind this will expose probably sensible parameters in the URL on the call between datagrid and OS endpoint, so you should probably use a token based approach that fetches info from the database.

Solution

Afonso Aguas wrote:

Hi Josh. 

You can expose your own Rest endpoint in Outsystems. That service would call the external API and return the JSON, then consume that endpoint in the data grid.

Keep in mind this will expose probably sensible parameters in the URL on the call between datagrid and OS endpoint, so you should probably use a token based approach that fetches info from the database.

That would work, however, it would be very nice if in a future version of Datagrid they offered the option to just pass the JSON structure to the grid.   That way we wouldn't need to create an API in the middle like this.