Analytics - Endurancezone-com/API-docs GitHub Wiki

Analytics /v2/meta/ Endpoint Documentation

Overview

The Meta API endpoint provides access to analytical data about rewards usage for a partner within a specified date range. This endpoint requires authentication and returns structured metadata and analytics specific to the authenticated partner's rewards program usage, including login counts, reward activities, and impression data.

Endpoint Details

URL: /v2/meta/
Method: GET
Authentication: Required (Bearer token, see Authorization)

Request Parameters

Parameter Type Required Description
fromDate DateTime Yes The start date of the range to retrieve metadata
toDate DateTime Yes The end date of the range to retrieve metadata

Data Collected

The endpoint aggregates the following data points:

  1. Logins: Number of user logins (total and unique users) within the specified date range for the partner
  2. Reward Activities: Tracked user interactions with rewards, grouped by reward title and type
  3. Impressions: Data on how many times rewards have been displayed

Responses

Success Response

Code: 200 OK
Content Type: application/json
Response Body: MetaDataResponse object

{
  "totalLogins": 1234,
  "uniqueLogins": 480,
  "activities": [
    {
      "title": "Reward Title",
      "total": 85,
      "type": "Clicked Reward Tile",
      "uniqueUsers": 42,
      "brand": "BrandName"
    }
  ],
  "impressions": [
    {
      "title": "Reward Title",
      "total": 2500,
      "type": "string",
      "brand": "BrandName"
    }
  ]
}

Field Definitions

Field Type Description
totalLogins integer The total number of user logins in the date range for the partner
uniqueLogins integer The number of distinct users who logged in during the date range
activities array Reward activities in the date range, grouped by reward title and activity type
activities.title string The title of the reward associated with the activity
activities.total integer The total count of this activity type for the reward
activities.type string The type of activity (for example a click on a reward tile)
activities.uniqueUsers integer Number of distinct users who performed this activity
activities.brand string The brand name associated with the reward
impressions array Impressions (views) of rewards, grouped by reward
impressions.title string The title of the reward
impressions.total integer The total number of impressions for this reward
impressions.type string The type of the reward
impressions.brand string The brand name associated with the reward

Error Responses

Code: 400 Bad Request
Conditions: When fromDate or toDate is missing or is not a valid date

Code: 404 Not Found
Conditions: When either fromDate or toDate is supplied as the minimum date (0001-01-01)
Content Type: application/json
Response Body: BaseHttpResult object

Example:

{
  "resultDetails": "No From Date Supplied",
  "result": "400- NOT OK"
}

OR

{
  "resultDetails": "No To Date Supplied",
  "result": "400- NOT OK"
}

Code: 401 Unauthorized
Conditions: The Bearer token is missing, invalid or expired

Security

  • This endpoint requires a valid Bearer token for authentication
  • The user's partner ID is extracted from the token and used to scope the data

Related Endpoints

See Org units:

  • /v2/meta/OrgUnitLevels (GET) - Retrieves organization unit levels for the authenticated partner
  • /v2/meta/OrgUnitLevels (POST) - Saves organization unit levels for the authenticated partner
  • /v2/meta/OrgUnitLevels (PATCH) - Updates organization unit levels for the authenticated partner