Oracle APEX 21.2 - Best way to call a REST API

147 Views Asked by At

What is the best way to set up a REST API call in APEX? I am trying to use the Google Translate API (basic) to send it text string(s) and target language code, and then have it return the translated string for me to replace in the DOM.

The url API call is:

https://translation.googleapis.com/language/translate/v2?key=[api_key]&source=[en]&target=[es]&q=[This is a sentence to be translated.]

I first set it up as a REST Data Source, but now thinking this is not the best way to do this as I do not know how to dynamically change the query params and then handle the JSON response that is returned.

What is the best way to call a REST API? Pass in params dynamically? and then deal with the response? Ideally I would like to set this up in a way so that the whole app can reuse it.

I am trying to understand the differences (or different uses cases) for:

  • REST Data Sources (Shared Components)
  • Legacy Web Service References (Shared Components)
  • REST Enabled SQL (Shared Components)
  • RESTful Services (SQL Workshop)
0

There are 0 best solutions below