PingOne Platform APIs

Export a DaVinci Flow Version

 

POST {{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}/versions/{{davinciFlowVersionID}}

The POST {{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}/versions/{{davinciFlowVersionID}} endpoint uses the application/vnd.pingidentity.flowversion.export+json custom Content-Type value to initiate an action to export the flow version specified by its ID in the request URL. A request body for this POST is optional. The includeSubFlows property set to true includes all subflows in the export JSON. The includeVariableValues property set to true includes all variable values in the export JSON.

Headers

Authorization      Bearer {{accessToken}}

Content-Type      application/vnd.pingidentity.flowversion.export+json

Body

raw ( application/vnd.pingidentity.flowversion.export+json )

{
    "includeSubFlows": true,
    "includeVariableValues": true
}

Example Request

  • cURL

  • C#

  • Go

  • HTTP

  • Java

  • jQuery

  • NodeJS

  • Python

  • PHP

  • Ruby

  • Swift

curl --location --globoff '{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}/versions/{{davinciFlowVersionID}}' \
--header 'Content-Type: application/vnd.pingidentity.flowversion.export+json' \
--header 'Authorization: Bearer {{accessToken}}' \
--data '{
    "includeSubFlows": true,
    "includeVariableValues": true
}'
var options = new RestClientOptions("{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}/versions/{{davinciFlowVersionID}}")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/vnd.pingidentity.flowversion.export+json");
request.AddHeader("Authorization", "Bearer {{accessToken}}");
var body = @"{" + "\n" +
@"    ""includeSubFlows"": true," + "\n" +
@"    ""includeVariableValues"": true" + "\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/{{davinciFlowID}}/versions/{{davinciFlowVersionID}}"
  method := "POST"

  payload := strings.NewReader(`{
    "includeSubFlows": true,
    "includeVariableValues": true
}`)

  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.flowversion.export+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/{{davinciFlowID}}/versions/{{davinciFlowVersionID}} HTTP/1.1
Host: {{apiPath}}
Content-Type: application/vnd.pingidentity.flowversion.export+json
Authorization: Bearer {{accessToken}}

{
    "includeSubFlows": true,
    "includeVariableValues": true
}
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/vnd.pingidentity.flowversion.export+json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"includeSubFlows\": true,\n    \"includeVariableValues\": true\n}");
Request request = new Request.Builder()
  .url("{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}/versions/{{davinciFlowVersionID}}")
  .method("POST", body)
  .addHeader("Content-Type", "application/vnd.pingidentity.flowversion.export+json")
  .addHeader("Authorization", "Bearer {{accessToken}}")
  .build();
Response response = client.newCall(request).execute();
var settings = {
  "url": "{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}/versions/{{davinciFlowVersionID}}",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/vnd.pingidentity.flowversion.export+json",
    "Authorization": "Bearer {{accessToken}}"
  },
  "data": JSON.stringify({
    "includeSubFlows": true,
    "includeVariableValues": true
  }),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var request = require('request');
var options = {
  'method': 'POST',
  'url': '{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}/versions/{{davinciFlowVersionID}}',
  'headers': {
    'Content-Type': 'application/vnd.pingidentity.flowversion.export+json',
    'Authorization': 'Bearer {{accessToken}}'
  },
  body: JSON.stringify({
    "includeSubFlows": true,
    "includeVariableValues": true
  })

};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests
import json

url = "{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}/versions/{{davinciFlowVersionID}}"

payload = json.dumps({
  "includeSubFlows": True,
  "includeVariableValues": True
})
headers = {
  'Content-Type': 'application/vnd.pingidentity.flowversion.export+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/{{davinciFlowID}}/versions/{{davinciFlowVersionID}}');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/vnd.pingidentity.flowversion.export+json',
  'Authorization' => 'Bearer {{accessToken}}'
));
$request->setBody('{\n    "includeSubFlows": true,\n    "includeVariableValues": true\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/{{davinciFlowID}}/versions/{{davinciFlowVersionID}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/vnd.pingidentity.flowversion.export+json"
request["Authorization"] = "Bearer {{accessToken}}"
request.body = JSON.dump({
  "includeSubFlows": true,
  "includeVariableValues": true
})

response = http.request(request)
puts response.read_body
let parameters = "{\n    \"includeSubFlows\": true,\n    \"includeVariableValues\": true\n}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}/versions/{{davinciFlowVersionID}}")!,timeoutInterval: Double.infinity)
request.addValue("application/vnd.pingidentity.flowversion.export+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

200 OK

{
    "_links": {
        "self": {
            "href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/flows/e76dbc4ab5378a337f0a696ddb93c049/versions/1"
        },
        "environment": {
            "href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
        }
    },
    "flow": {
        "id": "e76dbc4ab5378a337f0a696ddb93c049",
        "name": "PingOne Session Main Flow2"
    },
    "environment": {
        "id": "abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
    },
    "description": "Last Updated: January 8th, 2025",
    "version": 1,
    "enabled": true,
    "publishedVersion": 1,
    "connectors": [
        {
            "id": "annotationConnector"
        },
        {
            "id": "flowConnector"
        },
        {
            "id": "pingOneAuthenticationConnector"
        },
        {
            "id": "nodeConnector"
        }
    ],
    "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": "",
        "debugMode": false,
        "cssLinks": [
            "https://assets.pingone.com/ux/end-user-nano/0.1.0-alpha.9/end-user-nano.css",
            "https://assets.pingone.com/ux/astro-nano/0.1.0-alpha.11/icons.css"
        ],
        "useCustomCSS": true,
        "logLevel": 2,
        "scrubSensitiveInfo": false,
        "sensitiveInfoFields": [],
        "useBetaAlgorithm": true,
        "pingOneFlow": true,
        "css": ".companyLogo {\n    height: 65px;\n}",
        "customTitle": "Sign On",
        "customFaviconLink": "https://assets.pingone.com/ux/ui-library/5.0.2/images/logo-pingidentity.png"
    },
    "color": "#ff661c",
    "graphData": { ...
         },
    "trigger": {
        "type": "AUTHENTICATION"
    },
    "createdAt": "2025-04-03T22:39:04.603Z",
    "updatedAt": "2025-04-03T22:39:04.661Z",
    "_embedded": [
        {
            "_links": {
                "self": {
                    "href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/flows/c638b49db6c72b396b132be1a88dec3d/versions/1"
                },
                "environment": {
                    "href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
                }
            },
            "flow": {
                "id": "c638b49db6c72b396b132be1a88dec3d",
                "name": "PingOne Sign On with Registration, Password Reset and Recovery2"
            },
            "environment": {
                "id": "abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
            },
            "description": "Imported on Thu Apr 03 2025 22:39:03 GMT+0000 (Coordinated Universal Time)",
            "version": 1,
            "variables": [
                {
                    "context": "flowInstance",
                    "createdDate": 1742585405223,
                    "fields": {
                        "type": "string",
                        "displayName": "Url for company's logo image",
                        "mutable": true,
                        "min": 0,
                        "max": 2000
                    },
                    "id": "1acaa3d9-8625-4581-83bd-69e87e733d96",
                    "type": "property",
                    "visibility": "private",
                    "name": "companyLogo##SK##flowInstance",
                    "companyId": "abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
                },
                {
                    "context": "flowInstance",
                    "createdDate": 1742585405222,
                    "fields": {
                        "type": "string",
                        "displayName": "",
                        "mutable": true,
                        "min": 0,
                        "max": 2000
                    },
                    "id": "5f31ff8f-f926-473b-bb0b-811f80b8c8ed",
                    "type": "property",
                    "visibility": "private",
                    "name": "companyName##SK##flowInstance",
                    "companyId": "abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
                }
            ],
            "enabled": true,
            "publishedVersion": 1,
            "connectors": [
                {
                    "id": "errorConnector"
                },
                {
                    "id": "pingOneSSOConnector"
                },
                {
                    "id": "nodeConnector"
                },
                {
                    "id": "functionsConnector"
                },
                {
                    "id": "annotationConnector"
                },
                {
                    "id": "httpConnector"
                },
                {
                    "id": "variablesConnector"
                }
            ],
            "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": "",
                "debugMode": false,
                "cssLinks": [
                    "https://assets.pingone.com/ux/end-user-nano/0.1.0-alpha.9/end-user-nano.css",
                    "https://assets.pingone.com/ux/astro-nano/0.1.0-alpha.11/icons.css"
                ],
                "useCustomCSS": true,
                "logLevel": 2,
                "scrubSensitiveInfo": false,
                "sensitiveInfoFields": [],
                "useBetaAlgorithm": true,
                "pingOneFlow": false,
                "css": ".companyLogo {\n    height: 65px;\n}\n\n.icon-padding::before {\n  padding-right: 5px;\n}",
                "customTitle": "Sign On",
                "customFaviconLink": "https://assets.pingone.com/ux/ui-library/5.0.2/images/logo-pingidentity.png"
            },
            "color": "#CACED3",
            "graphData": {...
            },
            "createdAt": "2025-04-03T22:39:04.146Z",
            "updatedAt": "2025-04-03T22:39:04.491Z"
        }
    ]
}