Service invocation API
In this guide, you’ll simulate and access an application by running and calling the FlowSynx API directly.
Step 1: Open terminal
- Linux/MacOS
- Windows
You will need to use sudo
for this quickstart if:
- The install path is
/usr/local/bin
(default install path).
Run Windows Terminal or command prompt as administrator.
- Right click on the Windows Terminal or command prompt icon.
- Select Run as administrator.
Step 2: Run the FlowSynx
flowctl run
After executing this command, FlowSynx starts to be running and the logs like below will be displayed.
[time=2/1/2024 6:50:39 PM | level=INFO | machine=TEST-PC] message="Now listening on: http://[::]:5860"
[time=2/1/2024 6:50:39 PM | level=INFO | machine=TEST-PC] message="Application started. Press Ctrl+C to shut down."
[time=2/1/2024 6:50:39 PM | level=INFO | machine=TEST-PC] message="Hosting environment: Production"
[time=2/1/2024 6:50:39 PM | level=INFO | machine=TEST-PC] message="Content root path: _____________"
Step 3: Calling API
Open a new terminal and enter the below command (in this example List
command will be called to getting list from given path):
- HTTP API (Bash)
- HTTP API (PowerShell)
curl -X POST -H "Content-Type: application/json" -d '{ "entity": "/", "options": { "fields": [], "filter": "", "caseSensitive": false, "recurse": false, "sort": "", "limit": "", "includeMetadata": false }}' http://localhost:5860/list
Invoke-RestMethod -Method Post -ContentType 'application/json' -Body '{ "entity": "C:/", "options": { "fields": [], "filter": "", "caseSensitive": false, "recurse": false, "sort": "", "limit": "", "includeMetadata": false }}' -Uri 'http://localhost:5860/list'
After executing the command, the result will be returned to you in the form of json
data.