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.
- 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.
- 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}&{code2}
Request Description
This API returns scores and insights calculated based on the data collected from a mobile device or a web session. The API is fully modular and returns a response only for requested product codes. If the code parameter is missing the response returns all scores and insights configured on the subscription.
The list of available product
codes
will be provided by your CSM manager.
NOTE: if you use v6 API please check documentation here
Request Headers
Header | Value | Description |
---|---|---|
Authorization | Bearer $API_KEY | The 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 |
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" |
Updated 27 days ago