Report APIs

1. Overview

This page contains the APIs for retrieving the reports available in Passport. Here are the APIs:

2. Generate Daily Active Users Report

This report retrieves the number of daily active users for a given application or across all applications. You must specify a date range for the report.

2.1. Request

Generates the daily active users report

URI

GET /api/report/daily-active-users?start={start}&end={end}&applicationId={applicationId}

Table 1. Request Parameters

applicationId [UUID] Optional

A specific application to query for. If not provided a "Global" (across all applications) daily active users report will be returned.

end [Long] Required

The end of the query range. This is an instant but it is truncated to days in the report timezone (which is set in the system settings).

start [Long] Required

The start of the query range. This is an instant but it is truncated to days in the report timezone (which is set in the system settings).

2.2. Response

The response for this API contains the generated daily active users report.

Table 2. Response Codes
Code Description

200

The request was successful. The response will contain a JSON body.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

402

Your license has expired. The response will be empty. Contact sales@inversoft.com for assistance.

404

The object you requested doesn’t exist. The response will be empty.

500

There was an internal error. A stack trace is provided and logged in the Passport log files. The response will be empty.

Table 3. Response Body

dailyActiveUsers Array

The list of daily active users counts.

dailyActiveUsers[x].interval Integer

The interval for this count. The interval values for the daily active users report are the number of days since Epoch UTC shifted to the report timezone.

dailyActiveUsers[x].count Integer

The number of daily active users for this count.

total Integer

The total (sum) of each count across the query range.

Example Response JSON
{
  "total": 30,
  "dailyActiveUsers": [
    {
      "interval": 16739,
      "count": 10
    },
    {
      "interval": 16740,
      "count": 10
    },
    {
      "interval": 16741,
      "count": 10
    }
  ]
}

3. Generate Login Report

This report retrieves the number of logins for a given application or across all applications. You must specify a date range for the report. The report is always generated in hours. if you want to calculate daily logins, you’ll need to roll up the results in the response.

3.1. Request

Generates the logins report

URI

GET /api/report/login?start={start}&end={end}&applicationId={applicationId}

Table 4. Request Parameters

applicationId [UUID] Optional

A specific application to query for. If not provided a "Global" (across all applications) logins report will be returned.

end [Long] Required

The end of the query range. This is an instant but it is truncated to hours in the report timezone (which is set in the system settings).

start [Long] Required

The start of the query range. This is an instant but it is truncated to hours in the report timezone (which is set in the system settings).

3.2. Response

The response for this API contains the generated logins report.

Table 5. Response Codes
Code Description

200

The request was successful. The response will contain a JSON body.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

402

Your license has expired. The response will be empty. Contact sales@inversoft.com for assistance.

404

The object you requested doesn’t exist. The response will be empty.

500

There was an internal error. A stack trace is provided and logged in the Passport log files. The response will be empty.

Table 6. Response Body

hourlyCounts Array

The list of logins counts.

hourlyCounts[x].interval Integer

The interval for this count. The interval values for the logins report are the number of hours since Epoch UTC shifted to the report timezone.

hourlyCounts[x].count Integer

The number of logins for this count.

total Integer

The total (sum) of each count across the query range.

Example Response JSON
{
  "total": 100,
  "hourlyCounts": [
    {
      "interval": 401824,
      "count": 60
    },
    {
      "interval": 401825,
      "count": 40
    }
  ]
}

4. Generate Monthly Active Users Report

This report retrieves the number of monthly active users for a given application or across all applications. You must specify a date range for the report. The report is always generated using months as the interval.

4.1. Request

Generates the monthly active users report

URI

GET /api/report/monthly-active-users?start={start}&end={end}&applicationId={applicationId}

Table 7. Request Parameters

applicationId [UUID] Optional

A specific application to query for. If not provided a "Global" (across all applications) monthly active users report will be returned.

end [Long] Required

The end of the query range. This is an instant but it is truncated to months in the report timezone (which is set in the system settings).

start [Long] Required

The start of the query range. This is an instant but it is truncated to months in the report timezone (which is set in the system settings).

4.2. Response

The response for this API contains the generated monthly active users report.

Table 8. Response Codes
Code Description

200

The request was successful. The response will contain a JSON body.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

402

Your license has expired. The response will be empty. Contact sales@inversoft.com for assistance.

404

The object you requested doesn’t exist. The response will be empty.

500

There was an internal error. A stack trace is provided and logged in the Passport log files. The response will be empty.

Table 9. Response Body

monthlyActiveUsers Array

The list of monthly active users counts.

monthlyActiveUsers[x].interval Integer

The interval for this count. The interval values for the monthly active users report are the number of months since Epoch UTC shifted to the report timezone.

monthlyActiveUsers[x].count Integer

The number of monthly active users for this count.

total Integer

The total (sum) of each count across the query range.

Example Response JSON
{
  "total": 39,
  "monthlyActiveUsers": [
    {
      "count": 10,
      "interval": 543
    },
    {
      "count": 10,
      "interval": 544
    },
    {
      "count": 10,
      "interval": 545
    },
    {
      "count": 9,
      "interval": 546
    }
  ]
}

5. Generate Registration Report

This report retrieves the number of registrations for a given application or across all applications. You must specify a date range for the report. The report is always generated in hours. if you want to calculate daily registrations, you’ll need to roll up the results in the response.

5.1. Request

Generates the registrations report

URI

GET /api/report/registration?start={start}&end={end}&applicationId={applicationId}

Table 10. Request Parameters

applicationId [UUID] Optional

A specific application to query for. If not provided a "Global" (across all applications) registrations report will be returned.

end [Long] Required

The end of the query range. This is an instant but it is truncated to hours in the report timezone (which is set in the system settings).

start [Long] Required

The start of the query range. This is an instant but it is truncated to hours in the report timezone (which is set in the system settings).

5.2. Response

The response for this API contains the generated registrations report.

Table 11. Response Codes
Code Description

200

The request was successful. The response will contain a JSON body.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

402

Your license has expired. The response will be empty. Contact sales@inversoft.com for assistance.

404

The object you requested doesn’t exist. The response will be empty.

500

There was an internal error. A stack trace is provided and logged in the Passport log files. The response will be empty.

Table 12. Response Body

hourlyCounts Array

The list of registrations counts.

hourlyCounts[x].interval Integer

The interval for this count. The interval values for the registrations report are the number of hours since Epoch UTC shifted to the report timezone.

hourlyCounts[x].count Integer

The number of registrations for this count.

total Integer

The total (sum) of each count across the query range.

Example Response JSON
{
  "total": 100,
  "hourlyCounts": [
    {
      "interval": 401824,
      "count": 60
    },
    {
      "interval": 401825,
      "count": 40
    }
  ]
}

6. Generate Totals Report

The Report Totals API is used to retrieve the number users currently registered and how many login requests have been serviced by Passport globally as well as broken down by each Application.

6.1. Request

Generates the Totals Report

URI

GET /api/report/totals

6.2. Response

The response for this API contains the generated totals report.

Table 13. Response Codes
Code Description

200

The request was successful. The response will contain a JSON body.

400

The request was invalid and/or malformed. The response will contain an Errors JSON Object with the specific errors.

401

You did not supply a valid Authorization header. The header was omitted or your API key was not valid. The response will be empty. See Authentication.

402

Your license has expired. The response will be empty. Contact sales@inversoft.com for assistance.

404

The object you requested doesn’t exist. The response will be empty.

500

There was an internal error. A stack trace is provided and logged in the Passport log files. The response will be empty.

Table 14. Response Body

applicationTotals Map<UUID,Object>

A map where the key is the Id of the Application and the value is an object that contains the totals for that Application.

applicationTotals[id].logins Integer

The total number of logins (all time) for the Application.

applicationTotals[id].registrations Integer

The current number of registrations for the Application. This doesn’t include registrations for user’s that have been deleted from Passport.

applicationTotals[id].totalRegistrations Integer

The total number of registrations (all time) for the Application.

globalRegistrations Integer

The current number of registered users. This value is incremented each time a new user is added to Passport, and this value is decremented when a user is deleted from Passport.

totalGlobalRegistrations Integer

The total number of registrations (all time). When a user is removed from Passport this number is not decremented.

Example Response JSON
{
  "applicationTotals": {
    "00000000-0000-0000-0000-000000000000": {
      "logins": 20,
      "registrations": 10,
      "totalRegistrations": 10
    },
    "00000000-0000-0000-0000-000000000001": {
      "logins": 20,
      "registrations": 10,
      "totalRegistrations": 10
    },
    "00000000-0000-0000-0000-000000000002": {
      "logins": 20,
      "registrations": 10,
      "totalRegistrations": 10
    },
    "00000000-0000-0000-0000-000000000003": {
      "logins": 20,
      "registrations": 10,
      "totalRegistrations": 10
    },
    "00000000-0000-0000-0000-000000000004": {
      "logins": 20,
      "registrations": 10,
      "totalRegistrations": 10
    }
  },
  "globalRegistrations": 10,
  "totalGlobalRegistrations": 10
}