PingOne Platform APIs

Create Start Company Flow Policy

POST {{orchestratePath}}/company/{{companyID}}/policy/{{davinciFlowPolicyID}}/start

The POST {{orchestratePath}}/company/{{companyID}}/policy/{{davinciFlowPolicyID}}/start endpoint initates the flow specified by the {{davinciFlowPolicyID}} ID in the request URL.

This request uses the {{orchestratePath}} variable, which represents the DaVinci administrator API domain. Refer to PingOne API domains for more information.

The {{companyID}} variable in the request URL represents the PingOne environment ID associated with the DaVinci company resource.

This request uses an API Key to authenticate the request. The HTTP header uses the X-SK-API-KEY header and the value is the DaVinci application’s API Key value.

Before you use this endpoint, refer to Initiating Flow Policies to determine if the /start endpoint on the {{orchestratePath}} resource server is the best option for your flow.

Prerequisites

Headers

Authorization      X-SK-API-Key {{davinciApiKey}}

Example Request

  • cURL

  • C#

  • Go

  • HTTP

  • Java

  • jQuery

  • NodeJS

  • Python

  • PHP

  • Ruby

  • Swift

curl --location --globoff --request POST '{{orchestratePath}}/company/{{companyID}}/policy/{{davinciFlowPolicyID}}/start'
var options = new RestClientOptions("{{orchestratePath}}/company/{{companyID}}/policy/{{davinciFlowPolicyID}}/start")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
RestResponse response = await client.ExecuteAsync(request);
Console.WriteLine(response.Content);
package main

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

func main() {

  url := "{{orchestratePath}}/company/{{companyID}}/policy/{{davinciFlowPolicyID}}/start"
  method := "POST"

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

  if err != nil {
    fmt.Println(err)
    return
  }
  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 /company/{{companyID}}/policy/{{davinciFlowPolicyID}}/start HTTP/1.1
Host: {{orchestratePath}}
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("text/plain");
RequestBody body = RequestBody.create(mediaType, "");
Request request = new Request.Builder()
  .url("{{orchestratePath}}/company/{{companyID}}/policy/{{davinciFlowPolicyID}}/start")
  .method("POST", body)
  .build();
Response response = client.newCall(request).execute();
var settings = {
  "url": "{{orchestratePath}}/company/{{companyID}}/policy/{{davinciFlowPolicyID}}/start",
  "method": "POST",
  "timeout": 0,
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var request = require('request');
var options = {
  'method': 'POST',
  'url': '{{orchestratePath}}/company/{{companyID}}/policy/{{davinciFlowPolicyID}}/start',
  'headers': {
  }
};
request(options, function (error, response) {
  if (error) throw new Error(error);
  console.log(response.body);
});
import requests

url = "{{orchestratePath}}/company/{{companyID}}/policy/{{davinciFlowPolicyID}}/start"

payload = {}
headers = {}

response = requests.request("POST", url, headers=headers, data=payload)

print(response.text)
<?php
require_once 'HTTP/Request2.php';
$request = new HTTP_Request2();
$request->setUrl('{{orchestratePath}}/company/{{companyID}}/policy/{{davinciFlowPolicyID}}/start');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
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 "net/http"

url = URI("{{orchestratePath}}/company/{{companyID}}/policy/{{davinciFlowPolicyID}}/start")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)

response = http.request(request)
puts response.read_body
var request = URLRequest(url: URL(string: "{{orchestratePath}}/company/{{companyID}}/policy/{{davinciFlowPolicyID}}/start")!,timeoutInterval: Double.infinity)
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

{
    "id": "howu8n9hsc",
    "companyId": "abfba8f6-49eb-49f5-a5d9-80ad5c98f9f6",
    "flowId": "3e0603680cbde668577a5eacc6c22987",
    "connectionId": "867ed4363b2bc21c860085ad2baa817d",
    "capabilityName": "customHTMLTemplate",
    "screen": {
        "name": "HTTP",
        "properties": {
            "sktemplate": {
                "type": "string",
                "displayName": "Template",
                "createdDate": 1657665418265,
                "customerId": "ecb9bf8a2fab854e65045d02cb6bab50",
                "companyId": "singularkey"
            },
            "customHTML": {
                "type": "string",
                "displayName": "HTML Template",
                "createdDate": 1657665418205,
                "customerId": "ecb9bf8a2fab854e65045d02cb6bab50",
                "companyId": "singularkey",
                "preferredControlType": "textArea",
                "enableParameters": true,
                "maximizeToggle": true,
                "viewToggle": true,
                "largePayload": true,
                "value": "<div class=\"app-container\" style=\"display: block;\">\n\t<div class=\"page__content\" style=\"height: 100%;\">\n\t\t<div class=\"card card--no-padding\">\n\t\t\t<div class=\"card__content\">\n\t\t\t\t<div class=\"org-logo\">\n\t\t\t\t\t<img class=\"org-logo__image\" src=\"https://d3uinntk0mqu3p.cloudfront.net/branding/market/a3d073bc-3108-49ad-b96c-404bea59a1d0.png\" alt=\"Company Logo\" />\n\t\t\t\t</div>\n\t\t\t\t<div data-skcomponent=\"skerror\" class=\"feedback feedback--error sk-alert sk-alert-danger has-text-danger has-background-danger-light\" data-id=\"feedback\" data-skvisibility=\"\"></div>\n\t\t\t\t<form class=\"form\" id='usernamePasswordForm' data-id=\"usernamePasswordForm\">\n\t\t\t\t\t<div class=\"field float-label\">\n\t\t\t\t\t\t<input class=\"text-input float-label__input\" data-id=\"username-input\" id=\"username\" name=\"username\" type=\"text\" autocomplete=\"on\" value=\"\" />\n\t\t\t\t\t\t<label class=\"float-label__label\" for=\"username\">Username</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"field float-label\">\n\t\t\t\t\t\t<input class=\"text-input text-input--pasword float-label__input\" data-id=\"password-input\" id=\"password\" name=\"password\" type=\"password\" autocomplete=\"on\" value=\"\" />\n\t\t\t\t\t\t<label class=\"float-label__label\" for=\"password\">Password</label>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"control\">\n\t\t\t\t\t\t<button class=\"field is-primary mt-2 button file-input--button button--primary brand-primary-bg\" data-id=\"button\" type=\"submit\" data-skcomponent=\"skbutton\" data-skbuttontype=\"form-submit\" data-skform=\"usernamePasswordForm\" data-skbuttonvalue=\"submit\">\n                            Sign On\n\t\t\t\t\t\t\t<i class=\"fas fa-forward ml-2\"></i>\n\t\t\t\t\t\t</button>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class=\"control\">\n                        <div style=\"width: 100%; text-align: center;\">\n                            <button type=\"submit\" class=\"buttonLink is-primary is-inverted mt-2\" data-skcomponent=\"skbutton\" data-skbuttontype=\"form-submit\" data-skform=\"usernamePasswordForm\" data-skbuttonvalue=\"forgotPassword\">\n                                Forgot Password\n                                <i class=\"fas fa-forward ml-2\"></i>\n                            </button>\n                        </div>\n\t\t\t\t\t</div>\n\t\t\t\t</form>\n\t\t\t</div>\n\t\t</div>\n\t</div>\n</div>\n"
            },
            "validationRules": {
                "type": "object",
                "displayName": "Form validation rules",
                "value": [],
                "info": "Rules to check to validate form inputs",
                "createdDate": 1657665418203,
                "customerId": "ecb9bf8a2fab854e65045d02cb6bab50",
                "companyId": "singularkey",
                "preferredControlType": "validationRules"
            },
            "customCSS": {
                "type": "string",
                "displayName": "CSS",
                "createdDate": 1657665418313,
                "customerId": "ecb9bf8a2fab854e65045d02cb6bab50",
                "companyId": "singularkey",
                "preferredControlType": "codeEditor",
                "language": "css",
                "maximizeToggle": true,
                "largePayload": true
            },
            "customScript": {
                "type": "string",
                "displayName": "Script",
                "createdDate": 1657665418314,
                "customerId": "ecb9bf8a2fab854e65045d02cb6bab50",
                "companyId": "singularkey",
                "preferredControlType": "codeEditor",
                "value": "",
                "language": "javascript",
                "maximizeToggle": true
            },
            "inputSchema": {
                "type": "string",
                "displayName": "Input Schema",
                "createdDate": 1657665418286,
                "customerId": "ecb9bf8a2fab854e65045d02cb6bab50",
                "companyId": "singularkey",
                "preferredControlType": "codeEditor",
                "language": "json",
                "info": "Follow example for JSON schema.",
                "maximizeToggle": true
            },
            "outputSchema": {
                "type": "string",
                "displayName": "Output Schema",
                "createdDate": 1657665418168,
                "customerId": "ecb9bf8a2fab854e65045d02cb6bab50",
                "companyId": "singularkey",
                "preferredControlType": "codeEditor",
                "language": "json",
                "info": "Follow example for JSON schema.",
                "maximizeToggle": true
            },
            "formFieldsList": {
                "type": "array",
                "constructType": "formFieldsList",
                "displayName": "Output Fields List",
                "createdDate": 1657665418278,
                "customerId": "ecb9bf8a2fab854e65045d02cb6bab50",
                "companyId": "singularkey",
                "preferredControlType": "formFieldsList",
                "hideLabel": false,
                "value": [
                    {
                        "preferredControlType": "textField",
                        "preferredDataType": "string",
                        "propertyName": "username",
                        "displayName": "Username",
                        "hashedVisibility": false
                    },
                    {
                        "preferredControlType": "textField",
                        "preferredDataType": "string",
                        "propertyName": "password",
                        "displayName": "Password",
                        "hashedVisibility": true
                    },
                    {
                        "preferredControlType": "textField",
                        "preferredDataType": "string",
                        "propertyName": "buttonValue"
                    }
                ]
            },
            "challenge": {
                "type": "string",
                "displayName": "Challenge",
                "createdDate": 1657665418279,
                "customerId": "ecb9bf8a2fab854e65045d02cb6bab50",
                "companyId": "singularkey",
                "preferredControlType": "textField",
                "enableParameters": true
            },
            "button": {
                "constructType": "button",
                "displayName": "Submit",
                "createdDate": 1657665418275,
                "customerId": "ecb9bf8a2fab854e65045d02cb6bab50",
                "companyId": "singularkey",
                "logo": "",
                "showLogo": true,
                "preferredControlType": "button",
                "css": {
                    "backgroundColor": "#1CAB42",
                    "color": "#ffffff"
                },
                "onClick": {
                    "constructType": "skEvent",
                    "eventName": "continue",
                    "params": [],
                    "eventType": "post",
                    "postProcess": {}
                }
            },
            "nodeTitle": {
                "value": "Username/Password Form"
            }
        },
        "userViews": [
            {
                "screenTemplateName": "CustomHTMLTemplate",
                "items": [
                    {
                        "propertyName": "sktemplate"
                    },
                    {
                        "propertyName": "customHTML"
                    },
                    {
                        "propertyName": "validationRules"
                    },
                    {
                        "propertyName": "customCSS"
                    },
                    {
                        "propertyName": "customScript"
                    },
                    {
                        "propertyName": "inputSchema"
                    },
                    {
                        "propertyName": "outputSchema"
                    },
                    {
                        "propertyName": "formFieldsList"
                    },
                    {
                        "propertyName": "challenge"
                    },
                    {
                        "propertyName": "button"
                    }
                ]
            }
        ],
        "metadata": {
            "colors": {
                "canvas": "#AFD5FF",
                "canvasText": "#253746",
                "dark": "#2E5EA6"
            },
            "logos": {
                "canvas": {
                    "imageFileName": "http.svg"
                }
            }
        }
    },
    "interactionId": "00bc05ec-7b20-4396-9c76-e77707f84cd6"
}