Analytics

All analytics endpoints have path prefix /analytic-service. User must have report_viewer role from a participant to request analytics.

Optional parameters from_date (2000-01-01 by default) and to_date (2100-01-01 by default) may be used to restrict analyzed time period.

Custom filtering based on participant index schema may be used with all endpoints by means of optional filter value. It's a JSON object value where keys are field names as they are in participant index schema (see fields value in participant index schema in Index service API). Only products with the specified values will be counted.

Number of Scans

By Month

Number of scans grouped by month. Response will contain months array of data points. Each entry contain year and month fields, along with the number of scans and the number of distinct users who made the scans in num_users. Additionally there are num_impressions (total number of approved reward actions for the scans) and actions (total number of reward actions by type) fields. Entries are ordered by year and month.

POST /analytic-service/scans/get_months
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count scans from date
to_date string Count scans to date
country string Only count scans in this country.
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
Example Response
{
  "from_date": "2019-01-01",
  "months": [
    {
      "actions": {
        "visit_link": 7,
        "visit_social_networks_link": 50
      },
      "month": 1,
      "num_impressions": 687,
      "num_users": 56,
      "scans": 1031,
      "year": 2019
    },
    {
      "actions": {
        "visit_link": 2,
        "visit_social_networks_link": 4
      },
      "month": 2,
      "num_impressions": 338,
      "num_users": 45,
      "scans": 657,
      "year": 2019
    },
    {
      "actions": {
        "visit_link": 5,
        "visit_social_networks_link": 23
      },
      "month": 3,
      "num_impressions": 523,
      "num_users": 72,
      "scans": 1213,
      "year": 2019
    }
  ],
  "to_date": "2019-03-31"
}

By Week

Number of scans grouped by week. Response will contain weeks array of data points. Each entry contain year and week (week number from 1 to 53) fields, along with the number of scans and the number of distinct users who made the scans. Entries are ordered by year and week.

POST /analytic-service/scans/get_weeks
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count scans from date
to_date string Count scans to date
country string Only count scans in this country.
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
Example Response
{
  "from_date": "2019-03-01",
  "to_date": "2019-03-31",
  "weeks": [
    {
      "actions": {
        "visit_link": 0,
        "visit_social_networks_link": 1
      },
      "num_impressions": 45,
      "num_users": 7,
      "scans": 55,
      "week": 9,
      "year": 2019
    },
    {
      "actions": {
        "visit_link": 0,
        "visit_social_networks_link": 8
      },
      "num_impressions": 123,
      "num_users": 10,
      "scans": 322,
      "week": 10,
      "year": 2019
    },
    {
      "actions": {
        "visit_link": 2,
        "visit_social_networks_link": 3
      },
      "num_impressions": 99,
      "num_users": 19,
      "scans": 201,
      "week": 11,
      "year": 2019
    },
    {
      "actions": {
        "visit_link": 3,
        "visit_social_networks_link": 10
      },
      "num_impressions": 119,
      "num_users": 37,
      "scans": 328,
      "week": 12,
      "year": 2019
    },
    {
      "actions": {
        "visit_link": 0,
        "visit_social_networks_link": 1
      },
      "num_impressions": 137,
      "num_users": 25,
      "scans": 307,
      "week": 13,
      "year": 2019
    }
  ]
}

By Day

Number of scans grouped by day of month. Response will contain days array of data points. Each entry contain year, month and day fields, along with the number of scans and the number of distinct users who made the scans. Entries are ordered by the date.

POST /analytic-service/scans/get_days
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count scans from date
to_date string Count scans to date
country string Only count scans in this country.
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
Example Response
{
  "days": [
    {
      "actions": {
        "visit_link": 0,
        "visit_social_networks_link": 1
      },
      "day": 20,
      "month": 3,
      "num_impressions": 3,
      "num_users": 3,
      "scans": 51,
      "year": 2019
    },
    {
      "actions": {
        "visit_link": 0,
        "visit_social_networks_link": 3
      },
      "day": 21,
      "month": 3,
      "num_impressions": 41,
      "num_users": 9,
      "scans": 58,
      "year": 2019
    },
    {
      "actions": {
        "visit_link": 0,
        "visit_social_networks_link": 1
      },
      "day": 22,
      "month": 3,
      "num_impressions": 5,
      "num_users": 9,
      "scans": 48,
      "year": 2019
    },
    {
      "actions": {
        "visit_link": 0,
        "visit_social_networks_link": 0
      },
      "day": 23,
      "month": 3,
      "num_impressions": 2,
      "num_users": 3,
      "scans": 4,
      "year": 2019
    },
    {
      "actions": {
        "visit_link": null,
        "visit_social_networks_link": null
      },
      "day": 24,
      "month": 3,
      "num_impressions": 0,
      "num_users": 1,
      "scans": 11,
      "year": 2019
    },
    {
      "actions": {
        "visit_link": 0,
        "visit_social_networks_link": 1
      },
      "day": 25,
      "month": 3,
      "num_impressions": 17,
      "num_users": 9,
      "scans": 26,
      "year": 2019
    }
  ],
  "from_date": "2019-03-20",
  "to_date": "2019-03-25"
}

In a Period

Number of scans in the specified period ungrouped. Response will contain periods array of data points. The single entry in this array contains the number of scans and the number of distinct users who made the scans in num_users field.

POST /analytic-service/scans/get_period
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count scans from date
to_date string Count scans to date
country string Only count scans in this country.
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
Example Response
{
  "from_date": "2017-01-01",
  "to_date": "2019-09-25",
  "periods": [
    {
      "num_users": 493,
      "scans": 20188
    }
  ]
}

By Country

Number of scans grouped by country. Response will contain countries array of data points. Each entry contain country field (country code or null if there were no country associated with a scan), along with the number of scans and the number of distinct users who made the scans. Entries are ordered by the number of scans. Number of returned results may be limited with the limit argument (100 by default).

POST /analytic-service/scans/get_countries
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count scans from date
to_date string Count scans to date
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
country string Only count scans in this country.
limit number Limit the number of returned countries
Example Response
{
  "from_date": "2017-01-01",
  "to_date": "2018-01-01",
  "limit": 100,
  "countries": [
    {
      "num_users": 31,
      "country": "036",
      "scans": 45
    },
    {
      "num_users": 18,
      "country": "156",
      "scans": 40
    },
    {
      "num_users": 22,
      "country": "724",
      "scans": 32
    }
  ]
}

By State

Number of scans grouped by a region in a country. Response will contain states array of data points. Each entry contain state field (name of the region or null if there were no region associated with a scan), along with the number of scans and the number of distinct users who made the scans in the num_users field. Entries are ordered by the number of scans. Number of returned results may be limited with the limit argument (100 by default). If country is omitted from request, states in all countries are considered.

POST /analytic-service/scans/get_states
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count scans from date
to_date string Count scans to date
country string Group scans by states in country with this code
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
limit number Limit the number of returned states
Example Response
{
  "country": "036",
  "from_date": "2017-01-01",
  "limit": 100,
  "states": [
    {
      "country": "036",
      "num_users": 121,
      "scans": 5198,
      "state": null
    },
    {
      "country": "036",
      "num_users": 1,
      "scans": 4,
      "state": "Victoria"
    }
  ]
}

By City

Number of scans grouped by a city. Response will contain cities array of data points. Each entry contain city field (name of the city or null if there were no city associated with a scan), along with the number of scans and the number of distinct users who made the scans. Entries are ordered by the number of scans. Number of returned results may be limited with the limit argument (100 by default). If country isn't defined, cities in all countries are considered.

POST /analytic-service/scans/get_cities
Parameters

| Name | Type | Description | | :--------------------00--------: | :----: | :-------------------------------------------------------------------: | | authenticateit_identity_ticket | header | Required: Session's ticket | | from_date | string | Count scans from date | | to_date | string | Count scans to date | | country | string | Group scans by cities in country with this code | | filter | string | Custom participant specific filtering e.g. {“field_a”:“some_value”} | | limit | number | Limit the number of returned cities |

Example Response
{
  "cities": [
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 47,
      "scans": 2715
    },
    {
      "city": null,
      "country": "036",
      "num_users": 69,
      "scans": 1577
    },
    {
      "city": "Brighton",
      "country": "036",
      "num_users": 2,
      "scans": 126
    },
    {
      "city": "Elsternwick",
      "country": "036",
      "num_users": 3,
      "scans": 63
    },
    {
      "city": "Yarraville",
      "country": "036",
      "num_users": 8,
      "scans": 55
    }
  ],
  "country": "036",
  "limit": 100
}

By Shop

Number of scans grouped by retailer stores. Response will contain shops array of data points. Each entry contain shop field (name of the shop or null if there were no such information associated with the scan), along with the number of scans and the number of distinct users in the num_users field. Entries are ordered by the number of scans. Number of returned results may be limited with the limit argument (100 by default). If country and/or city aren't specified, shops in all countries and cities are considered.

POST /analytic-service/scans/get_shops
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count scans from date
to_date string Count scans to date
country string Group scans by cities in country with this code
city string Group scans by shops in this city
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
limit number Limit the number of returned shops
Example Response
{
  "city": "Melbourne",
  "country": "036",
  "limit": 100,
  "shops": [
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 47,
      "scans": 2715,
      "shop": null
    },
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 3,
      "scans": 6,
      "shop": "Sth melbourne supermarket"
    },
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 2,
      "scans": 3,
      "shop": "Food Puzzle"
    },
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 2,
      "scans": 3,
      "shop": "IGA X-press"
    },
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 1,
      "scans": 2,
      "shop": "Coles South Melbourne"
    },
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 1,
      "scans": 2,
      "shop": "Dafeng Supermarket"
    },
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 1,
      "scans": 2,
      "shop": "Feilong Fair Price Supermarket"
    },
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 1,
      "scans": 1,
      "shop": "7-Eleven South Yarra"
    },
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 1,
      "scans": 1,
      "shop": "Blink Beautifully"
    },
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 1,
      "scans": 1,
      "shop": "Chevron IGA X-press"
    },
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 1,
      "scans": 1,
      "shop": "Coles Caringbah"
    },
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 1,
      "scans": 1,
      "shop": "IGA Yarraville"
    },
    {
      "city": "Melbourne",
      "country": "036",
      "num_users": 1,
      "scans": 1,
      "shop": "Shanghai Supe Chemical Co.,Ltd."
    }
  ]
}

Coordinates of the Latest Scans

Coordinates of the latest scans of participant products. Response contains array coordinates of scan entries. Each entry has latitude, longitude and accuracy of scan coordinates, along with the ts (timestamp) of the scan. Entries are ordered by the timestamp. Number of returned entries may be limited with the limit parameter (100 entries are returned by default).

POST /analytic-service/scans/get_coordinates
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Select only scans from the date
to_date string Select only scans to the date
country string Select only scans in this country
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
limit number Limit the number of returned scans
Example Response
{
  "coordinates": [
    {
      "accuracy": 57.2879981994629,
      "latitude": 56.853523,
      "longitude": 53.298828,
      "ts": "2019-09-12T11:26:54Z"
    },
    {
      "accuracy": 16,
      "latitude": 56.853301,
      "longitude": 53.299013,
      "ts": "2019-09-12T11:11:32Z"
    },
    {
      "accuracy": 16,
      "latitude": 56.853301,
      "longitude": 53.299013,
      "ts": "2019-09-12T10:47:52Z"
    },
    {
      "accuracy": 200,
      "latitude": 0,
      "longitude": 0,
      "ts": "2019-08-21T07:08:36Z"
    },
    {
      "accuracy": 29.0939998626709,
      "latitude": 56.838757,
      "longitude": 53.245748,
      "ts": "2019-08-21T06:58:58Z"
    },
    {
      "accuracy": 65,
      "latitude": 56.838684,
      "longitude": 53.245463,
      "ts": "2019-08-21T06:55:09Z"
    },
    {
      "accuracy": 29.0939998626709,
      "latitude": 56.838757,
      "longitude": 53.245748,
      "ts": "2019-08-21T06:53:34Z"
    },
    {
      "accuracy": 24.4769992828369,
      "latitude": 56.838759,
      "longitude": 53.245729,
      "ts": "2019-08-21T05:24:23Z"
    },
    {
      "accuracy": 31.5139999389648,
      "latitude": 56.838747,
      "longitude": 53.24582,
      "ts": "2019-08-21T04:07:05Z"
    },
    {
      "accuracy": 27.9559993743896,
      "latitude": 56.838759,
      "longitude": 53.245818,
      "ts": "2019-08-15T10:22:11Z"
    },
    {
      "accuracy": 28.0230007171631,
      "latitude": 56.838775,
      "longitude": 53.24581,
      "ts": "2019-08-15T10:20:07Z"
    },
    {
      "accuracy": 16,
      "latitude": 56.853348,
      "longitude": 53.299278,
      "ts": "2019-08-14T09:39:40Z"
    },
    {
      "accuracy": 57.935001373291,
      "latitude": 56.853525,
      "longitude": 53.298926,
      "ts": "2019-08-14T09:37:54Z"
    },
    {
      "accuracy": 63.4459991455078,
      "latitude": 56.853516,
      "longitude": 53.298714,
      "ts": "2019-08-14T09:36:18Z"
    },
    {
      "accuracy": 63.2999992370605,
      "latitude": 56.853573,
      "longitude": 53.298793,
      "ts": "2019-08-14T09:31:34Z"
    }
  ]
}

By User Age

Number of scans grouped by user age. Response will contain ages array of data points. Each entry contain age field (age of the users or null for users with unspecified birthdate), along with the number of scans and the number of distinct users who made the scans. Entries are ordered by the age value. User scans may be filtered by user gender and/or user Shping level.

POST /analytic-service/scans/users/get_ages
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count scans from date
to_date string Count scans to date
gender string Only count scans by users of this gender
level string Only count scans by users of this level
country string Only count scans in this country.
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
Example Response
{
  "ages": [
    {
      "num_users": 1,
      "age": null,
      "scans": 1
    },
    {
      "num_users": 1,
      "age": 15,
      "scans": 3
    },
    {
      "num_users": 2,
      "age": 16,
      "scans": 8
    },
    {
      "num_users": 1,
      "age": 22,
      "scans": 8
    }
  ],
  "from_date": "2000-01-01",
  "to_date": "2100-01-01"
}

By User Generation

Number of scans grouped by user generation. Response will contain generations array of data points. Each entry contain generation field (generation based on user birthdate, null for users with undefined birthdate, or whose birthdate couldn't be classified), along with the number of scans and the number of distinct users who made the scans. Entries are in no particular order. User scans may be filtered by user gender and/or user Shping level.

POST /analytic-service/scans/users/get_generations
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count scans from date
to_date string Count scans to date
gender string Only count scans by users of this gender
level string Only count scans by users of this level
country string Only count scans in this country.
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
Example Response
{
  "generations": [
    {
      "generation": null,
      "num_users": 350,
      "scans": 7547
    },
    {
      "generation": "Baby Boomers",
      "num_users": 8,
      "scans": 5238
    },
    {
      "generation": "Generation X",
      "num_users": 32,
      "scans": 1044
    },
    {
      "generation": "Generation Z",
      "num_users": 34,
      "scans": 2817
    },
    {
      "generation": "Millennials",
      "num_users": 30,
      "scans": 489
    }
  ],
  "from_date": "2000-01-01",
  "to_date": "2100-01-01"
}

By User Gender

Number of scans grouped by user gender. Response will contain genders array of data points. Each entry contain gender field (users gender or null for users with unspecified gender), along with the number of scans and the number of distinct users who made the scans. Entries are in no particular order. User scans may be filtered by user Shping level.

POST /analytic-service/scans/users/get_genders
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count scans from date
to_date string Count scans to date
level string Only count scans by users of this level
country string Only count scans in this country.
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
Example Response
{
  "from_date": "2000-01-01",
  "genders": [
    {
      "num_users": 45,
      "gender": null,
      "scans": 155
    },
    {
      "num_users": 19,
      "gender": "male",
      "scans": 43
    },
    {
      "num_users": 136,
      "gender": "female",
      "scans": 438
    }
  ],
  "to_date": "2100-01-01"
}

By User Level

Number of scans grouped by user level. Response will contain levels array of data points. Each entry contain level field (users Shping level or null for users with no level), along with the number of scans and the number of distinct users who made the scans. Entries are in no particular order.

POST /analytic-service/scans/users/get_levels
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count scans from date
to_date string Count scans to date
country string Only count scans in this country.
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
Example Response
{
  "from_date": "2000-01-01",
  "levels": [
    {
      "num_users": 5,
      "level": null,
      "scans": 11
    },
    {
      "num_users": 77,
      "level": "bronze",
      "scans": 115
    },
    {
      "num_users": 2,
      "level": "gold",
      "scans": 13
    }
  ],
  "to_date": "2100-01-01"
}

Top by Number of Scans

Top Products

Top products by number of scans or by number of impressions. Response will contain products array of data points. Along with the number of scans, number of impressions and the number of distinct users who made the scans each entry contain product information fields id (product GTIN), brand (product brand, or null if unspecified), name (product name), image (product image, if available), featured (true for scans of featured product). Entries are sorted by number of scans by default (may be changed with sort_by parameter). Number of returned entries may be limited with the limit argument (10 by default). Number of entries may be skipped from the response using the offset argument (0 by default). Parameters offset and limit may be used for pagination. Response also has the total number of products in the count field.

POST /analytic-service/scans/products/get_top
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count scans from date
to_date string Count scans to date
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
country string Only count scans in this country.
limit number Limit the number of returned products
offset number Skip specified number of products from the response
sort_by string Sort either by number of "scans" or by "num_impressions"
Example Response
{
  "count": 16,
  "limit": 3,
  "offset": 0,
  "products": [
    {
      "actions": {
        "send_review": 21,
        "visit_link": 13,
        "visit_social_networks_link": 17,
        "watch_video": 2
      },
      "brand": null,
      "featured": false,
      "id": "08383451070009",
      "image": "https://dev-cdn.shping.com/2019/6/6/f1b8e036-324a-4fe1-88b0-84fbd06480b3.jpg",
      "name": "Lay's \"Зеленый лук\"  550г",
      "num_impressions": 368,
      "num_sales": 0,
      "num_users": 40,
      "scans": 115
    },
    {
      "actions": {
        "send_review": 5,
        "visit_link": 13,
        "visit_social_networks_link": 7,
        "watch_video": 1
      },
      "brand": "Wild Brand",
      "featured": false,
      "id": "08383451333319",
      "image": "https://dev-cdn.shping.com/2019/6/6/f1b8e036-324a-4fe1-88b0-84fbd06480b3.jpg",
      "name": "Lay's \"Зеленый лук\"  150г",
      "num_impressions": 155,
      "num_sales": 0,
      "num_users": 23,
      "scans": 96
    },
    {
      "actions": {
        "send_review": 15,
        "visit_link": 0,
        "visit_social_networks_link": 0,
        "watch_video": 0
      },
      "brand": "Wild Brand",
      "featured": false,
      "id": "08383451362388",
      "image": "https://dev-cdn.shping.com/2019/6/28/e692e739-b072-4bfb-8eb8-fa24a809da79.jpg",
      "name": "Ice-cream",
      "num_impressions": 70,
      "num_sales": 0,
      "num_users": 23,
      "scans": 73
    }
  ],
  "sort_by": "scans"
}

Top Users

Top users by number of scans. Response will contain users array of data points. Along with the number of scans each entry contain user information fields id (Shping user id), first_name, email, gender, level, image, age. Entries are sorted by number of scans. Number of returned entries may be limited with the limit argument (10 by default).

POST /analytic-service/scans/users/get_top
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count scans from date
to_date string Count scans to date
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
country string Only count scans in this country.
limit number Limit the number of returned users
Example Response
{
  "from_date": "2000-01-01",
  "limit": 10,
  "to_date": "2100-01-01",
  "users": [
    {
      "age": null,
      "email": "xyz@foo.bar",
      "first_name": "Joe",
      "gender": null,
      "id": "urn:authenticateit:user:email:xyz@foo.bar",
      "level": null,
      "image": null,
      "scans": 11
    },
    {
      "age": 19,
      "email": "j@aaa.cn",
      "first_name": "Jane",
      "gender": "female",
      "id": "urn:authenticateit:user:email:j@aaa.cn",
      "level": null,
      "image": "http://example.com/profile_pictures/xiang.jpg",
      "scans": 8
    }
  ]
}

Spent Coins

Number of coins spent by participant's campaigns.

Reward campaigns may be filtered with the same set of parameters as in API to list reward campaigns. Filtering parameters are audience, events, start_date and end_date. Only coins spent by filtered campaigns will be accounted in the result.

Coins are reported in the smallest coin units, and represented either as integer or as a string of digits. To convert from the smallest coin units to coins, numbers should be divided by 10E18.

Response entries may contain estimations on the amounts spent in AUD (in the aud field), if such information is available.

By Month

Number of coins spent by participant's campaigns, grouped by month. Response will contain months array of data points. Each entry contain year and month fields, along with the number of coins. Entries are ordered by year and month.

POST /analytic-service/spendings/get_months
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count spent coins from date
to_date string Count spent coins to date
country string Only count scans in this country
audience JSON Filter campaigns by audience
events JSON Filter campaigns by events
start_date string Filter campaigns by start date
end_date string Filter campaigns by end_date
Example Response
{
  "from_date": "2017-01-01",
  "to_date": "2018-01-01",
  "months": [
    {
      "year": 2017,
      "month": 4,
      "coins": 77000000,
      "aud": null
    },
    {
      "year": 2017,
      "month": 5,
      "coins": "8900000000000000000",
      "aud": 1.32
    }
  ]
}

By Week

Number of coins spent by participant's campaigns, grouped by week. Response will contain weeks array of data points. Each entry contain year and week (week number from 1 to 53) fields, along with the number of coins. Entries are ordered by year and week.

POST /analytic-service/spendings/get_weeks
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count spent coins from date
to_date string Count spent coins to date
country string Only count scans in this country
audience JSON Filter campaigns by audience
events JSON Filter campaigns by events
start_date string Filter campaigns by start date
end_date string Filter campaigns by end_date
Example Response
{
  "from_date": "2017-01-01",
  "to_date": "2018-01-01",
  "weeks": [
    {
      "year": 2017,
      "week": 3,
      "coins": 450000000,
      "aud": null
    },
    {
      "year": 2017,
      "week": 4,
      "coins": "33000000000",
      "aud": 0.05
    }
  ]
}

By Day

Number of coins spent by participant's campaigns, grouped by day of month. Response will contain days array of data points. Each entry contain year, month and day fields, along with the number of coins. Entries are ordered by the date.

POST /analytic-service/spendings/get_days
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count spent coins from date
to_date string Count spent coins to date
country string Only count scans in this country
audience JSON Filter campaigns by audience
events JSON Filter campaigns by events
start_date string Filter campaigns by start date
end_date string Filter campaigns by end_date
Example Response
{
  "from_date": "2017-01-01",
  "to_date": "2018-01-01",
  "days": [
    {
      "year": 2017,
      "month": 4,
      "day": 28,
      "coins": "1300000000000000",
      "aud": 0.07
    },
    {
      "year": 2017,
      "month": 5,
      "day": 3,
      "coins": "1500000000000000",
      "aud": 0.07
    },
    {
      "year": 2017,
      "month": 5,
      "day": 4,
      "coins": 50000000123,
      "aud": null
    }
  ]
}

By Reward Action

Number of coins spent by participant's campaigns, grouped by rewarded user action. Response will contain actions array of data points. Each entry contain action field, along with the number of coins spent. Entries are ordered by the coins.

POST /analytic-service/spendings/get_actions
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count spent coins from date
to_date string Count spent coins to date
country string Only count scans in this country
audience JSON Filter campaigns by audience
events JSON Filter campaigns by events
start_date string Filter campaigns by start date
end_date string Filter campaigns by end_date
Example Response
{
  "actions": [
    {
      "action": null,
      "aud": null,
      "coins": "5888272000000000000000000"
    },
    {
      "action": "scan",
      "aud": 0.01,
      "coins": "1054041000000000000000000"
    },
    {
      "action": "watch_video",
      "aud": null,
      "coins": "28461000000000000000000"
    },
    {
      "action": "send_scan_location",
      "aud": null,
      "coins": "13523000000000000000000"
    },
    {
      "action": "view_image",
      "aud": null,
      "coins": "9464000000000000000000"
    },
    {
      "action": "visit_social_networks_link",
      "aud": null,
      "coins": "8582000000000000000000"
    },
    {
      "action": "send_review",
      "aud": null,
      "coins": "8064000000000000000000"
    },
    {
      "action": "view_text",
      "aud": null,
      "coins": "2286293000000000000000"
    },
    {
      "action": "view_nutrition_info",
      "aud": null,
      "coins": "989000000000000000000"
    },
    {
      "action": "visit_link",
      "aud": 0,
      "coins": "292000000000000000000"
    },
    {
      "action": "view_certificates",
      "aud": 0,
      "coins": "155000000000000000000"
    },
    {
      "action": "view_popup",
      "aud": null,
      "coins": "22000000000000000000"
    },
    {
      "action": "follow_fb",
      "aud": 0,
      "coins": "17000000000000000000"
    }
  ]
}

Product Sales

By Month

Information on participant's product sales grouped by month. Response will contain months array of data points. Each entry contain year and month fields, along with the num_sales (number of times participant products appeared in user receipts) and amount (monetary amount of total spendings from user receipts). Entries are ordered by year and month.

POST /analytic-service/sales/get_months
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count sales from date
to_date string Count sales to date
country string Only count sales in this country
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
Example Response
{
  "months": [
    {
      "amount": "19.46",
      "month": 9,
      "num_sales": 10,
      "year": 2019
    }
  ],
  "from_date": "2000-01-01",
  "to_date": "2100-01-01"
}

By Week

Participant products sales grouped by week. Response will contain weeks array of data points. Each entry contain year and week (week number from 1 to 53) fields, along with num_sales number of sales and total monetary amount. Entries are ordered by year and week.

POST /analytic-service/sales/get_weeks
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count sales from date
to_date string Count sales to date
country string Only count sales in this country
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
Example Response
{
  "from_date": "2000-01-01",
  "to_date": "2100-01-01",
  "weeks": [
    {
      "amount": "19.46",
      "num_sales": 10,
      "week": 37,
      "year": 2019
    }
  ]
}

By Day

Information on participant products sales grouped by date. Response will contain days array of data points. Each entry contain year, month and day fields, along with the num_sales number of sales and total monetary amount. Entries are ordered by the date.

POST /analytic-service/sales/get_days
Parameters

| Name | Type | Description | | :------------------------------: | :----: | :-------------------------------------------------------------------: | | authenticateit_identity_ticket | header | Required: Session's ticket | | from_date | string | Count sales from date | | to_date | string | Count sales to date | | country | string | Only count sales in this country | | filter | string | Custom participant specific filtering e.g. {“field_a”:“some_value”} |

Example Response
{
  "days": [
    {
      "amount": "19.46",
      "day": 10,
      "month": 9,
      "num_sales": 10,
      "year": 2019
    }
  ],
  "from_date": "2000-01-01",
  "to_date": "2100-01-01"
}

By Brand

Participant products sales grouped by brand. Response will contain brands array of data points. Each entry contain brand (brand name, may be null if unknown) and image (URL for brand logo, if available), along with the num_sales (number of times product appeared in user receipts) and amount (total monetary amount from user receipts) fields. Entries are ordered by amount and num_sales. Number of returned brands may be limited with the limit parameter (100 by default).

Additional grouping by month, week or day may be requested with group_by parameter. Each brand entry will contain months, weeks or days array of entries.

POST /analytic-service/sales/get_brands
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count sales from date
to_date string Count sales to date
country string Only count sales in this country
filter string Custom participant specific filtering e.g. {“field_a”:“some_value”}
limit number Limit the number of returned brands
group_by string Additional grouping by month, week or day
Example Response
{
  "brands": [
    {
      "amount": "19.46",
      "brand": "XyzCo",
      "image": "https://example.com/xyzco.jpg,
      "num_sales": 10,
      "months": [
        {
          "amount": 1.00,
          "month": 6,
          "num_sales": 1,
          "year": 2019
        },
        {
          "amount": 8.00,
          "month": 8,
          "num_sales": 2,
          "year": 2019
        },
        {
          "amount": 10.46,
          "month": 9,
          "num_sales": 7,
          "year": 2019
        }
      ]
    }
  ],
  "from_date": "2000-01-01",
  "to_date": "2100-01-01"
}

Number of Impressions

User must have rewards_admin role from a participant to access these endpoints.

Reward campaigns may be filtered with the same set of parameters as in API to list reward campaigns. Filtering parameters are audience, events, start_date and end_date. Only impressions related to the filtered campaigns will be counted in the result.

By Month

Total number of impressions for participant campaigns, grouped by month. Response will contain months array of data points. Each entry contain year and month fields, along with the num_impressions number. Entries are ordered by year and month.

POST /analytic-service/impressions/get_months
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Counting starting from date
to_date string Counting up to date
country string Only count scans in this country
audience JSON Filter campaigns by audience
events JSON Filter campaigns by events
start_date string Filter campaigns by start date
end_date string Filter campaigns by end_date
Example Response
{
  "from_date": "2019-01-01",
  "months": [
    {
      "month": 1,
      "num_impressions": 571,
      "year": 2019
    },
    {
      "month": 2,
      "num_impressions": 218,
      "year": 2019
    },
    {
      "month": 3,
      "num_impressions": 426,
      "year": 2019
    },
    {
      "month": 4,
      "num_impressions": 204,
      "year": 2019
    },
    {
      "month": 5,
      "num_impressions": 282,
      "year": 2019
    },
    {
      "month": 6,
      "num_impressions": 316,
      "year": 2019
    }
  ],
  "to_date": "2019-06-30"
}

By Week

Total number of impressions for participant campaigns, grouped by week. Response will contain weeks array of data points. Each entry contain year and week (week number in a year) fields, along with the num_impressions number. Entries are ordered by year and week.

POST /analytic-service/impressions/get_weeks
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Counting starting from date
to_date string Counting up to date
country string Only count scans in this country
audience JSON Filter campaigns by audience
events JSON Filter campaigns by events
start_date string Filter campaigns by start date
end_date string Filter campaigns by end_date
Example Response
{
  "from_date": "2019-06-01",
  "to_date": "2019-06-30",
  "weeks": [
    {
      "num_impressions": 57,
      "week": 23,
      "year": 2019
    },
    {
      "num_impressions": 249,
      "week": 24,
      "year": 2019
    },
    {
      "num_impressions": 3,
      "week": 25,
      "year": 2019
    },
    {
      "num_impressions": 7,
      "week": 26,
      "year": 2019
    }
  ]
}

By Day

Total number of impressions for participant campaigns, grouped by date. Response will contain days array of data points. Each entry contain year, month and day fields, along with the num_impressions number. Entries are ordered by year, month and day.

POST /analytic-service/impressions/get_days
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Counting starting from date
to_date string Counting up to date
country string Only count scans in this country
audience JSON Filter campaigns by audience
events JSON Filter campaigns by events
start_date string Filter campaigns by start date
end_date string Filter campaigns by end_date
Example Response
{
  "days": [
    {
      "day": 3,
      "month": 6,
      "num_impressions": 6,
      "year": 2019
    },
    {
      "day": 4,
      "month": 6,
      "num_impressions": 2,
      "year": 2019
    },
    {
      "day": 5,
      "month": 6,
      "num_impressions": 2,
      "year": 2019
    },
    {
      "day": 6,
      "month": 6,
      "num_impressions": 2,
      "year": 2019
    },
    {
      "day": 7,
      "month": 6,
      "num_impressions": 6,
      "year": 2019
    },
    {
      "day": 8,
      "month": 6,
      "num_impressions": 39,
      "year": 2019
    },
    {
      "day": 10,
      "month": 6,
      "num_impressions": 7,
      "year": 2019
    },
    {
      "day": 11,
      "month": 6,
      "num_impressions": 7,
      "year": 2019
    },
    {
      "day": 12,
      "month": 6,
      "num_impressions": 157,
      "year": 2019
    },
    {
      "day": 13,
      "month": 6,
      "num_impressions": 37,
      "year": 2019
    },
    {
      "day": 14,
      "month": 6,
      "num_impressions": 41,
      "year": 2019
    },
    {
      "day": 17,
      "month": 6,
      "num_impressions": 1,
      "year": 2019
    },
    {
      "day": 18,
      "month": 6,
      "num_impressions": 1,
      "year": 2019
    },
    {
      "day": 20,
      "month": 6,
      "num_impressions": 1,
      "year": 2019
    },
    {
      "day": 26,
      "month": 6,
      "num_impressions": 7,
      "year": 2019
    }
  ],
  "from_date": "2019-06-01",
  "to_date": "2019-06-30"
}

Reward Indicators

Number of approved reward campaign events (impressions), number of all reward campaign events offered to users (issued), and number of coins spent for approved campaign events. All the numbers are for requested date range (from_date and to_date parameters). Response will contain num_impressions, num_issued and coins fields. The fields may be null if there is no data for the requested time period (e.g., from_date is in the future).

User must have rewards_admin role from a participant to access this endpoint.

Reward campaigns may be filtered with the same set of parameters as in API to list reward campaigns. Filtering parameters are audience, events, start_date and end_date. Only indicators related to the filtered campaigns will be included in the result.

POST /analytic-service/rewards/get_indicators
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Counting starting from date
to_date string Counting up to date
audience JSON Filter campaigns by audience
events JSON Filter campaigns by events
start_date string Filter campaigns by start date
end_date string Filter campaigns by end_date
Example Response
{
  "from_date": "2017-01-01",
  "to_date": "2018-01-01",
  "num_impressions": 998,
  "num_issued": 131893,
  "coins": "432800000012315"
}

User Activities

List of scans made by users. The result is a JSON object with scans list of entries. Each entry contains scan information fields and user information in the field user.

The resulting entries may be filtered by date and time of the scan (from_date and to_date parameters), by scan information (scan parameter which is a JSON object) and by user information (user parameter, JSON object).

To get information on a particular scan with id "12345", send {"scan": {"id": "12345"}} as the request body. Only entries for this scan will be included in the result.

To filter activities by user profile use user parameter. It must be a JSON object with the following fields (all optional): country, language, city, gender, min_age, max_age, level. E.g., to get activities of male users from Melbourne older than 26 years, send {"user": {"gender": "male", "city": "Melbourne", "min_age": 27}}.

To get information on activities of a particular user with id "67890", send {"user": {"id": "67890"}}. Only entries related to this user will be included in the result.

Parameters offset and limit (both optional, having default values of 0 and 100) may be used for pagination.

To access this endpoint user must have report_viewer role from the system participant.

POST /analytic-service/scans/users/get_activities
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Filter entries by date range
to_date string Filter entries by date range
scan JSON Filter entries by scan data
user JSON Filter entries by user data
offset number Skip specified number of entries.
limit number Limit the number of returned entries.
Example Request
{
  "from_date": "2017-01-01",
  "to_date": "2018-01-01",
  "user": {
    "gender": "male",
    "city": "Melbourne",
    "min_age": 27
  }
}
Example Response
{
  "from_date": "2017-01-01",
  "to_date": "2018-01-01",
  "scans": [
    {
      "accuracy": 65,
      "code": "00000026033419",
      "id": "4d4206e3-c70c-4c17-b87a-108863aaa10d",
      "latitude": 56838680,
      "longitude": 53245517,
      "coins": "1512311241411313",
      "status": {
        "icon": "not_recalled",
        "title": "Not recalled"
      },
      "ts": "2017-10-03T05:29:18Z",
      "user": {
        "birthdate": "1985-07-27",
        "city": "Melbourne",
        "country": "043",
        "email": "xyz@foo.bar",
        "first_name": "Jonh",
        "gender": "male",
        "id": "urn:authenticateit:user:email:xyz@foo.bar",
        "language": "en",
        "last_name": "Doe",
        "level": "platinum",
        "phone": null
      }
    }
  ]
}

Alerts

Alert entries in all alert methods may be filtered by date with from_date and to_date parameters.

The number of returned entries may be limited with limit parameter (100 by default).

All alert methods require report_viewer role from the system participant.

Number of Scans per Day

Maximum number of scans per day analytics. Returns list of alert entries in scans field. Each entry has date, scans (number of scans on that date), user (user who made all the scans). Entries are ordered by the number of scans in the scans field.

POST /analytic-service/alerts/get_scans_per_day
Parameters
Name Type Description
authenticateit_identity_ticket header Session's ticket (required)
from_date string Filter alert entries by date range
to_date string Filter alert entries by date range
country string Filter alert entries by country
city string Filter alert entries by city
limit 1.. Limit number of returned alert entries
Example Request

{
  "from_date": "2017-10-01",
  "country": "036",
  "limit": 5
}
Example Response
{
  "scans": [
    {
      "date": "2017-10-04",
      "scans": 35,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": "j.d@gmail.com",
        "first_name": "Jonh",
        "gender": null,
        "id": "urn:authenticateit:user:email:j.d@gmail.com",
        "language": "en",
        "last_name": "Doe",
        "level": "basic"
      }
    },
    {
      "date": "2017-10-04",
      "scans": 4,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": null,
        "first_name": "Jane",
        "gender": null,
        "id": "urn:authenticateit:user:facebook:12345678901234567",
        "language": null,
        "last_name": "Doe",
        "level": "basic"
      }
    },
    {
      "date": "2017-10-06",
      "scans": 2,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": "j.d@gmail.com",
        "first_name": "Jonh",
        "gender": null,
        "id": "urn:authenticateit:user:email:j.d@gmail.com",
        "language": "en",
        "last_name": "Doe",
        "level": "basic"
      }
    },
    {
      "date": "2017-10-05",
      "scans": 1,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": "j.d@gmail.com",
        "first_name": "Jonh",
        "gender": null,
        "id": "urn:authenticateit:user:email:j.d@gmail.com",
        "language": "en",
        "last_name": "Doe",
        "level": "basic"
      }
    },
    {
      "date": "2017-10-05",
      "scans": 1,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": null,
        "first_name": "Jane",
        "gender": null,
        "id": "urn:authenticateit:user:facebook:12345678901234567",
        "language": null,
        "last_name": "Doe",
        "level": "basic"
      }
    }
  ]
}

Number of Scans per Location

Maximum number of scans per location. Returns list of alert entries in scans field. Each entry has country, city, scans (number of scans in that location), user (user who made the scans). Entries are ordered by the number of scans in the scans field.

POST /analytic-service/alerts/get_scans_per_location
Parameters
Name Type Description
authenticateit_identity_ticket header Session's ticket (required)
from_date string Filter alert entries by date range
to_date string Filter alert entries by date range
country string Filter alert entries by country
city string Filter alert entries by city
limit 1.. Limit number of returned alert entries
Example Request

{
  "from_date": "2017-10-01",
  "country": "036",
  "limit": 5
}
Example Response
{
  "scans": [
    {
      "city": "Melbourne",
      "country": "036",
      "scans": 37,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": "j.d@gmail.com",
        "first_name": "Jonh",
        "gender": null,
        "id": "urn:authenticateit:user:email:j.d@gmail.com",
        "language": "en",
        "last_name": "Doe",
        "level": "basic"
      }
    },
    {
      "city": "Melbourne",
      "country": "036",
      "scans": 3,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": null,
        "first_name": "Jane",
        "gender": null,
        "id": "urn:authenticateit:user:facebook:12345678901234567",
        "language": null,
        "last_name": "Doe",
        "level": "basic"
      }
    },
    {
      "city": "Brighton",
      "country": "036",
      "scans": 1,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": null,
        "first_name": "Jane",
        "gender": null,
        "id": "urn:authenticateit:user:facebook:12345678901234567",
        "language": null,
        "last_name": "Doe",
        "level": "basic"
      }
    },
    {
      "city": null,
      "country": "036",
      "scans": 1,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": null,
        "first_name": "Jane",
        "gender": null,
        "id": "urn:authenticateit:user:facebook:12345678901234567",
        "language": null,
        "last_name": "Doe",
        "level": "basic"
      }
    },
    {
      "city": "Point Cook",
      "country": "036",
      "scans": 1,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": "j.d@gmail.com",
        "first_name": "Jonh",
        "gender": null,
        "id": "urn:authenticateit:user:email:j.d@gmail.com",
        "language": "en",
        "last_name": "Doe",
        "level": "basic"
      }
    }
  ]
}

Scans in Separated Locations

Pair of scans in separated locations in one day. Returns list of alert entries in separated_locations field. Each entry has scan1 (least recent scan in pair of separated scans), scan2 (most recent scan in pair of separated scans) and user (info on user who made these scans) fields. Scan objects in scan1 and scan2 fields have id (scan identifier), ts (date and time of the scan), city, country fields. Entries are ordered by scan timestamps from most recent to least recent.

Location filtering parameters country and city are not applicable to this API.

POST /analytic-service/alerts/get_separated_locations
Parameters
Name Type Description
authenticateit_identity_ticket header Session's ticket (required)
from_date string Filter alert entries by date range
to_date string Filter alert entries by date range
limit 1.. Limit number of returned alert entries
Example Request

{
  "from_date": "2017-10-01",
  "limit": 5
}
Example Response
{
  "separated_locations": [
    {
      "scan1": {
        "city": "Melbourne",
        "country": "036",
        "id": "8f8a77a0-f0b0-4b5e-bebd-b26eab9203a1",
        "ts": "2017-10-06T01:03:39Z"
      },
      "scan2": {
        "city": "Point Cook",
        "country": "036",
        "id": "17215e0b-255f-4926-8627-5e0fee01f648",
        "ts": "2017-10-06T08:26:56Z"
      },
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": "j.d@gmail.com",
        "first_name": "Jonh",
        "gender": null,
        "id": "urn:authenticateit:user:email:j.d@gmail.com",
        "language": "en",
        "last_name": "Doe",
        "level": "basic"
      }
    },
    {
      "scan1": {
        "city": "Melbourne",
        "country": "036",
        "id": "29297529-8267-4acb-aa40-58c15eb8baaa",
        "ts": "2017-10-04T08:24:30Z"
      },
      "scan2": {
        "city": "Brighton",
        "country": "036",
        "id": "75272506-6e7c-4eb3-96b2-b5b7212d55e1",
        "ts": "2017-10-04T10:29:09Z"
      },
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": null,
        "first_name": "Jane",
        "gender": null,
        "id": "urn:authenticateit:user:facebook:12345678901234567",
        "language": null,
        "last_name": "Doe",
        "level": "basic"
      }
    },
    {
      "scan1": {
        "city": "Melbourne",
        "country": "036",
        "id": "eb805398-102d-40e0-b7b6-ce4ce54be2d2",
        "ts": "2017-10-04T08:24:49Z"
      },
      "scan2": {
        "city": "Brighton",
        "country": "036",
        "id": "75272506-6e7c-4eb3-96b2-b5b7212d55e1",
        "ts": "2017-10-04T10:29:09Z"
      },
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": null,
        "first_name": "Jane",
        "gender": null,
        "id": "urn:authenticateit:user:facebook:12345678901234567",
        "language": null,
        "last_name": "Doe",
        "level": "basic"
      }
    }
  ]
}

Scan Time Difference

Time between consecutive scans by a user. Returns list of alert entries in time_diffs field. Each entry has scan1 (least recent scan in the pair of scans), scan2 (most recent scan in the pair of scans), time_diff (difference between time of scan1 and scan2 in seconds) and user (info on user who made these scans) fields. Scan objects in scan1 and scan2 fields have id (scan identifier) and ts (date and time of the scan) fields. Entries are ordered by scan time difference in time_diff field from small to large.

POST /analytic-service/alerts/get_scan_time_diff
Parameters
Name Type Description
authenticateit_identity_ticket header Session's ticket (required)
from_date string Filter alert entries by date range
to_date string Filter alert entries by date range
country string Filter alert entries by country
city string Filter alert entries by city
limit 1.. Limit number of returned alert entries
Example Request

{
  "from_date": "2017-10-01",
  "country": "036",
  "limit": 5
}
Example Response
{
  "time_diffs": [
    {
      "scan1": {
        "id": "4479a566-c251-4c56-881f-12888bac6872",
        "ts": "2017-10-04T06:39:39Z"
      },
      "scan2": {
        "id": "fad95807-3c01-4b04-b8c3-4f227f6109c1",
        "ts": "2017-10-04T06:39:42Z"
      },
      "time_diff": 3,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": "j.d@gmail.com",
        "first_name": "Jonh",
        "gender": null,
        "id": "urn:authenticateit:user:email:j.d@gmail.com",
        "language": "en",
        "last_name": "Doe",
        "level": "basic"
      }
    },
    {
      "scan1": {
        "id": "08f775bb-4e3a-4316-99a9-7fcb54f4302b",
        "ts": "2017-10-04T06:39:10Z"
      },
      "scan2": {
        "id": "d475fa81-18cc-41d0-bfe2-358452e1639c",
        "ts": "2017-10-04T06:39:14Z"
      },
      "time_diff": 4,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": null,
        "first_name": "Jane",
        "gender": null,
        "id": "urn:authenticateit:user:facebook:12345678901234567",
        "language": null,
        "last_name": "Doe",
        "level": "basic"
      }
    }
  ]
}

Reward Coins per Day

Number of reward coins earned per day by a user. Returns list of alert entries in coins field. Each entry has date, coins (number of reward coins earned on that day), user (info on user who earned the coins) fields. Entries are ordered by the number of coins in coins field, from bigger to smaller number of coins.

POST /analytic-service/alerts/get_coins_per_day
Parameters
Name Type Description
authenticateit_identity_ticket header Session's ticket (required)
from_date string Filter alert entries by date range
to_date string Filter alert entries by date range
country string Filter alert entries by country
city string Filter alert entries by city
limit 1.. Limit number of returned alert entries
Example Request

{
  "from_date": "2017-10-01",
  "country": "036",
  "limit": 5
}
Example Response
{
  "coins": [
    {
      "date": "2017-10-04",
      "coins": "7890000000",
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": "j.d@gmail.com",
        "first_name": "Jonh",
        "gender": null,
        "id": "urn:authenticateit:user:email:j.d@gmail.com",
        "language": "en",
        "last_name": "Doe",
        "level": "basic"
      }
    },
    {
      "date": "2017-10-05",
      "coins": 700000000,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": "j.d@gmail.com",
        "first_name": "Jonh",
        "gender": null,
        "id": "urn:authenticateit:user:email:j.d@gmail.com",
        "language": "en",
        "last_name": "Doe",
        "level": "basic"
      }
    },
    {
      "date": "2017-10-06",
      "coins": 220000000,
      "user": {
        "birthdate": null,
        "city": null,
        "country": "036",
        "email": "j.d@gmail.com",
        "first_name": "Jonh",
        "gender": null,
        "id": "urn:authenticateit:user:email:j.d@gmail.com",
        "language": "en",
        "last_name": "Doe",
        "level": "basic"
      }
    }
  ]
}

Coin Transfers per Day

Reward coins transferred per day by a user. Returns list of alert entries in coins field. Each entry has date, coins (number of coins transferred on that day), user (user who transferred the coins) fields. Entries are ordered by the number of coins in coins field.

POST /analytic-service/alerts/get_transfers_per_day
Parameters
Name Type Description
authenticateit_identity_ticket header Session's ticket (required)
from_date string Filter alert entries by date range
to_date string Filter alert entries by date range
limit 1..100 Limit number of returned alert entries
Example Request

{
  "from_date": "2018-03-01",
  "limit": 5
}
Example Response
{
  "coins": [
    {
      "coins": "5000000000000000000000",
      "date": "2018-03-16",
      "user": {
        "birthdate": "1979-01-01",
        "city": "Izhevsk",
        "email": "xyz@example.com",
        "first_name": "Ivan",
        "gender": "male",
        "id": "urn:authenticateit:user:email:xyz@example.com",
        "language": "en",
        "last_name": "かんじ",
        "level": "silver"
      }
    },
    {
      "coins": "1500000000000000000000",
      "date": "2018-03-18",
      "user": {
        "birthdate": "1979-01-01",
        "city": "Izhevsk",
        "email": "xyz@example.com",
        "first_name": "Ivan",
        "gender": "male",
        "id": "urn:authenticateit:user:email:xyz@example.com",
        "language": "en",
        "last_name": "かんじ",
        "level": "silver"
      }
    },
    {
      "coins": "1000000000000000000000",
      "date": "2018-03-23",
      "user": {
        "birthdate": "1979-01-01",
        "city": "Izhevsk",
        "email": "xyz@example.com",
        "first_name": "Ivan",
        "gender": "male",
        "id": "urn:authenticateit:user:email:xyz@example.com",
        "language": "en",
        "last_name": "かんじ",
        "level": "silver"
      }
    },
    {
      "coins": "1000000000000000000000",
      "date": "2018-03-22",
      "user": {
        "birthdate": "1979-01-01",
        "city": "Izhevsk",
        "email": "xyz@example.com",
        "first_name": "Ivan",
        "gender": "male",
        "id": "urn:authenticateit:user:email:xyz@example.com",
        "language": "en",
        "last_name": "かんじ",
        "level": "silver"
      }
    },
    {
      "coins": "1000000000000000000000",
      "date": "2018-03-21",
      "user": {
        "birthdate": "1979-01-01",
        "city": "Izhevsk",
        "email": "xyz@example.com",
        "first_name": "Ivan",
        "gender": "male",
        "id": "urn:authenticateit:user:email:xyz@example.com",
        "language": "en",
        "last_name": "かんじ",
        "level": "silver"
      }
    }
  ],
  "from_date": "2018-03-01",
  "limit": 5,
  "to_date": "2018-07-10"
}

Email Alerts

Email alert methods require report_viewer role from the system participant.

Get Configuration

Current system analytics email alerts configuration. Returns JSON object containing fields email (list of alert recepient emails), coins_per_hour (threshold for reward coins per hour), rewards_per_hour (threshold for reward redemptions per hour), scans_per_hour (threshold for the number of scans per hour) and user_scans_per_hour (threshold for the number of scans per hour per user). Any threshold may be null if there is no threshold set for the metric.

GET /analytic-service/alerts/email
Parameters
Name Type Description
authenticateit_identity_ticket header Session's ticket (required)
Example Response
{
  "email": ["j.d@gmail.com", "xyz@foo.br"],
  "coins_per_hour": "10000000000000",
  "rewards_per_hour": 50,
  "scans_per_hour": null,
  "user_scans_per_hour": 50
}

Set Configuration

Update current system analytics email alerts configuration. Accepts JSON object which may contain fields email (possibly empty list of emails), coins_per_hour (threshold for the number of reward coins per hour), rewards_per_hour (threshold for the number of reward redemptions per hour), scans_per_hour (threshold for the number of scans per hour) and user_scans_per_hour (threshold for the number of scans per hour per user). Any threshold may be disabled by setting it to null. If the measured value becomes greater than the corresponding threshold, email will be sent to the addresses from the email field.

Response contains current configuration after the update.

PUT /analytic-service/alerts/email
Parameters
Name Type Description
authenticateit_identity_ticket header Session's ticket (required)
Example Request

{
  "email": ["j.d@gmail.com"],
  "coins_per_hour": null,
  "scans_per_hour": 5000
}
Example Response
{
  "email": ["j.d@gmail.com"],
  "coins_per_hour": null,
  "rewards_per_hour": 50,
  "scans_per_hour": 5000,
  "user_scans_per_hour": 50
}

ToDo card counts

Counters related to ToDo cards. The result is a JSON object with fields num_recipients (number of users who received ToDo cards), num_dismissed (number of dismissed ToDo cards) and num_completed (number of ToDo cards completed by users).

Parameters from_date and to_date may be used to count only cards, delivered in the time interval.

Parameter card_id may be used to restrict returned counters by specific ToDo card.

To access this endpoint user must have todo_cards_supervisor role from participant.

POST /analytic-service/todo_cards/get_counts
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
from_date string Count cards after the date
to_date string Count cards before the date
card_id string Return counters for specific card
Example Request
{
  "from_date": "2017-01-01",
  "to_date": "2018-01-01"
}
Example Response
{
  "from_date": "2017-01-01",
  "to_date": "2018-01-01",
  "num_completed": 18,
  "num_dismissed": 192,
  "num_recipients": 1482
}

Average Retention Rate

Methods are available only for system

Create ARR task

The method returns task ID and task parameters.

POST /analytic-service/users/arr/task
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
countries list Optional list of countries
from_datetime string Required: Strart datetime
to_datetime string Required: End datetime
timezone_min integer User's timezone offset in minutes
type string Required: Type of initial data - scan_based or creation_date_based
Example Request
{
  "from_datetime":"2018-01-01T00:00:00Z",
  "to_datetime":"2019-01-01T00:00:00Z",
  "type": "scan_based",
  "countries": [
    "643"
  ]
}
Example Response
{
    "countries": [
        "643"
    ],
    "from_datetime": "2018-01-01T00:00:00Z",
    "id": "arr_b87c4578-20c5-4880-b765-7945c1e76d2c",
    "started": "2019-02-24T22:43:36Z",
    "status": "in_progress",
    "to_datetime": "2019-01-01T00:00:00Z",
    "type": "scan_based"
}

Read tasks

The method return tasks ids with parameters and statuses. Possible statuses: in_progress, failure, success.

GET /analytic-service/users/arr/task
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
[
    {
        "countries": [
            "643"
        ],
        "from_datetime": "2018-01-01T00:00:00Z",
        "id": "arr_b87c4578-20c5-4880-b765-7945c1e76d2c",
        "started": "2019-02-24T22:43:36Z",
        "status": "success",
        "to_datetime": "2019-01-01T00:00:00Z",
        "type": "scan_based"
    },
    {
        "countries": [
            "643"
        ],
        "from_datetime": "2018-01-01T00:00:00Z",
        "id": "arr_f9e840cc-11b2-418d-b9bd-68ab70af2fdc",
        "started": "2019-02-24T22:43:17Z",
        "status": "success",
        "to_datetime": "2019-01-01T00:00:00Z",
        "type": "creation_date_based"
    }
]

Delete task

DELETE /analytic-service/users/arr/task/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Task ID

Get ARR task data

GET /analytic-service/users/arr/task/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Task ID
Example Response
[
    {
        "0": 10,
        "30": 2,
        "60": 0,
        "90": 5,
        "group": "2018-01",
        "users_total": 17
    },
    {
        "0": 9,
        "30": 0,
        "60": 0,
        "90": 1,
        "group": "2018-02",
        "users_total": 10
    },
    {
        "0": 15,
        "30": 1,
        "60": 0,
        "90": 2,
        "group": "2018-03",
        "users_total": 18
    },
    {
        "0": 10,
        "30": 0,
        "60": 0,
        "90": 2,
        "group": "2018-04",
        "users_total": 12
    },
    {
        "0": 26,
        "30": 0,
        "60": 0,
        "90": 4,
        "group": "2018-05",
        "users_total": 30
    },
    {
        "0": 7,
        "30": 3,
        "60": 1,
        "90": 1,
        "group": "2018-06",
        "users_total": 12
    },
    {
        "0": 6,
        "30": 1,
        "60": 0,
        "90": 0,
        "group": "2018-07",
        "users_total": 7
    },
    {
        "0": 15,
        "30": 6,
        "60": 2,
        "90": 1,
        "group": "2018-08",
        "users_total": 24
    },
    {
        "0": 3,
        "30": 0,
        "60": 0,
        "90": 1,
        "group": "2018-09",
        "users_total": 4
    },
    {
        "0": 8,
        "30": 0,
        "60": 1,
        "90": 4,
        "group": "2018-10",
        "users_total": 13
    },
    {
        "0": 7,
        "30": 2,
        "60": 2,
        "90": 0,
        "group": "2018-11",
        "users_total": 11
    },
    {
        "0": 5,
        "30": 2,
        "60": 0,
        "90": 0,
        "group": "2018-12",
        "users_total": 7
    }
]

Get ARR users

POST /analytic-service/users/arr/task/users/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Task ID
group string Required: Group name
element string Required: 0, 30, 60 or 90
limit integer Non negative integer
offset string Non negative integer
Example Request
{
  "group": "2018-10",
  "element": "90",
  "limit": 2,
  "offset":0
}
Example Response
{
    "count": 4,
    "data": [
        {
            "country": "643",
            "email": "1710@mailinator.com",
            "first_name": "Света",
            "id": "urn:authenticateit:user:email:1710@mailinator.com",
            "language": "en",
            "last_name": "Морозова"
        },
        {
            "country": "643",
            "email": "19101@mailinator.com",
            "first_name": "Gregory",
            "id": "urn:authenticateit:user:email:19101@mailinator.com",
            "language": "en",
            "level": "basic"
        }
    ]
}

Summary reports

Methods are available for any participants. The system can request a report for self and for any participants. System report requires limitation by dates and can be built max for 30 days interval.

Create Summary report task

POST /analytic-service/summary/task/
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
countries list Optional list of countries
from_datetime string Strart datetime
to_datetime string End datetime
users_blacklist list Optional list of ignored users
products list Optional list of products
Example Request
{
  "from_datetime": "2018-02-20T23:17:02Z",
  "countries": [
    "643",
    "036"
  ],
  "to_datetime": "2019-03-20T23:17:02Z",
  "users_blacklist": [
    "urn:authenticateit:user:email:foo@bar.com"
  ],
  "products": [
    "00498765432998"
  ]
}
Example Response
{
    "filters": {
        "countries": [
            "643",
            "036"
        ],
        "from_datetime": "2018-02-20T23:17:02Z",
        "products": [
            "00498765432998"
        ],
        "to_datetime": "2019-03-20T23:17:02Z",
        "users_blacklist": [
            "urn:authenticateit:user:email:ikleeen@gmail.com"
        ]
    },
    "id": "analytic_summary_tasks:54a06376-65aa-4245-bc64-ea094a254f65",
    "report_by": {
        "id": "urn:authenticateit:participant:735879621218609",
        "name": "Participant Name"
    },
    "started": "2019-03-01T00:16:21Z",
    "status": "in_progress"
}

Read Summary report tasks

The method return tasks ids with parameters and statuses. Possible statuses: in_progress, failure, success.

GET /analytic-service/summary/task/
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
Example Response
[
    {
        "filters": {
            "countries": [
                "643",
                "036"
            ],
            "from_datetime": "2018-02-20T23:17:02Z",
            "products": [
                "00498765432998"
            ],
            "to_datetime": "2019-03-20T23:17:02Z",
            "users_blacklist": [
                "urn:authenticateit:user:email:foo@bar.com"
            ]
        },
        "id": "analytic_summary_tasks:54a06376-65aa-4245-bc64-ea094a254f65",
        "report_by": {
            "id": "urn:authenticateit:participant:735879621218609",
            "name": "Participant Name"
        },
        "started": "2019-03-01T00:16:21Z",
        "status": "success"
    }
]

Delete Summary report task

DELETE /analytic-service/summary/task/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Task ID

Get Summary report task data

Data available only when the status of the task is success

GET /analytic-service/summary/task/:id
Parameters
Name Type Description
authenticateit_identity_ticket header Required: Session's ticket
id string Required: Task ID
Example Response
{
    "campaigns": {
        "urn:authenticateit:campaign:646619739765882": {
            "counter": 6,
            "name": "Campaign name 1"
        },
        "urn:authenticateit:campaign:983294512189939": {
            "counter": 2,
            "name": "Campaign name 2"
        }
    },
    "cities": {
        "unknown": 55
    },
    "countries": [
        {
            "count": 54,
            "country": "036",
            "registered_count": 54
        },
        {
            "count": 33,
            "country": "643",
            "registered_count": 33
        }
    ],
    "reviews": {
        "total_approved_reviews": 5,
        "total_reviews": 5,
        "total_unique_users_who_made_review": 5
    },
    "scans": {
        "total_authorised_scans": 87,
        "total_scans": 87,
        "total_unique_users_who_made_scan": 16
    },
    "task": {
        "filters": {
            "countries": [
                "643",
                "036"
            ],
            "from_datetime": "2018-02-20T23:17:02Z",
            "products": [
                "00498765432998"
            ],
            "to_datetime": "2019-03-20T23:17:02Z",
            "users_blacklist": [
                "urn:authenticateit:user:email:foo@bar.com"
            ]
        },
        "id": "analytic_summary_tasks:54a06376-65aa-4245-bc64-ea094a254f65",
        "report_by": {
            "id": "urn:authenticateit:participant:735879621218609",
            "name": "Participant Name"
        },
        "started": "2019-03-01T00:16:21Z"
    },
    "widgets": {
        "links": {
            "http://www.foo1.bar": 1,
            "http://www.foo2.bar": 1,
            "http://www.foo3.bar": 1,
            "total_links": 3
        },
        "image": {
            "total_images": 1005
        },
        "social_networks": {
            "http://google.com": 10,
            "http://www.skinb5.com/en/": 4,
            "https://www.facebook.com/SkinB5/": 7,
            "https://www.instagram.com/skinb5/": 4,
            "https://www.youtube.com/channel/UCOfHAvY4wqKgAyOuSA4ao2Q": 8,
            "total_social_networks": 33
        },
        "video": {
            "https://cdn.shping.com/2018/7/8/710c1e22-eac4-405b-8e7b-c0e8fc30439c.mp4": 2,
            "https://cdn.shping.com/2018/7/8/aa4c6e66-95a4-4cde-ad3e-0b324a581fab.mp4": 6,
            "https://cdn.shping.com/2018/8/2/aa3b6724-4635-4a31-8cec-96488b9f1690.mp4": 51,
            "total_video": 59,
            "video_subdata": {
                "https://cdn.shping.com/2018/7/8/710c1e22-eac4-405b-8e7b-c0e8fc30439c.mp4": "Video Name 1",
                "https://cdn.shping.com/2018/7/8/aa4c6e66-95a4-4cde-ad3e-0b324a581fab.mp4": "Video Name 2",
                "https://cdn.shping.com/2018/8/2/aa3b6724-4635-4a31-8cec-96488b9f1690.mp4": "Video Name 3"
            }
        }
    }
}

results matching ""

    No results matching ""