Overview

The Analytics API is a way to get analytics data from the Aprimo database. Knowledge of Aprimo’s data schemas is not requires to effectively use this API, as the API exposes an endpoint that makes querying simple and robust. The query format involves passing parameter in an API call. This guide provides information and example on how to get analytics information from Aprimo.

Authentication

The Analytics API uses the same authentication as the rest of the Aprimo REST API. To learn how to get an access token, see our authentication guide. Once you have obtained your Bearer access token, include it in the Authorization header like the below image from POSTMAN. Note that you must use one of the OAuth 2.0 flows – “Aprimo Authorization” flows are not supported.

Image showing how to use the Authorization header in POSTMAN

Endpoints

Each Aprimo environment has their own endpoints.

GET https://[AprimoTenant].aprimo.com/analytics/?query={{query}}

Replace {{query}} with the query JSON. See examples below for sample JSON. Note that the JSON must all be on one line. A simple way to manage this in a tool like POSTMAN is to stringify the JSON as shown:

 

 

Measures, Dimensions, and Filters Oh My!

The Analytics API has 3 main attributes to make use of when developing queries:

  • Measures
  • Dimensions
  • Filters

Measures are aggregations of certain columns in the Aprimo database.

Dimensions are attributes that relate to a measure. For example, the measure “Downloads.count” could have dimensions such as “recordId” or “Classification”.

Filters are conditional expressions that contains a member, operator, and a value.

Below are the different measures and dimensions supported.

Classifications:
  Dimensions:
    Classifications.name (string)
    Classifications.identifier (string)
    Classifications.rootClassificationId (string)
    Classifications.parentClassificationId (string)
    Classifications.sortIndex (number)
    Classifications.sortOrder (string)
    Classifications.createUser (string)
    Classifications.createDate (time)
    Classifications.lastModifiedUser (string)
    Classifications.lastModifiedDate (time)
    Classifications.contentType (string)
Collections:
  Dimensions:
    Collections.name (string)
    Collections.createUser (string)
    Collections.createDate (time)
    Collections.lastModifiedUser (string)
    Collections.lastModifiedDate (time)
    Collections.viewType (string)
    Collections.scope (string)
    Collections.isPublic (string)
    Collections.description (string)
    Collections.searchExpression (string)
    Collections.numberOfAssets (number)
ContentEngagement:
  Measures:
    ContentEngagement.downloadsCount (count)
    ContentEngagement.impressionsCount (count)
    ContentEngagement.viewsCount (count)
  Dimensions:
    ContentEngagement.date (time)
    ContentEngagement.userId (number)
    ContentEngagement.recordId (string)
DateDimension:
  Dimensions:
    DateDimension.date (time)
    DateDimension.year (number)
    DateDimension.quarterLabelId (number)
    DateDimension.monthLabelId (number)
    DateDimension.weekdayLabelId (number)
    DateDimension.monthLongNameLabelId (number)
    DateDimension.weekdayLongNameLabelId (number)
    DateDimension.yearStartDate (time)
    DateDimension.yearEndDate (time)
    DateDimension.quarterStartDate (time)
    DateDimension.quarterEndDate (time)
    DateDimension.monthStartDate (time)
    DateDimension.weekStartDateSun (time)
    DateDimension.weekStartDateMon (time)
    DateDimension.monthEndDate (time)
    DateDimension.monthOrder (number)
    DateDimension.weekdayOrder (number)
    DateDimension.julianDayNumber (number)
    DateDimension.fiscalYear (string)
    DateDimension.fiscalQuarter (string)
    DateDimension.fiscalMonthLabelId (number)
    DateDimension.fiscalYearStartDate (time)
    DateDimension.fiscalYearEndDate (time)
    DateDimension.fiscalQuarterStartDate (time)
    DateDimension.fiscalQuarterEndDate (time)
    DateDimension.fiscalMonthStartDate (time)
    DateDimension.fiscalMonthEndDate (time)
    DateDimension.fiscalMonthOrder (number)
Downloads:
  Measures:
    Downloads.count (count)
  Dimensions:
    Downloads.downloadDate (time)
    Downloads.dateDimensionId (number)
    Downloads.userId (number)
    Downloads.recordId (string)
    Downloads.versionId (string)
    Downloads.renditionId (string)
    Downloads.renditionType (string)
    Downloads.versionNumber (number)
    Downloads.cropHeight (number)
    Downloads.cropWidth (number)
    Downloads.cropType (string)
    Downloads.trimDuration (number)
FiscalMonth:
  Dimensions:
    FiscalMonth.label (string)
Groups:
  Dimensions:
    Groups.active (number)
    Groups.name (string)
    Groups.loginId (string)
Impressions:
  Measures:
    Impressions.count (count)
  Dimensions:
    Impressions.id (number)
    Impressions.hitDateTime (time)
    Impressions.recordId (string)
ImpressionValues:
  Dimensions:
    ImpressionValues.hitId (number)
    ImpressionValues.trackingTypeId (number)
    ImpressionValues.trackingTypeValueId (number)
ImpressionTrackingTypes:
  Dimensions:
    ImpressionTrackingTypes.id (number)
    ImpressionTrackingTypes.queryStringKey (string)
ImpressionTrackingTypeValues:
  Dimensions:
    ImpressionTrackingTypeValues.id (number)
    ImpressionTrackingTypeValues.value (string)
Month:
  Dimensions:
    Month.label (string)
MonthLongName:
  Dimensions:
    MonthLongName.label (string)
Quarter:
  Dimensions:
    Quarter.label (string)
RecordMetadata:
  Dimensions:
    RecordMetadata.aprimoContentUsage (string)
    RecordMetadata.keywords (string)
    RecordMetadata.smartTags (string)
    RecordMetadata.title (string)
Records:
  Dimensions:
    Records.fileCount (number)
    Records.createUser (string)
    Records.createDate (time)
    Records.lastModifiedUser (string)
    Records.lastModifiedDate (time)
    Records.contentType (string)
    Records.parentRecordId (string)
Spaces:
  Dimensions:
    Spaces.name (string)
Users:
  Dimensions:
    Users.active (number)
    Users.firstName (string)
    Users.lastName (string)
    Users.middleName (string)
    Users.emailAddress (string)
    Users.loginId (string)
    Users.company (string)
    Users.department (string)
    Users.employeeNumber (string)
    Users.costCenter (string)
    Users.departmentCode (string)
    Users.altUserId (string)
Views:
  Measures:
    Views.count (count)
  Dimensions:
    Views.viewDate (time)
    Views.dateDimensionId (number)
    Views.userId (number)
    Views.recordId (string)
    Views.spaceId (string)
    Views.collectionId (string)
    Views.hasNoContext (boolean)
    Views.hasSpaceContext (boolean)
    Views.hasCollectionContext (boolean)
Weekday:
  Dimensions:
    Weekday.label (string)
WeekdayLongName:
  Dimensions:
    WeekdayLongName.label (string)
ZeroDownloadRecords:
  Measures:
    ZeroDownloadRecords.count (count)
  Dimensions:
    ZeroDownloadRecords.fileCount (number)
    ZeroDownloadRecords.createUser (string)
    ZeroDownloadRecords.createDate (time)
    ZeroDownloadRecords.lastModifiedUser (string)
    ZeroDownloadRecords.lastModifiedDate (time)
    ZeroDownloadRecords.contentType (string)
    ZeroDownloadRecords.parentRecordId (string)
ZeroViewRecords:
  Measures:
    ZeroViewRecords.count (count)
  Dimensions:
    ZeroViewRecords.fileCount (number)
    ZeroViewRecords.createUser (string)
    ZeroViewRecords.createDate (time)
    ZeroViewRecords.lastModifiedUser (string)
    ZeroViewRecords.lastModifiedDate (time)
    ZeroViewRecords.contentType (string)
    ZeroViewRecords.parentRecordId (string)

POSTMAN Collection

This POSTMAN collection contains samples of all of the example requests that are outlines in the following sections.

Analytics API Examples.postman_collection

Examples - Downloads

 

Downloads

  • Overall Downloads
{
   "measure":["Downloads.count"]
}
  • Total Number of Downloads with Date Range
{
   "measure":["Downloads.count"],
   "filters":[{
      "member": "Downloads.downloadDate",
      "operator": "inDateRange",
      "values": ["YYYY-MM-DD","YYYY-MM-DD"]}
]}

 

  • Total Number of Downloads by Date Dimension
{
   "measures": ["Downloads.count"],
   "filters": [{
      "member": "Quarter.label",
      "operator": "equals",
      "values": ["Q2"]
   },
   {
      "member": "DateDimension.year",
      "operator": "equals",
      "values": ["2022"]
   }]
}

 

Downloads by Asset

  • Total Number of Downloads by Asset (All Assets)
{
   "measures": ["Downloads.count"],
   "dimensions": ["Downloads.recordId"]
}
  • Total Number of Downloads by Asset (All Assets) within Date Range
{
   "measures": ["Downloads.count"],
   "dimensions": ["Downloads.recordId"],
   "filters": [{
      "member": "Downloads.downloadDate",
      "operator": "inDateRange",
      "values": ["2022-05-01","2022-05-06"]
   }]
}
  • Total Number of Downloads by Asset (Specific Asset)
{
   "measures": ["Downloads.count"],
   "dimensions": ["Downloads.recordId"],
   "filters": [{
      "member": "Downloads.recordId",
      "operator": "equals",
      "values": ["86EE478A-1930-4F74-B87C-AE760108473A"]
   }]
}
  • Total Number of Downloads by Asset Title (Specific Asset)
{
   "measures": ["Downloads.count"],
   "dimensions": ["RecordMetadata.title","Downloads.recordId"],
   "filters": [{
      "member": "RecordMetadata.title",
      "operator": "equals",
      "values": ["Airplane"]
   }]
}

Downloads By User

  • Total Number of Downloads by User (All Users)
{
   "measures": ["Downloads.count"],
   "dimensions": ["Users.lastName", "Users.firstName", "Users.loginId"]
}
  • Total Number of Downloads by User (Specific User, by Name)
{
   "measures": ["Downloads.count"],
   "dimensions": ["Users.lastName", "Users.firstName", "Users.loginId"],
   "filters": [{
      "member": "Users.lastName",
      "operator": "equals",
      "values": ["Reeves"]
   },
   {
      "member": "Users.firstName",
      "operator": "contains",
      "values": ["A"]
   }]
}

Downloads By Group

  • Total Number of Downloads by Group (All Groups, may double count because a user may belong to more than one group)
{
    "measures": ["Downloads.count"],
    "dimensions": ["Groups.name", "Groups.loginId"]
}  
  • Total Number of Downloads by Group (Specific Group, by Login ID)
{
    "measures": ["Downloads.count"],
    "dimensions": ["Groups.name", "Groups.loginId"],
    "filters": [{
        "member": "Groups.loginId",
        "operator": "equals",
        "values": ["GROUP105"]
    }]
} 

Downloads By Direct Classification

  • Total Number of Downloads by Direct Classification (All Classifications, may double count because an asset may be associated to multiple classifications)
{
    "measures": ["Downloads.count"],
    "dimensions": ["Classifications.name"]
}  
  • Total Number of Downloads by Direct Classification (Specific Classification, by Parent ID)
{
    "measures": ["Downloads.count"],
    "dimensions": ["Classifications.classificationId","Classifications.name","Classifications.parentClassificationId"],
    "filters": [{
        "member": "Classifications.parentClassificationId",
        "operator": "equals",
        "values": ["A4FFE32F-C640-45B7-86A8-AE7500DF6EBA"]
    }]
} 

Downloads with Crops

  • Total Number of Downloads with Crops
{
    "measures": ["Downloads.count"],
    "filters": [{
        "member": "Downloads.renditionType",
        "operator": "equals",
        "values": ["Crop"]
    }]
}  OR {
    "measures": ["Downloads.count"],
    "filters": [{
        "member": "Downloads.cropType",
        "operator": "set"
    }]
}
  • Total Number of Downloads with Trims
{
    "measures": ["Downloads.count"],
    "filters": [{
        "member": "Downloads.renditionType",
        "operator": "equals",
        "values": ["Trim"]
    }]
}    OR {
    "measures": ["Downloads.count"],
    "filters": [{
        "member": "Downloads.trimDuration",
        "operator": "set"
    }]
}

Downloads by Rendition Type

  • Total Number of Downloads by Rendition Type
{
    "measures": ["Downloads.count"],
    "dimensions": ["Downloads.renditionType"]
}

Assets with Zero Downloads

  • Show assets that have not been downloaded
{
    "measures": ["ZeroDownloadRecords.count"],
    "dimensions": ["ZeroDownloadRecords.recordId"]
}

Examples - Views

Overall Views

  • Total Number of Views
{
    "measures": ["Views.count"]
} 
  • Total Number of Views within Date Range
{
    "measures": ["Views.count"],
    "filters": [{
        "member": "Views.viewDate",
        "operator": "inDateRange",
        "values": ["2022-05-10","2022-05-11"]
    }]
}
  • Total Number of Views by Date Dimension
{
    "measures": ["Views.count"],
    "filters": [{
        "member": "Month.label",
        "operator": "equals",
        "values": ["May"]
    }]
} 
  • Total Number of Views broken down by those that came in by space, collection or no context
{
    "measures": ["Views.count"],
    "dimensions": ["Views.hasNoContext", "Views.hasSpaceContext", "Views.hasCollectionContext"]
}

View by Asset

  • Total Number of Views by Asset (All Assets)
{
    "measures": ["Views.count"],
    "dimensions": ["Views.recordId"]
}  
  • Total Number of Views (All Assets) after a specific date
{
    "measures": ["Views.count"],
    "dimensions": ["Views.recordId"],
    "filters": [{
        "member": "Views.viewDate",
        "operator": "gt",
        "values": ["2022-05-14"]
    }]
}  
  • Total Number of Views by Asset (Specific Asset)
{
    "measures": ["Views.count"],
    "dimensions": ["Views.recordId"],
    "filters": [{
        "member": "Views.recordId",
        "operator": "equals",
        "values": ["A6A65062-16AB-4E52-B15A-AE6D00AE2801"]
    }]
}

View by User

  • Total Number of Views by User (All Users), broken out by Space and Collection names
{
    "measures": ["Views.count"],
    "dimensions": ["Users.lastName", "Users.firstName", "Users.loginId", "Spaces.name", "Collections.name"]
} 
  • Total Number of Views by User (Specific User, by partial Last Name)
{
    "measures": ["Views.count"],
    "dimensions": ["Users.lastName", "Users.firstName", "Users.loginId"],
    "filters": [
    {
        "member": "Users.lastName",
        "operator": "contains",
        "values": ["A"]
    }]
} 

View by Space

  • Total Number of View by Space (All Spaces)
{    
    "measures": ["Views.count"],
    "dimensions": ["Spaces.name", "Spaces.spaceId"],
    "order": {
        "Spaces.name": "asc",
        "Views.count": "desc"
    }  
  • Total Number of View by Space (Specific Space, by Name)
{
    "measures": ["Views.count"],
    "dimensions": ["Spaces.name", "Spaces.spaceId"],
    "filters": [{
        "member": "Spaces.name",
        "operator": "equals",
        "values": ["Space 1", "Space 3"]
    }]
}

Views by Collection

  • Total Number of View by Collection (All Collections)
{
    "measures": ["Views.count"],
    "dimensions": ["Collections.name", "Collections.collectionId"]
} 
  • Total Number of View by Collection (with number of assets >= 1)
{
    "measures": ["Views.count"],
    "dimensions": ["Collections.name", "Collections.collectionId"],
    "filters": [{
        "member": "Collections.numberOfAssets",
        "operator": "gte",
        "values": ["1"]
    }]
} 

Views by Direct Classification

  • Total Number of Views by Direct Classification (All Classifications)
{
    "measures": ["Views.count"],
    "dimensions": ["Classifications.name", "Classifications.identifier"]
} 
  • Total Number of Views by Direct Classification – Top-Level Only (no parent Classification)
{
    "measures": ["Views.count"],
    "dimensions": ["Classifications.name", "Classifications.identifier"],
    "filters": [{
        "member": "Classifications.parentClassificationId",
        "operator": "notSet"
    }]
}

Views with Multiple Filter Criteria

  • Total Number of Views by Asset that occurred via “Space 1” or “Space 2” by users jsmith or tjones in Q2 2022.
{
    "measures": ["Views.count"],
    "dimensions": ["Views.recordId"],
    "filters": [{
        "member": "Spaces.name",
        "operator": "equals",
        "values": ["Space 1", "Space 2"]
    },
    {
        "member": "Users.loginId",
        "operator": "equals",
        "values": ["jsmith", "tjones"]
    },
    {
        "member": "Quarter.label",
        "operator": "equals",
        "values": ["Q2"]
    },
    {
        "member": "DateDimension.year",
        "operator": "equals",
        "values": ["2022"]
    }]
} 

Zero Views

  • Show assets that have not been viewed
{
    "measures": ["ZeroViewRecords.count"],
    "dimensions": ["ZeroViewRecords.recordId"]
}

Examples - Content Engagement (Combined Views and Downloads)

Overall Views and Downloads

  • Show total view and download counts per asset
{
    "measures": ["ContentEngagement.downloadsCount","ContentEngagement.viewsCount"],
    "dimensions": ["ContentEngagement.recordId"]
}
  • Show total view and download counts per asset with asset title
{
    "measures": ["ContentEngagement.downloadsCount","ContentEngagement.viewsCount"],
    "dimensions": ["ContentEngagement.recordId","RecordMetadata.title"]
}