SharePoint Vitals API

SharePoint Vitals API

SharePoint Vitals API

SharePoint Vitals brings all the user activity data you could ever want to your fingertips. Now you can access your analytics data through a REST API.

For more information about the client app that captures analytics data, visit www.sharepointvitals.com

The dashboard for seeing the aggregated data and scheduling reports can be found here: www.spvitals.com


Version 1.0

This version of the API has had an upgrade to the security layer. Please see the necessary guides to find the changes.

Executive Summary:

Instead of sending your customer code (license key) through the URL parameters, this detail must go through the headers. You will also need to include your API key. Navigate to https://www.spvitals.com/PowerBI to generate this API key.


Version 2.0

Overview

Get trend reports or summaries over a selected date range or get a live-stream for a relative period.

Error Codes

Status CodeDescription
401Unauthorised access if there is a problem verifying your access keys.
400Problem exists with a parameter.
500Exceptions occuring with the API itself.

Special Parameters

{type}

NameDescription
summaryTotal number of views per resource for the selected period.
trendA report showing the number of records as well as the number of total views per day over the selected period.
auditA combination report of the trend report including the summary report per day.

{report}

  • activeusers
  • pagehits
  • visitedsites
  • pagehitsperuser
  • userspersite
  • documentspersite
  • documentsperuser
  • videoreport
  • userhistory
  • pageclicks
  • searchterms
  • devices
  • devicesperuser
  • browsers
  • browsersperuser
  • siteaccesshistory
  • heatmap

Authentication

Generate an API key through the SharePoint Vitals dashboard and include it with your existing license key in the request header. Navigate to https://www.spvitals.com/PowerBI to generate an API key.

KeyValue
X-SPVITALS-CUSTOMERxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
X-SPVITALS-POWERBI-KEYxxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx

Absolute Period

Enter a custom date range between 2 points in time.

api/v2/sharepoint/{type}/{report}?parameters [GET]

  • Request Parameters
NameValueDescription
fromDateDATEThe date to select records from. (default is today)
toDateDATEThe date to select records to. (default is today)
topNUMBERReturn a limited number of records. For example: top 15 active users. The default is (0) to fetch all records without limit.
skipNUMBERUse this to page through large volumes of records.
usersTEXTFilter the request by a specific user (username in the form user@domain.com). Multiple users can be separated by a comma (,)
sitesTEXTFilter the request by a specific site. Multiple sites can be separated by a comma (,)
filterTEXTSome reports offer filtering specific to the report. For example: Devices, Browsers or Document
orderByCountBOOLEANSort the records by their count value. Otherwise sort by page load time.
orderDescendingBOOLEANSort records by the largest value first.

Example CURL Request

curl -X GET \
  'https://www.spvitals.com/api/v2/sharepoint/trend/userspersite?top=25&skip=0&fromDate=2019-01-01&toDate=2019-01-31&users=&sites=&filter=&orderByCount=true&orderDescending=true' \
  -H 'X-SPVITALS-CUSTOMER: 00000000-0000-0000-0000-000000000000' \
  -H 'X-SPVITALS-POWERBI-KEY: 00000000-0000-0000-0000-000000000000' \

Example JavaScript (ajax) Request

$.ajax({
  "async": true,
  "crossDomain": true,
  "url": "https://www.spvitals.com/api/v2/sharepoint/trend/userspersite?top=25&skip=0&fromDate=2019-01-01&toDate=2019-01-31&users=&sites=&filter=&orderByCount=true&orderDescending=true",
  "method": "GET",
  "headers": {
    "X-SPVITALS-CUSTOMER": "00000000-0000-0000-0000-000000000000",
    "X-SPVITALS-POWERBI-KEY": "00000000-0000-0000-0000-000000000000"
  }
});

Example Responses

  • Summary Report Response 200 (application/json)

      {
          "value": [
              {
                  "user": "maddison.francis@testco.com",
                  "displayName": "Maddison Francis",
                  "count": 205,
                  "averagePageLoadTime": 0
              },
              {
                  "user": "ashton.sutton@testco.com",
                  "displayName": "Ashton Sutton",
                  "count": 189,
                  "averagePageLoadTime": 0
              },
              {
                  "user": "bruno.edwards@testco.com",
                  "displayName": "Bruno Edwards",
                  "count": 149,
                  "averagePageLoadTime": 0
              }
          ]
      }
    
  • Trend Report Response 200 (application/json)

      {
          "value": [
              {
                  "date": "2019-04-01",
                  "recordTally": 31,
                  "totalCount": 733,
                  "summaryData": null
              },
              {
                  "date": "2019-04-02",
                  "recordTally": 29,
                  "totalCount": 679,
                  "summaryData": null
              },
              {
                  "date": "2019-04-03",
                  "recordTally": 0,
                  "totalCount": 0,
                  "summaryData": null
              }
          ]
      }
    
  • Audit Report Response 200 (application/json)

      {
          "value": [
              {
                  "date": "2019-04-01",
                  "recordTally": 3,
                  "totalCount": 733,
                  "summaryData": 
                      {
                          "user": "maddison.francis@testco.com",
                          "displayName": "Maddison Francis",
                          "count": 205,
                          "averagePageLoadTime": 0
                      },
                      {
                          "user": "ashton.sutton@testco.com",
                          "displayName": "Ashton Sutton",
                          "count": 189,
                          "averagePageLoadTime": 0
                      },
                      {
                          "user": "bruno.edwards@testco.com",
                          "displayName": "Bruno Edwards",
                          "count": 339,
                          "averagePageLoadTime": 0
                      }
                  ]
              },
              {
                  "date": "2019-04-02",
                  "recordTally": 3,
                  "totalCount": 679,
                  "summaryData": 
                      {
                          "user": "maddison.francis@testco.com",
                          "displayName": "Maddison Francis",
                          "count": 205,
                          "averagePageLoadTime": 0
                      },
                      {
                          "user": "ashton.sutton@testco.com",
                          "displayName": "Ashton Sutton",
                          "count": 189,
                          "averagePageLoadTime": 0
                      },
                      {
                          "user": "bruno.edwards@testco.com",
                          "displayName": "Bruno Edwards",
                          "count": 285,
                          "averagePageLoadTime": 0
                      }
                  ]
              },
              {
                  "date": "2019-04-03",
                  "recordTally": 3,
                  "totalCount": 543,
                  "summaryData": 
                      {
                          "user": "maddison.francis@testco.com",
                          "displayName": "Maddison Francis",
                          "count": 205,
                          "averagePageLoadTime": 0
                      },
                      {
                          "user": "ashton.sutton@testco.com",
                          "displayName": "Ashton Sutton",
                          "count": 189,
                          "averagePageLoadTime": 0
                      },
                      {
                          "user": "bruno.edwards@testco.com",
                          "displayName": "Bruno Edwards",
                          "count": 149,
                          "averagePageLoadTime": 0
                      }
                  ]
              }
          ]
      }
    • Related Articles

    • I need help installing SharePoint Vitals

      SharePoint Vitals is a sandboxed solution that must be activated on each site collection you wish to monitor. For help installing SharePoint Vitals, please contact us for assistance.
    • How do I install SharePoint Vitals?

      Anyone with SharePoint Site Collection Administration rights can easily install SharePoint Vitals, using the unique key provided on download or purchase. During the installation process, a sandbox code Windows SharePoint file (WSP), which is ...
    • What is the "app@sharepoint" SharePoint Online user?

      If you're seeing a SharePoint Online user with the name "app@sharepoint," that is a built-in Microsoft entry used for automation. Microsoft shared the following with us regarding the app.sharepoint account: - Account user@SharePoint is a system ...
    • How does SharePoint Vitals communicate with my cloud environment?

      Once the SharePoint sandbox code is activated on a site collection, a hidden web part is placed on every page in the collection. This web part contains two lines of code that contact SharePoint Vitals in Azure and start the transfer of requested ...
    • How does the solution affect SharePoint performance?

      SharePoint Vitals doesn't affect SharePoint's performance at all.