PingOne Platform APIs

Start Registration Flow with Input Schema

POST {{authPath}}/{{envID}}/davinci/policy/{{davinciFlowPolicyID}}/start

The following sample shows the start flow endpoint, POST {{authPath}}/{{envID}}/davinci/policy/{{davinciFlowPolicyID}}/start, which initiates the flow policy specified by the {{davinciFlowPolicyID}} in the request URL. In this case, the flow policy ID corresponds to a registration flow included in the policy that prompts the user to provide the required information to create a new account.

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

The request body specifies the username, password, email, primaryPhone, name.family, and name.given input schema properties used in the flow. By adding these properties to the request, the start flow endpoint performs data validation on the request body values. For more information about using input schemas in a /start request, refer to Using an input schema with the flow.

Prerequisites

Headers

Authorization      Bearer {{accessToken}}

Content-Type      application/json

Body

raw ( application/json )

{
    "email": "elmerfudd@pingidentity.com",
    "name": {
        "given": "Elmer",
        "family": "Fudd"
    },
    "username": "elmerfudd",
    "primaryPhone": "+14155552672",
    "password": "{{password}}"
}

Example Request

  • cURL

  • C#

  • Go

  • HTTP

  • Java

  • jQuery

  • NodeJS

  • Python

  • PHP

  • Ruby

  • Swift

curl --location --globoff '{{authPath}}/{{envID}}/davinci/policy/{{davinciFlowPolicyID}}/start' \
--header 'Content-Type: application/json' \
--header 'Authorization: Bearer {{accessToken}}' \
--data-raw '{
    "email": "elmerfudd@pingidentity.com",
    "name": {
        "given": "Elmer",
        "family": "Fudd"
    },
    "username": "elmerfudd",
    "primaryPhone": "+14155552672",
    "password": "{{password}}"
}'
var options = new RestClientOptions("{{authPath}}/{{envID}}/davinci/policy/{{davinciFlowPolicyID}}/start")
{
  MaxTimeout = -1,
};
var client = new RestClient(options);
var request = new RestRequest("", Method.Post);
request.AddHeader("Content-Type", "application/json");
request.AddHeader("Authorization", "Bearer {{accessToken}}");
var body = @"{" + "\n" +
@"    ""email"": ""elmerfudd@pingidentity.com""," + "\n" +
@"    ""name"": {" + "\n" +
@"        ""given"": ""Elmer""," + "\n" +
@"        ""family"": ""Fudd""" + "\n" +
@"    }," + "\n" +
@"    ""username"": ""elmerfudd""," + "\n" +
@"    ""primaryPhone"": ""+14155552672""," + "\n" +
@"    ""password"": ""{{password}}""" + "\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 := "{{authPath}}/{{envID}}/davinci/policy/{{davinciFlowPolicyID}}/start"
  method := "POST"

  payload := strings.NewReader(`{
    "email": "elmerfudd@pingidentity.com",
    "name": {
        "given": "Elmer",
        "family": "Fudd"
    },
    "username": "elmerfudd",
    "primaryPhone": "+14155552672",
    "password": "{{password}}"
}`)

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

  if err != nil {
    fmt.Println(err)
    return
  }
  req.Header.Add("Content-Type", "application/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 /{{envID}}/davinci/policy/{{davinciFlowPolicyID}}/start HTTP/1.1
Host: {{authPath}}
Content-Type: application/json
Authorization: Bearer {{accessToken}}

{
    "email": "elmerfudd@pingidentity.com",
    "name": {
        "given": "Elmer",
        "family": "Fudd"
    },
    "username": "elmerfudd",
    "primaryPhone": "+14155552672",
    "password": "{{password}}"
}
OkHttpClient client = new OkHttpClient().newBuilder()
  .build();
MediaType mediaType = MediaType.parse("application/json");
RequestBody body = RequestBody.create(mediaType, "{\n    \"email\": \"elmerfudd@pingidentity.com\",\n    \"name\": {\n        \"given\": \"Elmer\",\n        \"family\": \"Fudd\"\n    },\n    \"username\": \"elmerfudd\",\n    \"primaryPhone\": \"+14155552672\",\n    \"password\": \"{{password}}\"\n}");
Request request = new Request.Builder()
  .url("{{authPath}}/{{envID}}/davinci/policy/{{davinciFlowPolicyID}}/start")
  .method("POST", body)
  .addHeader("Content-Type", "application/json")
  .addHeader("Authorization", "Bearer {{accessToken}}")
  .build();
Response response = client.newCall(request).execute();
var settings = {
  "url": "{{authPath}}/{{envID}}/davinci/policy/{{davinciFlowPolicyID}}/start",
  "method": "POST",
  "timeout": 0,
  "headers": {
    "Content-Type": "application/json",
    "Authorization": "Bearer {{accessToken}}"
  },
  "data": JSON.stringify({
    "email": "elmerfudd@pingidentity.com",
    "name": {
      "given": "Elmer",
      "family": "Fudd"
    },
    "username": "elmerfudd",
    "primaryPhone": "+14155552672",
    "password": "{{password}}"
  }),
};

$.ajax(settings).done(function (response) {
  console.log(response);
});
var request = require('request');
var options = {
  'method': 'POST',
  'url': '{{authPath}}/{{envID}}/davinci/policy/{{davinciFlowPolicyID}}/start',
  'headers': {
    'Content-Type': 'application/json',
    'Authorization': 'Bearer {{accessToken}}'
  },
  body: JSON.stringify({
    "email": "elmerfudd@pingidentity.com",
    "name": {
      "given": "Elmer",
      "family": "Fudd"
    },
    "username": "elmerfudd",
    "primaryPhone": "+14155552672",
    "password": "{{password}}"
  })

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

url = "{{authPath}}/{{envID}}/davinci/policy/{{davinciFlowPolicyID}}/start"

payload = json.dumps({
  "email": "elmerfudd@pingidentity.com",
  "name": {
    "given": "Elmer",
    "family": "Fudd"
  },
  "username": "elmerfudd",
  "primaryPhone": "+14155552672",
  "password": "{{password}}"
})
headers = {
  'Content-Type': 'application/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('{{authPath}}/{{envID}}/davinci/policy/{{davinciFlowPolicyID}}/start');
$request->setMethod(HTTP_Request2::METHOD_POST);
$request->setConfig(array(
  'follow_redirects' => TRUE
));
$request->setHeader(array(
  'Content-Type' => 'application/json',
  'Authorization' => 'Bearer {{accessToken}}'
));
$request->setBody('{\n    "email": "elmerfudd@pingidentity.com",\n    "name": {\n        "given": "Elmer",\n        "family": "Fudd"\n    },\n    "username": "elmerfudd",\n    "primaryPhone": "+14155552672",\n    "password": "{{password}}"\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("{{authPath}}/{{envID}}/davinci/policy/{{davinciFlowPolicyID}}/start")

http = Net::HTTP.new(url.host, url.port);
request = Net::HTTP::Post.new(url)
request["Content-Type"] = "application/json"
request["Authorization"] = "Bearer {{accessToken}}"
request.body = JSON.dump({
  "email": "elmerfudd@pingidentity.com",
  "name": {
    "given": "Elmer",
    "family": "Fudd"
  },
  "username": "elmerfudd",
  "primaryPhone": "+14155552672",
  "password": "{{password}}"
})

response = http.request(request)
puts response.read_body
let parameters = "{\n    \"email\": \"elmerfudd@pingidentity.com\",\n    \"name\": {\n        \"given\": \"Elmer\",\n        \"family\": \"Fudd\"\n    },\n    \"username\": \"elmerfudd\",\n    \"primaryPhone\": \"+14155552672\",\n    \"password\": \"{{password}}\"\n}"
let postData = parameters.data(using: .utf8)

var request = URLRequest(url: URL(string: "{{authPath}}/{{envID}}/davinci/policy/{{davinciFlowPolicyID}}/start")!,timeoutInterval: Double.infinity)
request.addValue("application/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

{
    "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": "03b9c80f-0f33-4cc7-bd69-e4b2333db89c",
    "interactionToken": "49da59305bec66faeafee2947ca0aabb99fc130cfa4ee051a4f1c417c236edabb1bbc3a3065d0eb8b5af853e4ffda70a42d6b8f493d5e72ea166d4d04ea8b06116aae8b228666809d172249cd265092c58682f7d349169ff9371e20798590ce55e221ba2f1be51e625741f1caf19767e221b692c5984267f14d5a05fe82e067e",
    "skProxyApiEnvironmentId": "us-west-2"
}