Collecting your Dataset Insight

This document outlines the two-step process for accessing dataset insights from the Credolab Portal after the successful client-side integration.

  1. Get API key: To request insight from Credolab, you need to have the API key which is used to identify who tries to perform an action.
  2. Request Dataset Insights: After logging in, you can request insights for each dataset. The response can be fully customized based on your request.

1. Obtain API key

The API key - is the key Credolab uses to identify the client who is requesting insight from the Credolab server.

How to get the API key:

  • the API key with the Requester role should be provided by Credolab right after the subscription is created.

2. Request Dataset Insights from the Credolab Portal

GET /api/insights/v1/{referencenumber}?codes={code1}&codes={code2}&tags={tag1}&tags={tag2}

Request Description

This API returns scores and insights calculated based on data from a mobile device or a web session.

It is fully modular and supports filtering the response using the following optional parameters: codes (a list of product codes) and/or tags (a list of tags).

Filtering Logic

The filtering mechanism uses an OR condition across all specified items and parameters to select the final set of insights:

  • If a filter is provided (either codes or tags), the response will include any insight matching any of the provided codes OR any of the provided tags.
  • If no filters are provided, the response returns all configured scores and insights for the subscription.
📘

The list of configured product codes/tags is available in the subscription settings. Default API codes/tags are described in the data dictionary or can be provided by your CSM manager.

NOTE: if you use v6 API please check documentation here

Request Headers

HeaderValueDescription
AuthorizationBearer $API_KEYThe header is used to authorize the request. Remember that you will have to replace $API_KEY with your actual API key from Obtain API key.

Request Parameters

Name

Description

referenceNumber [string] from route

Unique identifier of the dataset registered on the credolab server.

codes [string] from query

A unique set of insight codes configured in the subscription

tags [string] from query

A unique set of insight tags configured in the subscription

Response Result

The API call returns the Insight Request details for the provided reference number. The result contains the following attributes:

Main entity

Entity

Name

Description

Example

Result Attributes

referenceNumber [string]

Unique identifier of the dataset registered on the credolab server.

"12345678"

Result Attributes

requestedDate [timestamp]

Date/time when the API is triggered by the requester. Timestamp ISO 8601 format: yyyy-mm-ddThh:mm:ss.ffffffZ and expressed in UTC.

"2020-12-16T02:39:24.986424Z"

Result Attributes

requester [string]

E-mail of the user who triggered the API.

"[email protected]"

Result Attributes

insights [array of insights]

A set of insight results that were calculated by the credolab scoring engine

Result Attributes

insights

code [string]

Insight code that is defined by credolab.

"SC01"

Result Attributes

insights

value [object]

Insights value based on the dataset captured and scorecard configured by credolab. Can be of two types: Score or Fragment.

{
    "score":535.0,
    "probability":0.1066
 }

Result Attributes

insights

calculatedDate [timestamp]

Date/time when the insights were calculated by the credolab scoring engine. Timestamp ISO 8601 format: yyyy-mm-ddThh:mm:ss.ffffffZ and expressed in UTC.

"2020-12-16T02:39:24.986424Z"

Result Attributes

insights

isArchived [boolean]

⚠️ DEPRECATED

This field is deprecated and will be removed in a future version.


A boolean flag indicating whether the insight value was archived. This field will always return false for insights generated directly from a request.

false