Zum Hauptinhalt springen

Call a third-party REST API from a model

To start processes outside Nooxl Apps, a model can call an external REST API and pass data out. You first create a REST API connection and a data query with parameters in Data integration, then use it in a model through a query section.

Set up the data integration

Open Data integration under the app tab and, in Design mode, create the connection, command, and parameters.

Screenshot placeholder

  • 1 Create the data integration.
  • 2 Edit the connection.
  • 3 The data-query command.
  • 4 The data-query parameters.

Connection — choose connection type REST_API. The connection string is a JSON with headers and url; use {{parameter name}} placeholders, defined in the parameter step.

Command — choose NO_RESULT. The command text is a JSON with method and body (currently only post); it can also use {{parameter name}} placeholders.

Parameters — the parameter name in {{ }} is replaced in both the command text and the connection string with values from a model (or the default). A CellRange passes a string array of rows of columns. Options:

OptionEffect
OptionalThe parameter need not be assigned in the model section.
Not modifiableThe parameter cannot be assigned in the model; the default is always used.
Allow null valuesNull values are not treated as an error.

Use it in a model section

In the model you need three markups: two parameter ranges and one trigger range. Then add a query section and configure it:

Screenshot placeholder

  • 1 Choose the data connection.
  • 2 Choose the command and its parameters.
  • 3 Map markups to parameters so values are read from the model.
  • 4 For CellRange parameters set options (Text, Headers, Types).
  • 5 Set the trigger (for example on cell click or on save).

Trigger the call

At run time the user can, for example, set the relevant cells and click the trigger cell; the third-party API is then called with the model's values.