Api Open Studio for developers
This page gives a high level overview of some of the technical aspects of Api Open Studio for developers.
ApiOpenStudio allows you to create and maintain API’s quickly and efficiently in a low-code environment. It gives you all the benefits of working in a coding environment, without the hassle of learning the language, syntax errors and all the usual issues that multiply your development time.
ApiOpenStudio enables a new tier to the traditional
n-tier architecture, allowing business and programmatic logic to be applied to data before it arrives at your application
Roles & access rights
The default roles allow granular access to properties in the ApiOpenStudio system.
You can also create custom roles to enable access to specific resources in applications or access to resources in multiple applications
Resources and processors
At the heart of ApiOpenStudio, and processors and resources.
Programs can be reduced down to simple semantic blocks, e.g. foreach, do, while, fetch data, etc.
That is exactly what processors represent, the semantic blocks in programming (essentially functions, if you take the purist view of Functional Programming) – data (or multiple data points come in), is processed and then output. this output is either the final output of the resource, or the input into another processor.
Processors are essentially modules. A lot are shipped with ApiOpenStudio base install, but can create your own, or install community contributed Processors.
Resources are what loom the processors together into the logic of your resource, and where you will do all your work.. You define the logic of how the data flows from one processor into another, through to the final result which can be in the resource response, stored on a remote server or sent in an email.
Resources can be imported and exported in OpenApi format, or created/edited/deleted in the administrative interface.
All API resources are stored in the database. You can import and export all resources (if your user has sufficient privileges) in JSON or YAML format to work on in your favourite IDE, or work directly in the Admin GUI. The files can be split into 3 main sections.
Security is defined at the resource level, in a granular fashion. This is defined the security section in the JSON/YAML for each resource, enabling fine-grained control for each resource or by groups of resources.
Security features include:
* JWT tokens
* Bearer tokens
* Authenticated role based access
* X-CSRF tokens
Or you can omit security entirely and open your resources to public access.
Programming and processing of data can be reduced to basic semantic blocks, like:
* Do this
* While condition
* Do something else
* Fetch the result from a remote endpoint
* Do something to the data
* Foreach item in the data
* Get something from this
* Return the result
This is where ApiOpenStudio operates. ApiOpenStudio defines each of these semantic blocks as entities, called ‘PROCESSORS’. Data flows through multiple inputs and outputs in the processors, through to the final result.
As the developer, you define the processors that you want to use and how they link together – what output from a processor flows into another processor. In this way, you can very quickly build up a very complex programme.
Sample resource file
# Processors resource. # # @package Apiopenstudio # @license This Source Code Form is subject to the terms of the ApiOpenStudio Public License. # If a copy of the license was not distributed with this file, # You can obtain one at https://www.apiopenstudio.com/license/. # @author john89 (https://gitlab.com/john89) # @copyright 2020-2030 Naala Pty Ltd # @link https://www.apiopenstudio.com name: Processors description: Fetch details of processors. uri: processors method: get appid: 1 ttl: 3600 security: processor: token_roles id: processors_security token: processor: bearer_token id: processors_token roles: - Account manager - Application manager - Developer validate_account: false validate_application: false process: processor: processors id: processors_process machine_name: processor: var_uri id: processors_machine_name index: 0
The above file ships with core, and returns all metadata of a specific processor or all processors.
Looking in detail into the process section, it implements only one processor (processors).
processors has a single input that it requires (machine name). The value for this is fetched from the first URI index, using the var_uri processor.
ApiOpenStudio is an open source project. This means that you can raise issues at the GitLab repositories for the community to fix:
You can find answers to, or ask your own questions at /questions-answers.
Or even contribute yourself! Contributing guidelines are available at the above repositories, and also at Wiki – Contributing