Application Programming Interfaces in Oasis

Oasis provides means for tables and models to expose an API – an application programming interface – that can be used by other systems.

Tables

For tables, the options enabling the API can be found under the Source – Actions menu:

Table Menu Option to enable API
Table Menu Option to enable API

This opens a panel that allows any number of formats to be provided:

Example settings for BASIC JSON Format
Example settings for BASIC JSON Format

In the above example, the basic JSON format is selected. On the right the API URL to use is shown, with a sample preview under.

In the below example, the CSV format is selected with the URL it uses.

Example settings for CSV Format
Example settings for CSV Format

An attempt to access a resource that has not been enabled will result in an error:

Example Error Message
Example Error Message

Models

For models, creating an API is provided as one of the Table Functions:

Menu option to add an API to a model
Menu option to add an API to a model

When first created, the API is given a name by the user, but an external URL is not enabled. It can be enabled for external use by editing the model step parameters. For example this model has two APIs.

Example model that has two APIs
Example model that has two APIs

The API named ‘Full’ is highlighted. When clicking the Edit button, a similar set of options to that shown for tables is made available to enable the API:

Settings to enable Native JSON format for a model step
Settings to enable Native JSON format for a model step

In this example, the Native JSON format (as used by Oasis) is enabled. On the right the URL for the API is provided with a preview below.

Summary

In this post, a brief overview has been provided of how APIs can be enabled in Oasis. Both tables and models can be so enabled.

Back to Exploring

trudain.com | All content copyright (c) 2022-2024