Versions Compared
Key
- This line was added.
- This line was removed.
- Formatting was changed.
Insert excerpt | ||||||||
---|---|---|---|---|---|---|---|---|
|
What is an API Endpoint?
Excerpt | ||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||
API endpoints can be setup to enable external systems to make calls to PhixFlow. API endpoints can be seen in the Repository for your application under
|
Excerpt | ||
---|---|---|
| ||
Creating an API Endpoint |
API endpoints must be made using the specific option on the
|
|
|
Excerpt | ||
---|---|---|
| ||
This allows anyone with the URL for the API to call it. The audit trail records the system as running performing the API call. |
Adding authorisation is covered on API Authentication and Secret Keys.
Copy the URL and save it locally, to be used later when calling the APIExample URL: https://app.phixflow.com
Input Parameters
Image Added On the Input Connection Point, additional Input Parameters can be created to facilitate query string parameters being passed into the API via the URL.
The Name set on the |
App/ |
Api/trigger?field=abc then the value "abc" will be used as a parameter. When calling APIs using query string parameters in the URL, care should be taken to ensure that the values are appropriately URL encoded to prevent unexpected behaviour. See /wiki/spaces/HELP12/pages/9615606000. If a parameter is missing then it will be marked as unavailable, unless a Default Value has been configured.
URL & URL AliasURL and URL Alias can be found on the API Endpoint
|
|
|
|
|
|
URL Alias ExampleIf the API URL is, https://server.phixflow.com/phixflow/api/1/action/My%20App/My%20API%20Endpoint/trigger and a URL Alias of Company Data is set, then the API URL will change to, https://server.phixflow.com/phixflow/api/2/Company%20Data API ModeAPI Mode can be found on the API Endpoint
Choose an API Mode:
AuthorisationAllow Anonymous Connections can be found on the API Endpoint
If Allow Anonymous Connections is enabled:
Note: Adding authorisation is covered on /wiki/spaces/HELP12/pages/9615607547. TimeoutTimeout can be found on the API Endpoint
Set a Timeout (optional):
|
- See Worked Example below for an example setup
Input and Output Attributes
API Status Check (Poll for Result)
Calling a PhixFlow APIHTTP MethodThis is set on the
See /wiki/spaces/HELP12/pages/9615606000. Returned Data JSON PathIf your API has been configured to return data the path will be in the format:
Where <<Output Name>> is the Output connection point. Server Console ResponsesThe item calling the API endpoint will receive the Response from the API endpoint stating whether it has run successfully (Success) or not (Fail). Responses can be customised to return specific messages. The response recorded in the
If you are making the call using PhixFlow the Responses can be access as follows:
API Endpoint ResultsTo see the results of the API Endpoint processing in the
FailuresAn API Endpoint will fail if the logic in the Actionflow fails or if the |
/wiki/spaces/HELP12/pages/9615607495() function is used to force a failure. If records are passed to the API Endpoint individually a failure will only impact the specific record being processed. Error Codes200
400
|
Worked Example
Here's a worked example using the Company Data (available from the Learning Centre).
In this example, we are using:
- A Company Call API screen containing a fixed drop down list of industries, a string fields for the API Status and a multi-line string field for the Results - this screen was created using the Tile with Buttons template
Tip |
---|
If you are completing this chapter as part of the Actionflow course and using a training instance, the screens have already been pre-loaded into the Actionflow Advanced Application. For this example, we'll be working on the Company Call API screen. |
Image Modified
Excerpt | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Example 1: Passing Out DataIn this example, we'll configure an API Endpoint that passes out Company ID, Company Name and Industry data from our Companies data. Create API EndpointIn this example, we'll set up an API Endpoint to pass out company data.
Construct JSON
|
Configure the Output
Example 2: Passing in ParametersIn this example, we'll retrieve data from our Companies API and pass in an industry parameter (e.g. "Telecoms") to filter the results to just companies in that industry. API End Point Setup
Call API Actionflow Setup
|
Testing
|
On this page
Table of Contents | ||||
---|---|---|---|---|
|