Execution of Data Flows using an API
Data Flows can be executed through an HTTP API. To execute a Data Flow through the API, you need an API Key, the Data Flow Id, and the API address.
Getting an API Key
To get an API Key to use with the Data Flow Execution API, go to Application Menu -> API Management -> Manage API Keys. In the Data Flow Execution tab, find an existing key or create a new one. Use the API Key in the url or header in the request (see the example below).
Define API key in designer
- Click the Edit command under the API Management menu item.
- Select the Access Control tab.
- Click the Add button.
Start Execution API
This API starts the execution of a Data Flow. If you do not specify await=true as a url parameter, the API will return immediately after the Data Flow has been started. You should then use the Status API to check for completion by providing the RunId.
URL
api/pub/v1/dataflows/< id >/start
Method
POST
URL Params
Required
api_key=[api key]
Note
Optionally, you can provide the API key as a header named x-api-key
Optional
await=true (default = false)
Note
Specifying await=true tells the API to not reply until the Data Flow has completed execution. You should carefully consider when to use this option, because Data Flows may take from seconds to hours to complete.
Success Response
Code: 200 OK
Content:
{
runId : "execution run id",
status : "Pending" | "Running" | "Succeeded" | "Failed"
}
Error Response
Code: 500 Internal Server Error
Example
Get Status API
Using the RunId, you can check the status of a Data Flow execution. You get the RunId from the Start Execution API response.
URL
api/pub/v1/dataflows/< id >/runs/< runid >/status
URL Params
Required
api_key=[api key]
Note
Optionally, you can provide the api key as a header named x-api-key
Method
GET
Success Response
Code: 200 OK
Content:
{
runId : "execution run id",
status : "Pending" | "Running" | "Succeeded" | "Failed"
}
Error Response Code: 500 Internal Server Error
Example