Complete the session

Introduction

Once an onboarding attempt finishes, it is important to mark it as complete.

A few things will happen when you complete the session:

  • It will now be shown as "COMPLETED" in the dashboard

  • It will re-calculate the score based on business rules you might have set on the dashboard

  • Will set the onboarding status to ONBOADING_FINISHED, and trigger the onboarding status webhook with this status.

You can take a deeper look at the endpoint here: Mark onboarding complete

Sample Code

curl --location 'https://demo-api.incodesmile.com/omni/finish-status' \
--header 'Content-Type: application/json' \
--header 'api-version: 1.0' \
--header 'x-api-key: <your_api_key>' \
--header 'X-Incode-Hardware-Id: <your_session_token>'
const axios = require('axios');

const config = {
  method: 'get',
  url: 'https://demo-api.incodesmile.com/omni/finish-status',
  headers: { 
    'Content-Type': 'application/json', 
    'api-version': '1.0', 
    'x-api-key': '<your_api_key>',
    'X-Incode-Hardware-Id': '<your_session_token>'
  }
};

axios(config).then(function (response) {
  console.log(response.data);
}).catch(function (error) {
  console.log(error);
});

var client = HttpClient.newHttpClient();

var request = HttpRequest.newBuilder()
  .uri(URI.create("https://demo-api.incodesmile.com/omni/finish-status"))
  .header("Content-Type", "application/json")
  .header("api-version", "1.0")
  .header("x-api-key", "<your_api_key>")
  .header("X-Incode-Hardware-Id", "<your_session_token>")
  .GET()
  .build();

var response = client.send(request, BodyHandlers.ofString());
System.out.println(response.body());
using var client = new HttpClient();

client.DefaultRequestHeaders.Add("Content-Type", "application/json");
client.DefaultRequestHeaders.Add("api-version", "1.0");
client.DefaultRequestHeaders.Add("x-api-key", "<your_api_key>");
client.DefaultRequestHeaders.Add("X-Incode-Hardware-Id", "<your_session_token>");

var response = await client.GetAsync("https://demo-api.incodesmile.com/omni/finish-status");
var responseString = await response.Content.ReadAsStringAsync();
Console.WriteLine(responseString);
import requests

url = "https://demo-api.incodesmile.com/omni/finish-status"

headers = {
    'Content-Type': 'application/json',
    'api-version': '1.0',
    'x-api-key': '<your_api_key>',
    'X-Incode-Hardware-Id': '<your_session_token>'
}

response = requests.get(url, headers=headers)

print(response.text)