Skip to main content
Skip table of contents

Viewtracker API

How to access and use the public Viewtracker Cloud API.

General Information and Access

The Viewtracker data can be accessed via an API and used for other integrations.
This documentation is about the available endpoints and authentication in the Cloud API. 
For any other data related to your Confluence instance, use the Confluence Cloud API by Atlassian.

Access the API via Viewtracker - Interfaces and follow the instructions in the info box.

Open API documentation

API specification

The Viewtracker base URL is https://viewtracker.aws.bitvoodoo.cloud

Available endpoints

  • content views: returns views for specific content.

    CODE
    https://viewtracker.aws.bitvoodoo.cloud/api/v2/report/contents/{contentId}/visits
  • space views: returns views for a specific space.

    CODE
    https://viewtracker.aws.bitvoodoo.cloud/api/v2/report/spaces/{spaceKey}/visits
  • searches: returns searches globally.

    CODE
    https://viewtracker.aws.bitvoodoo.cloud/api/v2/report/searches

Old endpoints (will be discontinued as of 31.12.23)
  • content views: returns views for specific content. Note: You must have permission to access this content.

    CODE
    https://viewtracker.aws.bitvoodoo.cloud/api/report/contents/<content_id>/visits

  • space views: returns views for a specific space. Note: You must have permission to access this space.
    (includes views on pages, blog posts, and attachments within a space)

    CODE
    https://viewtracker.aws.bitvoodoo.cloud/api/report/spaces/<space_key>/visits?baseUrl=<confluence_instance_base_url>

  • searches: returns searches globally. Note: You must have “Global Access“ permissions.

    CODE
    https://viewtracker.aws.bitvoodoo.cloud/api/report/searches

    Read Access Permissions for information on how to grant access.

Authentication

Important Notice

We have introduced a new method for authenticating the Viewtracker API. The old method still listed below will be discontinued as of December 31, 2023.

Obtaining Viewtracker data from the above endpoints is only possible if authorization headers are sent with a valid token. The required token can be generated under the menu Interfaces in the Viewtracker menu.

Note

Authentication of an existing token will no longer work if it is deleted or a new token is generated. The existing API calls must be updated with the latest token in order to retrieve new data.

Old authentication method (will be discontinued as of 31.12.23)

(info) This section explains how REST clients can authenticate themselves using basic authentication with an Atlassian account username and an API token.

You can construct and send basic auth headers, including a base64-encoded string containing your Atlassian account email and API token.

To use basic auth headers, perform the following steps:

  1. Generate an API Token for your Atlassian Account: https://id.atlassian.com/manage/api-tokens

  2. Build a string of the form your_email@domain.com:your_user_api_token.

  3. You'll need to encode your authorization credentials to base64.
    There are online tools (i.e., https://www.base64encode.net/ ) that you can use to create your base64-encoded string.

    For example, your_email@domain.com:your_user_api_token base64 encoded is eW91cl9lbWFpbEBkb21haW4uY29tOnlvdXJfdXNlcl9hcGlfdG9rZW4=

  4. Supply an Authorization header with content Basic followed by the encoded string.
    Example: Authorization: Basic eW91cl9lbWFpbEBkb21haW4uY29tOnlvdXJfdXNlcl9hcGlfdG9rZW4=

Examples

Content views example:

CODE
curl -D- \
   -X GET \
   -H "Authorization: Bearer <your_token>" \
   "https://viewtracker.aws.bitvoodoo.cloud/api/v2/report/contents/{contentId}/visits"

The above cURL command will not work as shown. You need to replace <your_token> and <content_id> with the token generated in Viewtracker and the appropriate content’s id before running it in the terminal.

Space views example:

CODE
curl -D- \
   -X GET \
   -H "Authorization: Bearer <your_token>" \
   "https://viewtracker.aws.bitvoodoo.cloud/api/v2/report/spaces/{spaceKey}/visits"

The above cURL command will not work as shown. You need to replace <your_token> and <space_key> with the token generated in Viewtracker and the respective space’s key before running it in the terminal.

Searches example:

CODE
curl -D- \
   -X GET \
   -H "Authorization: Bearer <your_token>" \
   "https://viewtracker.aws.bitvoodoo.cloud/api/v2/report/searches"

The above cURL command will not work as shown. You need to replace <your_token> with the token generated in Viewtracker before running it in the terminal.

Explore

Use https://viewtracker.aws.bitvoodoo.cloud/swagger-ui/index.html to explore the mentioned endpoints and their response containing your Viewtracker data.

Proceed as follows for authorization:

  • Tap on “Authorize”

  • Enter your user token from the Interface page in the Viewtracker-Bearer-Auth value field

    and tap “Authorize”

  • Expand one of the listed endpoint descriptions and tab “Try it out”

  • Set the desired parameters and tap “Execute” to get the endpoint response with your data.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.