The easiest way to Publish a new API to external consumers is to Springboard them. When you Springboard an API we will automatically create everything you need to have an API running where an external consumer can
Retrieve a collection of Entities using GET method
Create a new Entity in Flowfactory using a POST method
The elements created by the Springboard are:
Virtual Contract Entities that mirror the entity you are building your API with
Workflows to handle the logic of creating and fetching entities
A fully configured API with Endpoints for PUT and GET
1. Get started
All you need to do is to open Integrations → Publish API
Then click Springboard API in the Ribbon menu.
This opens up the Springboard API dialog where you select the the Entity that you want to expose using an API. This can be any Persisted Entity in you data model. In this example we use the Product Entity.
After you click OK we will Springboard the following elements:
1. API Area
This is where your API base is configured and where you setup your methods and connect workflows. When we Springboard your API we will create the basic configuration for the API. Below you find an example of the Product API where we have created a GET and a POST method and connected those to new workflows.
Your endpoint is shown as Endpoint URL and this is the URL that is used from an external consumer to access the API.
2. Contract Entities
Contract entities are the entities that are exposed using the API. These are separated but mapped to your persisted entities in your system. You can modify and change these contracts without interfering with your persisted data model in Flowfactory.
3. Workflows
For your API to handle the logic of fetching and creating persisted entities your API is connected to a Workflow where your application logic is performed.
Below are two examples of workflows
1. Create a Product in Flowfactory using API
This workflow will be executed when a POST call is made to your Product API. The API expects an API Contract: Product in the call. (see section Access API from external application)
2. Fetch all products from GET method.
This workflow will make a query in Flowfactory to fetch all products and then add them to a new instance of API Contract: Product Collection. This will then be returned from the workflow and then returned to the API as JSON.
This is all that you need to expose functionality to external consumers using APIs in Flowfactory.
To test your API you can follow this guide Call the Flowfactory API from an External Application
Comments
0 comments
Please sign in to leave a comment.