To open the API designer, open the Profound.js IDE (https://profoundlogicsupport.atlassian.net/wiki/x/mQLOCQ) and click New > API File to add a new API, or edit an existing file with the extension "api.json."
While you are editing or adding an API File, the following API Designer will be presented:
This API Designer has several sections:
1. Files Tree tab: In this example, you'll see that an API file (a filename that ends with .api.json) was opened.
2. API Routes section: This is a list of APIs stored within this file. Here is where you will select, add, update, copy, and remove APIs.
3. This is where you will provide information about the selected API.
4. API Logic section: Use Low-Code steps and plugins to program the selected API routine.
5. Input Parameters and Output Parameters: This is where you will define inputs and outputs for the selected API, as well as order and document them.
All parameters are validated before running any of the API logic.
You can add nested child parameters. Simply add a parameter with the type "object", select it, and click the add parameter icon again. The new parameter will be added as a child.
You can also drag-and-drop the parameters to order them as you like.
You can create a different set of output parameters for each HTTP status you’re going to use.
For each parameter you define, you can specify:
Name: Unique name for this parameter (at this level)
From: Where will the input parameter come from
query is for simple values and used with GET HTTP methods
header parameter are not commonly used as parameters, but they are supported
body is for more complex values such as all of the parameters for adding a new customer
Data type: The type of value that will be sent to the API.
On input parameters and when "from" is set to "body", a new item becomes available called "object", allowing for complex parameters.
If a parameter is defined as an integer and the parameter value contains alpha characters, an error will be returned to the caller before your API logic.
Same is true for all parameters. All values sent must be convertible to this type. If not an error is returned to the caller before your API logic.
Required: Check if the input parameter must be passed and must have a valid value.
Example: An example of what the parameter value should be. This is an example value not a default value.
Allow Multiples: Check if the input parameter should be an Array.
If a input parameter is defined as an Array, but parameter value passed is not an array, an array will be created with that value as the only element, and then passed to your API logic
If a input parameter is not defined as an Array, but parameter value is an array, the first valid value from that array will be passed to your API logic
Is Array: Check if the output parameter will be returned as an Array.
Deprecated: Check this if you want to mark this parameter as deprecated or soon to be removed. The parameter will appear as deprecated in the API Explorer..
Description: Describes the parameter. This field supports CommonMark.
6. API Options section: This is where you can access other API tools from the IDE.
OpenAPI Configuration: This will open the openapi.json file where you can set up:
API Explorer - This will open a new browser tab where you can explore all of the enabled APIs
API Dashboard - This will open a new browser tab where you can see more statistics about the server and all the enabled APIs
Security Store Configuration:
Statistics Store Configuration:
Find API File - If you do not know the API filename, then this is a great way to find an API