API Key Management

Personal access tokens are used to authenticate with the DataInsider

What is an API key?

An application programming interface (API) key is a unique identifier providing a private token to a user for authentication purposes.

Create an API key

1. On the Main Screen, click Settings, select Organization Settings

2. Access to API Key Management section

3. Click Create API key

4. Enter Token name and select Expired date

5. Select the Privileges that the token can access, then click Create

6. The new API key is listed with its name and expired date, you can update or remove it later.

Demo

Add the API key to your request

You have to include an API key with Data Ingestion API request.

Sample request:

In the following example, add your API key: [SAMPLE_KEY]

curl --request POST \
  --url https://[client].datainsider.co/api/tracking/warehouse/stream \
  --header 'Content-Type: application/json' \
  --data '{
    "api_key": [SAMPLE_KEY],
    "events": [
   	 {
   		 "db_name": "demo",
   		 "tbl_name": "purchase",
   		 "properties": {
   			 "card_number": "1123123-123123-1232135",
   			 "order_id": 123123,
   			 "user_id": "ng-van-a-1999",
   			 "user_device": "iphone xs",
   			 "item": "mac pro 2020",
   			 "total_price": 1999,
   			 "created_time": 1627379100000
   		 }
   	 },
   	 {
   		 "db_name": "demo",
   		 "tbl_name": "purchase",
   		 "properties": {
   			 "card_number": "1123123-123123-1232135",
   			 "order_id": 123123,
   			 "user_id": "ng-van-a-1999",
   			 "user_device": "macbook pro",
   			 "item": "ipad pro 2020",
   			 "total_price": 999,
   			 "created_time": 1627379110000
   		 }
   	 },
   	 {
   		 "db_name": "demo",
   		 "tbl_name": "view_product",
   		 "properties": {
   			 "user_id": "ng-van-a-1999",
   			 "start_time": 1627379101263,
   			 "end_time": 1627379200000,
   			 "total_product_views": 123,
   			 "is_checkout_out": true
   		 }
   	 }
    ]
}'

Last updated