PingOne Platform APIs

Deploy a DaVinci Flow

 

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

The POST {{apiPath}}/environments/{{envID}}/flows/{{flowID}} endpoint uses the application/vnd.pingidentity.flow.deploy+json custom Content-Type value to initiate an action to deploy the flow specified by its ID in the request URL.

Headers

Authorization      Bearer {{accessToken}}

Content-Type      application/vnd.pingidentity.flow.deploy+json

Example Request

  • cURL

  • C#

  • Go

  • HTTP

  • Java

  • jQuery

  • NodeJS

  • Python

  • PHP

  • Ruby

  • Swift

curl --location --globoff --request POST '{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}' \
--header 'Content-Type: application/vnd.pingidentity.flow.deploy+json' \
--header 'Authorization: Bearer {{accessToken}}'
var options = new RestClientOptions("{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/vnd.pingidentity.flow.deploy+json");
request.AddHeader("Authorization", "Bearer {{accessToken}}");
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main

import (
  "fmt"
  "net/http"
  "io"
)

func main() {

  url := "{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}"
  method := "POST"

  client := &http.Client {
  }
  req, err := http.NewRequest(method, url, nil)

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/vnd.pingidentity.flow.deploy+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}} HTTP/1.1
Host: {{apiPath}}
Content-Type: application/vnd.pingidentity.flow.deploy+json
Authorization: Bearer {{accessToken}}
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/vnd.pingidentity.flow.deploy+json");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}")
  .method("POST", body)
  .addHeader("Content-Type", "application/vnd.pingidentity.flow.deploy+json")
  .addHeader("Authorization", "Bearer {{accessToken}}")
  .build();
Response response = client.newCall(request).execute();
var settings = {
  "url": "{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/vnd.pingidentity.flow.deploy+json",
    "Authorization": "Bearer {{accessToken}}"
  },
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var request = require('request');
var options = {
  'method': 'POST',
  'url': '{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}',
  'headers': {
    'Content-Type': 'application/vnd.pingidentity.flow.deploy+json',
    'Authorization': 'Bearer {{accessToken}}'
  }
};
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}}"

payload = {}
headers = {
  'Content-Type': 'application/vnd.pingidentity.flow.deploy+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}}');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/vnd.pingidentity.flow.deploy+json',
  'Authorization' => 'Bearer {{accessToken}}'
));
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}}")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/vnd.pingidentity.flow.deploy+json"
request["Authorization"] = "Bearer {{accessToken}}"

response = http.request(request)
puts response.read_body
var request = URLRequest(url: URL(string: "{{apiPath}}/environments/{{envID}}/flows/{{davinciFlowID}}")!,timeoutInterval: Double.infinity)
request.addValue("application/vnd.pingidentity.flow.deploy+json", forHTTPHeaderField: "Content-Type")
request.addValue("Bearer {{accessToken}}", forHTTPHeaderField: "Authorization")

request.httpMethod = "POST"

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/undefined"
        },
        "environment": {
            "href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
        },
        "connectorInstances": {
            "href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/connectorInstances"
        },
        "flow.deploy": {
            "href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/flows/d58f7ae39f866326501ae657e4ac9a60"
        },
        "flow.clone": {
            "href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/flows/d58f7ae39f866326501ae657e4ac9a60"
        },
        "flow.enabled": {
            "href": "https://api.pingone.com/v1/environments/abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6/flows/d58f7ae39f866326501ae657e4ac9a60/enabled"
        }
    },
    "id": "d58f7ae39f866326501ae657e4ac9a60",
    "environment": {
        "id": "abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6"
    },
    "name": "PingOneConnectorFlow",
    "description": "For pi.flow test",
    "enabled": true,
    "currentVersion": 1,
    "publishedVersion": 1,
    "connectors": [
        {
            "id": "pingOneSSOConnector"
        }
    ],
    "color": "#CACED3",
    "graphData": {
        "elements": {
            "nodes": [
                {
                    "data": {
                        "id": "8bnj41592a",
                        "nodeType": "CONNECTION",
                        "connectionId": "94141bf2f1b9b59a5f5365ff135e02bb",
                        "connectorId": "pingOneSSOConnector",
                        "name": "PingOne",
                        "label": "PingOne",
                        "status": "configured",
                        "capabilityName": "userLookup",
                        "type": "action",
                        "properties": {
                            "additionalUserProperties": {
                                "value": []
                            },
                            "username": {
                                "value": "[\n  {\n    \"children\": [\n      {\n        \"text\": \"5282e30d-6e05-499c-ae68-0069fba776f1\"\n      }\n    ]\n  }\n]"
                            },
                            "population": {
                                "value": "c9f3fb3f-11e9-4eb0-b4ba-9fb7789a8418"
                            },
                            "userIdentifierForFindUser": {
                                "value": "[\n  {\n    \"children\": [\n      {\n        \"text\": \"5282e30d-6e05-499c-ae68-0069fba776f1\"\n      }\n    ]\n  }\n]"
                            }
                        }
                    },
                    "position": {
                        "x": 420,
                        "y": 360
                    },
                    "group": "nodes",
                    "removed": false,
                    "selected": false,
                    "selectable": true,
                    "locked": false,
                    "grabbable": true,
                    "pannable": false,
                    "classes": ""
                }
            ]
        },
        "data": {},
        "zoomingEnabled": true,
        "userZoomingEnabled": true,
        "zoom": 1,
        "minZoom": 1e-50,
        "maxZoom": 1e+50,
        "panningEnabled": true,
        "userPanningEnabled": true,
        "pan": {
            "x": 0,
            "y": 0
        },
        "boxSelectionEnabled": true,
        "renderer": {
            "name": "null"
        }
    },
    "createdAt": "2023-10-16T21:51:49.882Z",
    "updatedAt": "2024-04-19T22:54:07.404Z",
    "deployedAt": "2024-04-19T22:54:07.404Z"
}