Data Analysis API Edit

Liquid offers a REST API for reading aggregated data from Liquid servers, called Data Analysis API.

This API has one endpoint available and authentication is mandatory using the app key, e.g.: uDfNVSzRCOjgvlWCpn7CPx-UCEAA5CPs. This key is available in your app settings on Liquid dashboard, and it’s different from the Data Collection API key.

The current available endpoint is:

GET Resource info
/users/:id Used to obtain information about a user.

GET /users/:id Edit

Returns aggregated data about a user. It contains three keys:

{
  "attrs": {},
  "last_device": {},
  "session": {}
}
Attribute Description
attrs User attributes, including custom ones. These are accumulated and reflect the last known information of each user.
last_device Information about the last device used by this user.
session Session-related metrics of this user.

Headers

Header Example Notes
Authorization Token [your_api_key] The app API key, available at the App settings on Liquid dashboard.
Accept application/vnd.lqd.v1+json Optionally, you can use application/json if you don’t care about which api version you are using, notice future changes may break you code if you do this.
Content-Type application/json  

Resource URL

https://analyze.lqd.io/users/:unique_id

Important note

The unique_id attribute should be URL encoded.

Example Request

GET

https://analyze.lqd.io/users/02318f2cdd156d78fd4431

Example Result

{
    "id": "559d081f70726f181222a1a7",
    "attrs": {
        "campaign": null,
        "churn_prob": 1,
        "city": "Bristol",
        "country": "United Kingdom",
        "country_code_alpha2": "UK",
        "devices_count": 1,
        "first_seen_at": "2015-07-08T11:23:08.514+00:00",
        "identified": false,
        "last_seen_at": "2015-07-08T11:23:09.822+00:00",
        "mediasource": null,
        "unique_id": "02318f2cdd156d78fd4431"
    },
    "last_device": {
        "unique_id": "78F348DE-31E0-4ACF-B2B0-5065FF8FCFB0",
        "first_seen_at": "2015-07-08T11:23:08.514+00:00",
        "last_seen_at": "2015-07-07T10:22:08.822+00:00",
        "app_bundle": "io.lqd.LiquidDemo",
        "app_name": "Demo App",
        "ip_address": "8.8.8.8",
        "app_version": "1.0",
        "release_version": "1.0.1",
        "carrier": "Vodafone",
        "internet_connectivity": "Cellular",
        "sdk_version": "1.0.0",
        "model": "iPad2,5",
        "name": "Username's iPad",
        "vendor": "Apple",
        "push_token": "5862036a860c6b6aada50117caea626d20ed3187d6981c8190cfa6199526ce30",
        "screen_size": "768x1024",
        "system_version": "7.0.1",
        "system_language": "en",
        "locale": "en"
    },
    "session": {
        "avg_length": 93,
        "max_length": 240,
        "min_length": 30,
        "total_length": 1395,
        "total_number": 15
    }
}

Response

Code Status Content Scenario
200 Ok A JSON object representing the user. See the example above. Existing user.
404 Not Found n/a User was not found.
401 Unauthorized n/a Authorization failed (probably you used an invalid API token).

Error messages for Unprocessable Entity (422) have the following structure:

{
  "message": "Error Message"
}