Import DaVinci Flow
POST {{apiPath}}/environments/{{envID}}/flows
The POST {{apiPath}}/environments/{{envID}}/flows endpoint imports an existing flow when the the Content-Type header is set to application/vnd.pingidentity.flow.import+json. The flowInfo property in the request body specifies the flow definition for the import operation.
|
The import action supports two custom content types, one for the current DaVinci flow data model and one for the DaVinci legacy data model. The custom |
Request Model
| Property | Type | Required? |
|---|---|---|
|
String |
Required |
|
String |
Optional |
|
Object |
Required |
|
Object |
Required |
Refer to the DaVinci Admin Flows data model for full property descriptions.
Headers
Authorization Bearer {{accessToken}}
Content-Type application/vnd.pingidentity.flow.import+json
Body
raw ( application/vnd.pingidentity.flow.import+json )
{
"name": "Test Subflow-LNOTP",
"description": "",
"flowInfo": {
"companyId": "a96a0169-541e-4c00-beb0-13067c34fe53",
"authTokenExpireIds": [],
"connectorIds": [
"httpConnector",
"lexisNexisConnector"
],
"createdDate": 1675292040274,
"currentVersion": 3,
"customerId": "f970db05a3c68dbc4582f7edd60baa40",
"deployedDate": 1675292042668,
"description": "Imported on Wed Feb 01 2023 22:38:52 GMT+0000 (Coordinated Universal Time)",
"enabledGraphData": {...
},
"flowStatus": "enabled",
"inputSchemaCompiled": {
"parameters": {
"type": "object",
"properties": {
"phoneNumber": {
"description": "",
"preferredDataType": "number",
"isExpanded": true,
"type": "number",
"name": "phoneNumber"
}
},
"additionalProperties": false,
"required": []
}
},
"isInputSchemaSaved": true,
"name": "Test Subflow-LNOTP",
"orx": "{...}",
"publishedVersion": 3,
"settings": {
"csp": "worker-src 'self' blob:; script-src 'self' https://cdn.jsdelivr.net https://code.jquery.com https://devsdk.singularkey.com http://cdnjs.cloudflare.com 'unsafe-inline' 'unsafe-eval';",
"intermediateLoadingScreenCSS": {},
"intermediateLoadingScreenHTML": {},
"logLevel": 3
},
"updatedDate": 1675292042668,
"flowId": "ee4d485393ad51d07bc7e6916e15f602",
"versionId": 3,
"graphData": {...
},
"inputSchema": [
{
"propertyName": "phoneNumber",
"description": "",
"preferredDataType": "number",
"preferredControlType": "textField",
"isExpanded": true
}
],
"flowColor": "#AFD5FF",
"savedDate": 1675291132660,
"variables": []
},
"flowNameMapping": {
"ee4d485393ad51d07bc7e6916e15f602": "Test Subflow-LNOTP"
}
}
Example Request
-
cURL
-
C#
-
Go
-
HTTP
-
Java
-
jQuery
-
NodeJS
-
Python
-
PHP
-
Ruby
-
Swift
curl --location --globoff '{{apiPath}}/environments/{{envID}}/flows' \
--header 'Content-Type: application/vnd.pingidentity.flow.import+json' \
--header 'Authorization: Bearer {{accessToken}}' \
--data '{
"name": "Test Subflow-LNOTP",
"description": "",
"flowInfo": {
"companyId": "a96a0169-541e-4c00-beb0-13067c34fe53",
"authTokenExpireIds": [],
"connectorIds": [
"httpConnector",
"lexisNexisConnector"
],
"createdDate": 1675292040274,
"currentVersion": 3,
"customerId": "f970db05a3c68dbc4582f7edd60baa40",
"deployedDate": 1675292042668,
"description": "Imported on Wed Feb 01 2023 22:38:52 GMT+0000 (Coordinated Universal Time)",
"enabledGraphData": {...
},
"flowStatus": "enabled",
"inputSchemaCompiled": {
"parameters": {
"type": "object",
"properties": {
"phoneNumber": {
"description": "",
"preferredDataType": "number",
"isExpanded": true,
"type": "number",
"name": "phoneNumber"
}
},
"additionalProperties": false,
"required": []
}
},
"isInputSchemaSaved": true,
"name": "Test Subflow-LNOTP",
"orx": "{...}",
"publishedVersion": 3,
"settings": {
"csp": "worker-src '\''self'\'' blob:; script-src '\''self'\'' https://cdn.jsdelivr.net https://code.jquery.com https://devsdk.singularkey.com http://cdnjs.cloudflare.com '\''unsafe-inline'\'' '\''unsafe-eval'\'';",
"intermediateLoadingScreenCSS": {},
"intermediateLoadingScreenHTML": {},
"logLevel": 3
},
"updatedDate": 1675292042668,
"flowId": "ee4d485393ad51d07bc7e6916e15f602",
"versionId": 3,
"graphData": {...
},
"inputSchema": [
{
"propertyName": "phoneNumber",
"description": "",
"preferredDataType": "number",
"preferredControlType": "textField",
"isExpanded": true
}
],
"flowColor": "#AFD5FF",
"savedDate": 1675291132660,
"variables": []
},
"flowNameMapping": {
"ee4d485393ad51d07bc7e6916e15f602": "Test Subflow-LNOTP"
}
}'
var options = new RestClientOptions("{{apiPath}}/environments/{{envID}}/flows")
{
MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/vnd.pingidentity.flow.import+json");
request.AddHeader("Authorization", "Bearer {{accessToken}}");
var body = @"{" + "\n" +
@" ""name"": ""Test Subflow-LNOTP""," + "\n" +
@" ""description"": """"," + "\n" +
@" ""flowInfo"": {" + "\n" +
@" ""companyId"": ""a96a0169-541e-4c00-beb0-13067c34fe53""," + "\n" +
@" ""authTokenExpireIds"": []," + "\n" +
@" ""connectorIds"": [" + "\n" +
@" ""httpConnector""," + "\n" +
@" ""lexisNexisConnector""" + "\n" +
@" ]," + "\n" +
@" ""createdDate"": 1675292040274," + "\n" +
@" ""currentVersion"": 3," + "\n" +
@" ""customerId"": ""f970db05a3c68dbc4582f7edd60baa40""," + "\n" +
@" ""deployedDate"": 1675292042668," + "\n" +
@" ""description"": ""Imported on Wed Feb 01 2023 22:38:52 GMT+0000 (Coordinated Universal Time)""," + "\n" +
@" ""enabledGraphData"": {..." + "\n" +
@" }," + "\n" +
@" ""flowStatus"": ""enabled""," + "\n" +
@" ""inputSchemaCompiled"": {" + "\n" +
@" ""parameters"": {" + "\n" +
@" ""type"": ""object""," + "\n" +
@" ""properties"": {" + "\n" +
@" ""phoneNumber"": {" + "\n" +
@" ""description"": """"," + "\n" +
@" ""preferredDataType"": ""number""," + "\n" +
@" ""isExpanded"": true," + "\n" +
@" ""type"": ""number""," + "\n" +
@" ""name"": ""phoneNumber""" + "\n" +
@" }" + "\n" +
@" }," + "\n" +
@" ""additionalProperties"": false," + "\n" +
@" ""required"": []" + "\n" +
@" }" + "\n" +
@" }," + "\n" +
@" ""isInputSchemaSaved"": true," + "\n" +
@" ""name"": ""Test Subflow-LNOTP""," + "\n" +
@" ""orx"": ""{...}""," + "\n" +
@" ""publishedVersion"": 3," + "\n" +
@" ""settings"": {" + "\n" +
@" ""csp"": ""worker-src 'self' blob:; script-src 'self' https://cdn.jsdelivr.net https://code.jquery.com https://devsdk.singularkey.com http://cdnjs.cloudflare.com 'unsafe-inline' 'unsafe-eval';""," + "\n" +
@" ""intermediateLoadingScreenCSS"": {}," + "\n" +
@" ""intermediateLoadingScreenHTML"": {}," + "\n" +
@" ""logLevel"": 3" + "\n" +
@" }," + "\n" +
@" ""updatedDate"": 1675292042668," + "\n" +
@" ""flowId"": ""ee4d485393ad51d07bc7e6916e15f602""," + "\n" +
@" ""versionId"": 3," + "\n" +
@" ""graphData"": {..." + "\n" +
@" }," + "\n" +
@" ""inputSchema"": [" + "\n" +
@" {" + "\n" +
@" ""propertyName"": ""phoneNumber""," + "\n" +
@" ""description"": """"," + "\n" +
@" ""preferredDataType"": ""number""," + "\n" +
@" ""preferredControlType"": ""textField""," + "\n" +
@" ""isExpanded"": true" + "\n" +
@" }" + "\n" +
@" ]," + "\n" +
@" ""flowColor"": ""#AFD5FF""," + "\n" +
@" ""savedDate"": 1675291132660," + "\n" +
@" ""variables"": []" + "\n" +
@" }," + "\n" +
@" ""flowNameMapping"": {" + "\n" +
@" ""ee4d485393ad51d07bc7e6916e15f602"": ""Test Subflow-LNOTP""" + "\n" +
@" }" + "\n" +
@"}";
request.AddStringBody(body, DataFormat.Json);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "{{apiPath}}/environments/{{envID}}/flows"
method := "POST"
payload := strings.NewReader(`{
"name": "Test Subflow-LNOTP",
"description": "",
"flowInfo": {
"companyId": "a96a0169-541e-4c00-beb0-13067c34fe53",
"authTokenExpireIds": [],
"connectorIds": [
"httpConnector",
"lexisNexisConnector"
],
"createdDate": 1675292040274,
"currentVersion": 3,
"customerId": "f970db05a3c68dbc4582f7edd60baa40",
"deployedDate": 1675292042668,
"description": "Imported on Wed Feb 01 2023 22:38:52 GMT+0000 (Coordinated Universal Time)",
"enabledGraphData": {...
},
"flowStatus": "enabled",
"inputSchemaCompiled": {
"parameters": {
"type": "object",
"properties": {
"phoneNumber": {
"description": "",
"preferredDataType": "number",
"isExpanded": true,
"type": "number",
"name": "phoneNumber"
}
},
"additionalProperties": false,
"required": []
}
},
"isInputSchemaSaved": true,
"name": "Test Subflow-LNOTP",
"orx": "{...}",
"publishedVersion": 3,
"settings": {
"csp": "worker-src 'self' blob:; script-src 'self' https://cdn.jsdelivr.net https://code.jquery.com https://devsdk.singularkey.com http://cdnjs.cloudflare.com 'unsafe-inline' 'unsafe-eval';",
"intermediateLoadingScreenCSS": {},
"intermediateLoadingScreenHTML": {},
"logLevel": 3
},
"updatedDate": 1675292042668,
"flowId": "ee4d485393ad51d07bc7e6916e15f602",
"versionId": 3,
"graphData": {...
},
"inputSchema": [
{
"propertyName": "phoneNumber",
"description": "",
"preferredDataType": "number",
"preferredControlType": "textField",
"isExpanded": true
}
],
"flowColor": "#AFD5FF",
"savedDate": 1675291132660,
"variables": []
},
"flowNameMapping": {
"ee4d485393ad51d07bc7e6916e15f602": "Test Subflow-LNOTP"
}
}`)
client := &http.Client {
}
req, err := http.NewRequest(method, url, payload)
if err != nil {
fmt.Println(err)
return
}
req.Header.Add("Content-Type", "application/vnd.pingidentity.flow.import+json")
req.Header.Add("Authorization", "Bearer {{accessToken}}")
res, err := client.Do(req)
if err != nil {
fmt.Println(err)
return
}
defer res.Body.Close()
body, err := io.ReadAll(res.Body)
if err != nil {
fmt.Println(err)
return
}
fmt.Println(string(body))
}
POST /environments/{{envID}}/flows HTTP/1.1
Host: {{apiPath}}
Content-Type: application/vnd.pingidentity.flow.import+json
Authorization: Bearer {{accessToken}}
{
"name": "Test Subflow-LNOTP",
"description": "",
"flowInfo": {
"companyId": "a96a0169-541e-4c00-beb0-13067c34fe53",
"authTokenExpireIds": [],
"connectorIds": [
"httpConnector",
"lexisNexisConnector"
],
"createdDate": 1675292040274,
"currentVersion": 3,
"customerId": "f970db05a3c68dbc4582f7edd60baa40",
"deployedDate": 1675292042668,
"description": "Imported on Wed Feb 01 2023 22:38:52 GMT+0000 (Coordinated Universal Time)",
"enabledGraphData": {...
},
"flowStatus": "enabled",
"inputSchemaCompiled": {
"parameters": {
"type": "object",
"properties": {
"phoneNumber": {
"description": "",
"preferredDataType": "number",
"isExpanded": true,
"type": "number",
"name": "phoneNumber"
}
},
"additionalProperties": false,
"required": []
}
},
"isInputSchemaSaved": true,
"name": "Test Subflow-LNOTP",
"orx": "{...}",
"publishedVersion": 3,
"settings": {
"csp": "worker-src 'self' blob:; script-src 'self' https://cdn.jsdelivr.net https://code.jquery.com https://devsdk.singularkey.com http://cdnjs.cloudflare.com 'unsafe-inline' 'unsafe-eval';",
"intermediateLoadingScreenCSS": {},
"intermediateLoadingScreenHTML": {},
"logLevel": 3
},
"updatedDate": 1675292042668,
"flowId": "ee4d485393ad51d07bc7e6916e15f602",
"versionId": 3,
"graphData": {...
},
"inputSchema": [
{
"propertyName": "phoneNumber",
"description": "",
"preferredDataType": "number",
"preferredControlType": "textField",
"isExpanded": true
}
],
"flowColor": "#AFD5FF",
"savedDate": 1675291132660,
"variables": []
},
"flowNameMapping": {
"ee4d485393ad51d07bc7e6916e15f602": "Test Subflow-LNOTP"
}
}
OkHttpClient client = new OkHttpClient().newBuilder()
.build();
MediaType mediaType = MediaType.parse("application/vnd.pingidentity.flow.import+json");
RequestBody body = RequestBody.create(mediaType, "{\n \"name\": \"Test Subflow-LNOTP\",\n \"description\": \"\",\n \"flowInfo\": {\n \"companyId\": \"a96a0169-541e-4c00-beb0-13067c34fe53\",\n \"authTokenExpireIds\": [],\n \"connectorIds\": [\n \"httpConnector\",\n \"lexisNexisConnector\"\n ],\n \"createdDate\": 1675292040274,\n \"currentVersion\": 3,\n \"customerId\": \"f970db05a3c68dbc4582f7edd60baa40\",\n \"deployedDate\": 1675292042668,\n \"description\": \"Imported on Wed Feb 01 2023 22:38:52 GMT+0000 (Coordinated Universal Time)\",\n \"enabledGraphData\": {...\n },\n \"flowStatus\": \"enabled\",\n \"inputSchemaCompiled\": {\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"phoneNumber\": {\n \"description\": \"\",\n \"preferredDataType\": \"number\",\n \"isExpanded\": true,\n \"type\": \"number\",\n \"name\": \"phoneNumber\"\n }\n },\n \"additionalProperties\": false,\n \"required\": []\n }\n },\n \"isInputSchemaSaved\": true,\n \"name\": \"Test Subflow-LNOTP\",\n \"orx\": \"{...}\",\n \"publishedVersion\": 3,\n \"settings\": {\n \"csp\": \"worker-src 'self' blob:; script-src 'self' https://cdn.jsdelivr.net https://code.jquery.com https://devsdk.singularkey.com http://cdnjs.cloudflare.com 'unsafe-inline' 'unsafe-eval';\",\n \"intermediateLoadingScreenCSS\": {},\n \"intermediateLoadingScreenHTML\": {},\n \"logLevel\": 3\n },\n \"updatedDate\": 1675292042668,\n \"flowId\": \"ee4d485393ad51d07bc7e6916e15f602\",\n \"versionId\": 3,\n \"graphData\": {...\n },\n \"inputSchema\": [\n {\n \"propertyName\": \"phoneNumber\",\n \"description\": \"\",\n \"preferredDataType\": \"number\",\n \"preferredControlType\": \"textField\",\n \"isExpanded\": true\n }\n ],\n \"flowColor\": \"#AFD5FF\",\n \"savedDate\": 1675291132660,\n \"variables\": []\n },\n \"flowNameMapping\": {\n \"ee4d485393ad51d07bc7e6916e15f602\": \"Test Subflow-LNOTP\"\n }\n}");
Request request = new Request.Builder()
.url("{{apiPath}}/environments/{{envID}}/flows")
.method("POST", body)
.addHeader("Content-Type", "application/vnd.pingidentity.flow.import+json")
.addHeader("Authorization", "Bearer {{accessToken}}")
.build();
Response response = client.newCall(request).execute();
var settings = {
"url": "{{apiPath}}/environments/{{envID}}/flows",
"method": "POST",
"timeout": 0,
"headers": {
"Content-Type": "application/vnd.pingidentity.flow.import+json",
"Authorization": "Bearer {{accessToken}}"
},
"data": "{\n \"name\": \"Test Subflow-LNOTP\",\n \"description\": \"\",\n \"flowInfo\": {\n \"companyId\": \"a96a0169-541e-4c00-beb0-13067c34fe53\",\n \"authTokenExpireIds\": [],\n \"connectorIds\": [\n \"httpConnector\",\n \"lexisNexisConnector\"\n ],\n \"createdDate\": 1675292040274,\n \"currentVersion\": 3,\n \"customerId\": \"f970db05a3c68dbc4582f7edd60baa40\",\n \"deployedDate\": 1675292042668,\n \"description\": \"Imported on Wed Feb 01 2023 22:38:52 GMT+0000 (Coordinated Universal Time)\",\n \"enabledGraphData\": {...\n },\n \"flowStatus\": \"enabled\",\n \"inputSchemaCompiled\": {\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"phoneNumber\": {\n \"description\": \"\",\n \"preferredDataType\": \"number\",\n \"isExpanded\": true,\n \"type\": \"number\",\n \"name\": \"phoneNumber\"\n }\n },\n \"additionalProperties\": false,\n \"required\": []\n }\n },\n \"isInputSchemaSaved\": true,\n \"name\": \"Test Subflow-LNOTP\",\n \"orx\": \"{...}\",\n \"publishedVersion\": 3,\n \"settings\": {\n \"csp\": \"worker-src 'self' blob:; script-src 'self' https://cdn.jsdelivr.net https://code.jquery.com https://devsdk.singularkey.com http://cdnjs.cloudflare.com 'unsafe-inline' 'unsafe-eval';\",\n \"intermediateLoadingScreenCSS\": {},\n \"intermediateLoadingScreenHTML\": {},\n \"logLevel\": 3\n },\n \"updatedDate\": 1675292042668,\n \"flowId\": \"ee4d485393ad51d07bc7e6916e15f602\",\n \"versionId\": 3,\n \"graphData\": {...\n },\n \"inputSchema\": [\n {\n \"propertyName\": \"phoneNumber\",\n \"description\": \"\",\n \"preferredDataType\": \"number\",\n \"preferredControlType\": \"textField\",\n \"isExpanded\": true\n }\n ],\n \"flowColor\": \"#AFD5FF\",\n \"savedDate\": 1675291132660,\n \"variables\": []\n },\n \"flowNameMapping\": {\n \"ee4d485393ad51d07bc7e6916e15f602\": \"Test Subflow-LNOTP\"\n }\n}",
};
$.ajax(settings).done(function (response) {
console.log(response);
});
var request = require('request');
var options = {
'method': 'POST',
'url': '{{apiPath}}/environments/{{envID}}/flows',
'headers': {
'Content-Type': 'application/vnd.pingidentity.flow.import+json',
'Authorization': 'Bearer {{accessToken}}'
},
body: '{\n "name": "Test Subflow-LNOTP",\n "description": "",\n "flowInfo": {\n "companyId": "a96a0169-541e-4c00-beb0-13067c34fe53",\n "authTokenExpireIds": [],\n "connectorIds": [\n "httpConnector",\n "lexisNexisConnector"\n ],\n "createdDate": 1675292040274,\n "currentVersion": 3,\n "customerId": "f970db05a3c68dbc4582f7edd60baa40",\n "deployedDate": 1675292042668,\n "description": "Imported on Wed Feb 01 2023 22:38:52 GMT+0000 (Coordinated Universal Time)",\n "enabledGraphData": {...\n },\n "flowStatus": "enabled",\n "inputSchemaCompiled": {\n "parameters": {\n "type": "object",\n "properties": {\n "phoneNumber": {\n "description": "",\n "preferredDataType": "number",\n "isExpanded": true,\n "type": "number",\n "name": "phoneNumber"\n }\n },\n "additionalProperties": false,\n "required": []\n }\n },\n "isInputSchemaSaved": true,\n "name": "Test Subflow-LNOTP",\n "orx": "{...}",\n "publishedVersion": 3,\n "settings": {\n "csp": "worker-src \'self\' blob:; script-src \'self\' https://cdn.jsdelivr.net https://code.jquery.com https://devsdk.singularkey.com http://cdnjs.cloudflare.com \'unsafe-inline\' \'unsafe-eval\';",\n "intermediateLoadingScreenCSS": {},\n "intermediateLoadingScreenHTML": {},\n "logLevel": 3\n },\n "updatedDate": 1675292042668,\n "flowId": "ee4d485393ad51d07bc7e6916e15f602",\n "versionId": 3,\n "graphData": {...\n },\n "inputSchema": [\n {\n "propertyName": "phoneNumber",\n "description": "",\n "preferredDataType": "number",\n "preferredControlType": "textField",\n "isExpanded": true\n }\n ],\n "flowColor": "#AFD5FF",\n "savedDate": 1675291132660,\n "variables": []\n },\n "flowNameMapping": {\n "ee4d485393ad51d07bc7e6916e15f602": "Test Subflow-LNOTP"\n }\n}'
};
request(options, function (error, response) {
if (error) throw new Error(error);
console.log(response.body);
});
import requests
import json
url = "{{apiPath}}/environments/{{envID}}/flows"
payload = "{\n \"name\": \"Test Subflow-LNOTP\",\n \"description\": \"\",\n \"flowInfo\": {\n \"companyId\": \"a96a0169-541e-4c00-beb0-13067c34fe53\",\n \"authTokenExpireIds\": [],\n \"connectorIds\": [\n \"httpConnector\",\n \"lexisNexisConnector\"\n ],\n \"createdDate\": 1675292040274,\n \"currentVersion\": 3,\n \"customerId\": \"f970db05a3c68dbc4582f7edd60baa40\",\n \"deployedDate\": 1675292042668,\n \"description\": \"Imported on Wed Feb 01 2023 22:38:52 GMT+0000 (Coordinated Universal Time)\",\n \"enabledGraphData\": {...\n },\n \"flowStatus\": \"enabled\",\n \"inputSchemaCompiled\": {\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"phoneNumber\": {\n \"description\": \"\",\n \"preferredDataType\": \"number\",\n \"isExpanded\": true,\n \"type\": \"number\",\n \"name\": \"phoneNumber\"\n }\n },\n \"additionalProperties\": false,\n \"required\": []\n }\n },\n \"isInputSchemaSaved\": true,\n \"name\": \"Test Subflow-LNOTP\",\n \"orx\": \"{...}\",\n \"publishedVersion\": 3,\n \"settings\": {\n \"csp\": \"worker-src 'self' blob:; script-src 'self' https://cdn.jsdelivr.net https://code.jquery.com https://devsdk.singularkey.com http://cdnjs.cloudflare.com 'unsafe-inline' 'unsafe-eval';\",\n \"intermediateLoadingScreenCSS\": {},\n \"intermediateLoadingScreenHTML\": {},\n \"logLevel\": 3\n },\n \"updatedDate\": 1675292042668,\n \"flowId\": \"ee4d485393ad51d07bc7e6916e15f602\",\n \"versionId\": 3,\n \"graphData\": {...\n },\n \"inputSchema\": [\n {\n \"propertyName\": \"phoneNumber\",\n \"description\": \"\",\n \"preferredDataType\": \"number\",\n \"preferredControlType\": \"textField\",\n \"isExpanded\": true\n }\n ],\n \"flowColor\": \"#AFD5FF\",\n \"savedDate\": 1675291132660,\n \"variables\": []\n },\n \"flowNameMapping\": {\n \"ee4d485393ad51d07bc7e6916e15f602\": \"Test Subflow-LNOTP\"\n }\n}"
headers = {
'Content-Type': 'application/vnd.pingidentity.flow.import+json',
'Authorization': 'Bearer {{accessToken}}'
}
response = requests.request("POST", url, headers=headers, data=payload)
print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{apiPath}}/environments/{{envID}}/flows');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
'follow_redirects' => TRUE
));
$request->setHeader(array(
'Content-Type' => 'application/vnd.pingidentity.flow.import+json',
'Authorization' => 'Bearer {{accessToken}}'
));
$request->setBody('{\n "name": "Test Subflow-LNOTP",\n "description": "",\n "flowInfo": {\n "companyId": "a96a0169-541e-4c00-beb0-13067c34fe53",\n "authTokenExpireIds": [],\n "connectorIds": [\n "httpConnector",\n "lexisNexisConnector"\n ],\n "createdDate": 1675292040274,\n "currentVersion": 3,\n "customerId": "f970db05a3c68dbc4582f7edd60baa40",\n "deployedDate": 1675292042668,\n "description": "Imported on Wed Feb 01 2023 22:38:52 GMT+0000 (Coordinated Universal Time)",\n "enabledGraphData": {...\n },\n "flowStatus": "enabled",\n "inputSchemaCompiled": {\n "parameters": {\n "type": "object",\n "properties": {\n "phoneNumber": {\n "description": "",\n "preferredDataType": "number",\n "isExpanded": true,\n "type": "number",\n "name": "phoneNumber"\n }\n },\n "additionalProperties": false,\n "required": []\n }\n },\n "isInputSchemaSaved": true,\n "name": "Test Subflow-LNOTP",\n "orx": "{...}",\n "publishedVersion": 3,\n "settings": {\n "csp": "worker-src \'self\' blob:; script-src \'self\' https://cdn.jsdelivr.net https://code.jquery.com https://devsdk.singularkey.com http://cdnjs.cloudflare.com \'unsafe-inline\' \'unsafe-eval\';",\n "intermediateLoadingScreenCSS": {},\n "intermediateLoadingScreenHTML": {},\n "logLevel": 3\n },\n "updatedDate": 1675292042668,\n "flowId": "ee4d485393ad51d07bc7e6916e15f602",\n "versionId": 3,\n "graphData": {...\n },\n "inputSchema": [\n {\n "propertyName": "phoneNumber",\n "description": "",\n "preferredDataType": "number",\n "preferredControlType": "textField",\n "isExpanded": true\n }\n ],\n "flowColor": "#AFD5FF",\n "savedDate": 1675291132660,\n "variables": []\n },\n "flowNameMapping": {\n "ee4d485393ad51d07bc7e6916e15f602": "Test Subflow-LNOTP"\n }\n}');
try {
$response = $request->send();
if ($response->getStatus() == 200) {
echo $response->getBody();
}
else {
echo 'Unexpected HTTP status: ' . $response->getStatus() . ' ' .
$response->getReasonPhrase();
}
}
catch(HTTP_Request2_Exception $e) {
echo 'Error: ' . $e->getMessage();
}
require "uri"
require "json"
require "net/http"
url = URI("{{apiPath}}/environments/{{envID}}/flows")
http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/vnd.pingidentity.flow.import+json"
request["Authorization"] = "Bearer {{accessToken}}"
request.body = "{\n \"name\": \"Test Subflow-LNOTP\",\n \"description\": \"\",\n \"flowInfo\": {\n \"companyId\": \"a96a0169-541e-4c00-beb0-13067c34fe53\",\n \"authTokenExpireIds\": [],\n \"connectorIds\": [\n \"httpConnector\",\n \"lexisNexisConnector\"\n ],\n \"createdDate\": 1675292040274,\n \"currentVersion\": 3,\n \"customerId\": \"f970db05a3c68dbc4582f7edd60baa40\",\n \"deployedDate\": 1675292042668,\n \"description\": \"Imported on Wed Feb 01 2023 22:38:52 GMT+0000 (Coordinated Universal Time)\",\n \"enabledGraphData\": {...\n },\n \"flowStatus\": \"enabled\",\n \"inputSchemaCompiled\": {\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"phoneNumber\": {\n \"description\": \"\",\n \"preferredDataType\": \"number\",\n \"isExpanded\": true,\n \"type\": \"number\",\n \"name\": \"phoneNumber\"\n }\n },\n \"additionalProperties\": false,\n \"required\": []\n }\n },\n \"isInputSchemaSaved\": true,\n \"name\": \"Test Subflow-LNOTP\",\n \"orx\": \"{...}\",\n \"publishedVersion\": 3,\n \"settings\": {\n \"csp\": \"worker-src 'self' blob:; script-src 'self' https://cdn.jsdelivr.net https://code.jquery.com https://devsdk.singularkey.com http://cdnjs.cloudflare.com 'unsafe-inline' 'unsafe-eval';\",\n \"intermediateLoadingScreenCSS\": {},\n \"intermediateLoadingScreenHTML\": {},\n \"logLevel\": 3\n },\n \"updatedDate\": 1675292042668,\n \"flowId\": \"ee4d485393ad51d07bc7e6916e15f602\",\n \"versionId\": 3,\n \"graphData\": {...\n },\n \"inputSchema\": [\n {\n \"propertyName\": \"phoneNumber\",\n \"description\": \"\",\n \"preferredDataType\": \"number\",\n \"preferredControlType\": \"textField\",\n \"isExpanded\": true\n }\n ],\n \"flowColor\": \"\\#AFD5FF\",\n \"savedDate\": 1675291132660,\n \"variables\": []\n },\n \"flowNameMapping\": {\n \"ee4d485393ad51d07bc7e6916e15f602\": \"Test Subflow-LNOTP\"\n }\n}"
response = http.request(request)
puts response.read_body
let parameters = "{\n \"name\": \"Test Subflow-LNOTP\",\n \"description\": \"\",\n \"flowInfo\": {\n \"companyId\": \"a96a0169-541e-4c00-beb0-13067c34fe53\",\n \"authTokenExpireIds\": [],\n \"connectorIds\": [\n \"httpConnector\",\n \"lexisNexisConnector\"\n ],\n \"createdDate\": 1675292040274,\n \"currentVersion\": 3,\n \"customerId\": \"f970db05a3c68dbc4582f7edd60baa40\",\n \"deployedDate\": 1675292042668,\n \"description\": \"Imported on Wed Feb 01 2023 22:38:52 GMT+0000 (Coordinated Universal Time)\",\n \"enabledGraphData\": {...\n },\n \"flowStatus\": \"enabled\",\n \"inputSchemaCompiled\": {\n \"parameters\": {\n \"type\": \"object\",\n \"properties\": {\n \"phoneNumber\": {\n \"description\": \"\",\n \"preferredDataType\": \"number\",\n \"isExpanded\": true,\n \"type\": \"number\",\n \"name\": \"phoneNumber\"\n }\n },\n \"additionalProperties\": false,\n \"required\": []\n }\n },\n \"isInputSchemaSaved\": true,\n \"name\": \"Test Subflow-LNOTP\",\n \"orx\": \"{...}\",\n \"publishedVersion\": 3,\n \"settings\": {\n \"csp\": \"worker-src 'self' blob:; script-src 'self' https://cdn.jsdelivr.net https://code.jquery.com https://devsdk.singularkey.com http://cdnjs.cloudflare.com 'unsafe-inline' 'unsafe-eval';\",\n \"intermediateLoadingScreenCSS\": {},\n \"intermediateLoadingScreenHTML\": {},\n \"logLevel\": 3\n },\n \"updatedDate\": 1675292042668,\n \"flowId\": \"ee4d485393ad51d07bc7e6916e15f602\",\n \"versionId\": 3,\n \"graphData\": {...\n },\n \"inputSchema\": [\n {\n \"propertyName\": \"phoneNumber\",\n \"description\": \"\",\n \"preferredDataType\": \"number\",\n \"preferredControlType\": \"textField\",\n \"isExpanded\": true\n }\n ],\n \"flowColor\": \"#AFD5FF\",\n \"savedDate\": 1675291132660,\n \"variables\": []\n },\n \"flowNameMapping\": {\n \"ee4d485393ad51d07bc7e6916e15f602\": \"Test Subflow-LNOTP\"\n }\n}"
let postData = parameters.data(using: .utf8)
var request = URLRequest(url: URL(string: "{{apiPath}}/environments/{{envID}}/flows")!,timeoutInterval: Double.infinity)
request.addValue("application/vnd.pingidentity.flow.import+json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer {{accessToken}}", forHTTPHeaderField: "Authorization")
request.httpMethod = "POST"
request.httpBody = postData
let task = URLSession.shared.dataTask(with: request) { data, response, error in
guard let data = data else {
print(String(describing: error))
return
}
print(String(data: data, encoding: .utf8)!)
}
task.resume()
Example Response
201 Created
{
"_links": {
"environment": { "href": "..." },
"self": { "href": "..." },
"flow.deploy" :{ "href": "..." },
"flow.clone":{ "href": "..." },
"flow.export":{ "href": "..." },
"flow.enabled":{ "href": "..." }
},
"environment": {
"id": "6YWgejhFHGFyhZM57KfdhnYf7fmeMZKM"
},
"id": "f16a833ebaeb41f8f33776ce4a73bd8e",
"name": "Test Subflow-LNOTP",
"description": "Imported on Thu Feb 23 2023 19:43:21 GMT+0530 (India Standard Time)",
"enabled": "true",
"currentVersion": 1,
"publishedVersion": 1,
"connectors": [
{ "id": "httpConnector" },
{ "id": "lexisNexisConnector" }
],
"settings": {"csp": "worker-src 'self' blob:; script-src 'self' https://cdn.jsdelivr.net https://code.jquery.com https://devsdk.singularkey.com http://cdnjs.cloudflare.com 'unsafe-inline' 'unsafe-eval';",
"intermediateLoadingScreenCSS": "",
"intermediateLoadingScreenHTML": "",
"logLevel": 3},
"color": "#E3F0FF",
"graphData": { ... }, // quite big so this will stay collapsed
"createdAt": "2023-02-17T07:17:52.000Z",
"updatedAt": "2023-02-17T07:17:52.000Z",
"deployedAt": "2023-02-17T07:20:39.000Z"
}