Uploading your Dataset
Uploading your dataset via credolab SDK is a straightforward process that allows you to easily integrate with our platform. Here are the two essential steps you'll need to follow:
- Get API key: To upload datasets to Credolab, you need to have the API key which is used to identify who tries to upload the dataset.
- Upload Request: After successfully logging in, the upload request can be initiated to transfer the dataset to our platform for processing and analysis.
- Set Additional Info: After successful dataset upload, Additional Info metadata can be assigned to this dataset if required.
Using Web SDK?
Please note that the documentation provided on this page pertains to mobile platforms. If you have already integrated the Web SDK, you may proceed directly to the guide on 'Collecting your Dataset Insight' or set Additional Info if required and not yet set.
1. Obtain API key
The API key - is the key Credolab uses to identify the client who is uploading the dataset to the Credolab server.
How to get the API key:
- the API key with Uploader should be provided by Credolab right after the subscription is created.
2. Upload Dataset from a client device
POST /api/datasets/v1/upload
Request Description
Upload dataset.
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] | The dataset identifier with maximal length of 100 characters. We recommend using alphanumeric characters, dashes "-" and underscores "_" for the referenceNumber. |
data [string] | The mobile dataset collected by credolab SDK |
realIp [string] | [optional] The real user IP address from which the dataset was uploaded to the client-server (only applicable for reverse proxy upload) |
additionalInfo | [optional] Additional attributes associated with the dataset (e.g. clientID, hashed email address, hashed phone number) |
Additional Info parameters
Additional Info parameters (optional) is a set of key-value pairs of strings. Those parameters can be associated with every dataset and there are no mandatory fields. It can consist of any properties the user wants to use in the future insights calculation. Let your customer success manager know about these fields and our R&D team will incorporate them into the insights.
As an example clientId can be used. This field represents the unique identifier of the vendor's client. The same value can be associated with several datasets for the same client.
When velocity features are calculated this field can be included in the process. By doing it insights such as number of unique devices per client, number of clients per device can be returned.
Note
If the Additional Info can not be defined prior to or during dataset upload it can be assigned later, after the dataset is uploaded. A separate endpoint is used for that.
Request Body Example (application/json):
{
"referenceNumber": "#123456789",
"data": "H4sIAAAAAAAAAOVc62/bNhC/D/5DjHz...",
"realIp": "1.1.1.1",
"additionalInfo": {
"clientId": "f40dc5c0-4ff9-4c91-b5ae-4abbd99fff08"
}
}
Response
Status code 200 or ProblemDetails Exception
Sample values for
data
parameterWe offer five dataset samples from both Android and iOS platforms. To simulate upload requests to our server, use these samples in the
data
parameter for testing.
3. Assign Additional Info metadata
Additional Info metadata can be saved multiple times.
The Additional Info identifiers' values that have been already saved, can not be modified or deleted. Only new identifiers can be added to the same dataset.
User with the role uploader is permitted to call this endpoint.
POST /api/datasets/v1/additionalinfo
Request Description
Set Additional Info metadata.
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] | The dataset identifier with maximal length of 100 characters. We recommend using alphanumeric characters, dashes "-" and underscores "_" for the referenceNumber. |
additionalInfo | Additional attributes associated with the dataset (e.g. clientID, hashed email address, hashed phone number) |
Request Body Example (application/json):
{
"referenceNumber": "#123456789",
"additionalInfo": {
"clientId": "f40dc5c0-4ff9-4c91-b5ae-4abbd99fff08"
}
}
Response
Status code 200 or ProblemDetails Exception (see error codes and statuses)
Updated about 1 month ago