Creating an API Service
Last updated
Last updated
To create,
Open the APIs engine, click'', and select Create API.
Give your API a unique name and select the entity you want to map to it.
Next, select the input and output parameters (attributes).
That creates your API.
When you create an API, the services required to perform CRUD (Create, Read, Update, Delete) activities are automatically added to assist you in handling data.
After you create an API service, build a flow for it.
Every API comes with a default flow attached to it. Double-clicking the API opens it on the canvas. You can customize it to meet your specific API requirements or create a new flow from scratch. Be sure to include "Start" and "End" nodes in your flow in both cases.
The three methods to build a flow for your API:
Use the flow elements available in the Toolbox to build an API flow.
Begin by adding a Start node. Then, search for the elements required for your API and drag them onto the canvas. After you add all the necessary tools to your flow, complete it with an End node. Then, configure the flow elements as you want them to behave.
Alternatively, you can use the quick access tools to ease your work. These tools include options to configure and change the plugin type. To access the quick-access toolbar, click on an element in the canvas, hover your mouse over the arrow, and you'll find quick actions to add activities and configure them.
While building a flow for your API, you may be required to group the elements, duplicate them, and so on. All such actions that you can take on them are available in the canvas toolbar.
The last method is to import an existing flow for your API. Right-click your API and select Import Flow. Select the “.apiflow” file and import it. You can alter it to suit your needs.
After you finish building a flow for your API, save it.
Similarly, configure all the plugins in your flow. Finally, save your flow.
Validating the flow helps you ensure there are no errors or faulty connections.
Best Practices:
Choose the right entity when creating an API, as you cannot change it later.
Rename each element before configuring it when adding one to the flow.
Make sure to configure all the plugins in your flow before validating it.
Now, your API is ready to use within the app. To make it available for other apps to consume, publish it. click here, to refer to the publishing process.
To group the flow elements, select them on the canvas and click.
To create a copy of an element or a group, select it on the canvas and click.
If you wish to save any customized element, select it on the canvas and click.
Should you wish to rearrange your flow, click. Click Rearrange to start the beautification process, and keep clicking Next until the process reaches 100%.
Another way to build an API flow is by using templates. Clickin the canvas toolbar, and select Sample Templates. Choose one from various templates available for different flow patterns, and import it to utilize. You can alter it to suit your needs. Be sure to save it if you have made any changes to it.
Configure the plugins in your API flow to define what they should do. To configure, clickfrom the the quick-access toolbar. Configure the plugin and save your configurations. For instance, if your flow involves a "File Download" plugin, you need to configure in what format the file should be downloaded, file type, file name, and its data type.
Once your flow is ready, validate it by clickingin the canvas toolbar. As you initiate the validation, the platform flags any missing or faulty connections and highlights the plugins that are unconfigured.
As a final step, click, to playback test your API to ensure it works as expected. Logs generated here help you debug and resolve them.