Use the PingOne DaVinci API method to call our REST APIs from your application page. The API calls might be to initiate or process transactions for DaVinci flows, or call other APIs for supported Ping Identity products and services.

This integration method is well-suited to flows that involve processes requiring no user interaction. For example, you might have a DaVinci flow that does risk analysis, and you want your application to handle the approval process for the flow based on the risk factors. Of course, you can also call our APIs when using the Widget or Redirect methods.

Prerequisites

Workflow

  1. Create a worker application in PingOne to provide the credentials needed for adding a PingOne connection in DaVinci. See “Creating PingOne credentials” in Connecting DaVinci with PingOne.

  2. Add a PingOne connection in DaVinci. See “Adding PingOne connections” in Connecting DaVinci with PingOne.

  3. Create a DaVinci flow, see Getting Started. Then, create a DaVinci flow policy and add the flow to the flow policy. See Configuring a flow policy. You’ll also need to create a DaVinci application, and associate it with the flow. See Creating an application.

  4. Using a tool like Postman, construct the DaVinci REST API calls you need. See Initiating Flows and Using Authorization APIs for more information.

    You can also call the APIs for any supported Ping Identity product or service.

  5. Test the flow in Postman or a similar tool by specifying the DaVinci API path (the api.singularkey.com production domain, or a custom domain we’ve set up with you), the Company ID, API Key, and Policy ID.

  6. When your testing is successful, export the API calls in the programming language of your choice from Postman (or other such tool), and add the API calls to your application source code.

Example

This Javascript function example calls the Initiate Registration API:

async register({rawPayload}) {
        console.info('Integration.SingularKey.js', 'Registering a new user with PingOne using DaVinci.');

        let myHeaders = new Headers();
        myHeaders.append("X-SK-API-Key", this.envVars.SINGULARKEY_REGISTRATION_KEY);
        myHeaders.append("Content-Type", "application/json");

        const requestOptions = {
            method: 'POST',
            headers: myHeaders,
            body: rawPayload,
            redirect: 'manual'
        };
        const url = this.createUrl({skFlowId: this.envVars.SINGULARKEY_REGISTRATION_POLICY_ID});
        const response = await fetch(url, requestOptions);
        const jsonResponse = await response.json();
        return jsonResponse;
    }