User Profile API

Detailed technical documentation on how to use Lemnisk User Profile API to pull data from Lemnisk.

What is the Lemnisk User Profile API?

The Lemnisk User Profile API helps client servers pull user data from Lemnisk; by querying the API with any user profile key, which typically is hashed email, hashed mobile etc. You can define what parameters to fetch for the data of the users being queried. With this, any user attribute/ demographic attribute/ technological attribute stored in the user profiles can be fetched.

Authentication

In any of the API requests, pass the mandatory parameters as below in the authentication request header.

Request headers:

Parameter

Type

Description

x-api-key

String

API key for authentication. Shared by Lemnisk

x-api-secret

String

API secret for authentication. Shared by Lemnisk

Endpoints:

GET: For MU region: https://mu-dataapi.lemnisk.co/v1/user/profile For AU region: https://au-dataapi.lemnisk.co/v1/user/profile

Get the profile of the user which includes online behavioral data and third-party taxonomy data.

Query String parameters:

Parameter

Type

Description

key

String

The identifier for the user. It can be either of Lemnisk Cookie or hashed crmid or hashed email-id or hashed phone number.

Response Content-Type: application/json

Response body parameters:

Parameter

Type

Description

message

String

The status of the request. “Success” in case of 200 OK response.

data

JSON

The profile data in JSON format. The attributes of data mentioned below

The JSON attributes of the data:

Parameter

Type

Description

page_visits_total

Number

Total online visits by the user

page_visits_15days

Number

Number of online visits by the user in past 15 days

sessions_total

Number

Total online sessions by the user

sessions_15days

Number

Number of sessions by the user in past 15 days

first_visit_ts

Number

Epoch timestamp of first online visit by the user

last_visit_ts

Number

Epoch timestamp of the last online visit by the user

browser

String

The browser from which the user visited in the last visit

os

String

The operating system from which the user visited in the last visit

city

String

The city based on the IP from which the user visited in the last visit

products_visited

name

count

ts

Array

String

Number

Number

The online products visited by the user

  • Name of the product

  • Frequency of visits

  • Last visited timestamp

subproducts_visited

name

count

ts

Array

String

Number

Number

The online sub products visited by the user

  • Name of the product

  • Frequency of visits

  • Last visited timestamp

taxonomy

name

count

Array

Name

Number

The taxonomy of the user derived from the third party data

  • Taxonomy

  • Frequency of the user tagged with the taxonomy

Example Request:

curl --request GET \
 --header 'x-api-key:put_your_api_key_here'  \
 --header 'x-api-secret:put_your_api_secret_here' \
 --url 
https://dataapi.lemnisk.co/v1/user/profile?key=hashemobileid

Response:

{
    "message": "Success",
    "data": {
        "page_visits_total": 10,
        "page_visits_15days": 3,
        "sessions_total": 2,
        "sessions_15days": 2,
        "first_seen_ts": 1521107640,
        "last_seen_ts": 1521121975,
        "browser": "Chrome Mobile",
        "city": "New Delhi,India",
        "products_visited": [
            {
                "count": 1,
                "name": "cards",
                "ts": 15211211750
            },
            {
                "count": 2,
                "name": "loans",
                "ts": 15211219750
            }
        ],
        "subproducts_visited": [
            {
                "count": 1,
                "name": "credit_card",
                "ts": 15211219750
            },
            {
                "count": 1,
                "name": "personal_loan",
                "ts": 15211212750
            }
        ],
       "segments": {
            "70920": "All Users",
            "82823": "Life Insurance",
            "82453": "Logout Page Visitors",
            "82862": "Travel Loan",
            "74654": "All Users - Mumbai",
            "82863": "Health Insurance",
            "83533": "Personal Loan",
            "82330": "Home Loan",
            "81845": "Mutual Funds"
        },
        "taxonomy": [
            {
                "name": "real-estate",
                "count": 1
            },
            {
                "name": "onlineproducts",
                "count": 2
            },
            {
                "name": "parent",
                "count": 3
            }
        ]
    }
}

NOTE: The key should be URL-encoded.

Last updated