How do I access and use Viewtracker's public API?


Open API documentation

https://viewtracker.aws.bitvoodoo.cloud/api-doc

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

Available endpoints

  • content views: returns views for specific content. Note: You must have permission to access this content.

    1 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 that take place within a space)

    1 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; see Access Permissions.

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

     

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

Authentication

This section explains how to allow REST clients to authenticate themselves using basic authentication with an Atlassian account username and 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:

1 2 3 4 5 curl -D- \ -X GET \ -H "Authorization: Basic <your_encoded_string>" \ -H "Content-Type: application/json" \ "https://viewtracker.aws.bitvoodoo.cloud/api/report/contents/<content_id>/visits?baseUrl=<confluence_instance_base_url>"

The above cURL command will not work as shown. You need to replace <your_encoded_string>, <content_id> and <confluence_instance_base_url> with your authorization credentials encoded string, the appropriate content’s id and your instance’s base URL before running it in the terminal.

 

Space views example:

1 2 3 4 5 curl -D- \ -X GET \ -H "Authorization: Basic <your_encoded_string>" \ -H "Content-Type: application/json" \ "https://viewtracker.aws.bitvoodoo.cloud/api/report/spaces/<space_key>/visits?baseUrl=<confluence_instance_base_url>"

The above cURL command will not work as shown. You need to replace <your_encoded_string>, <space_key> and <confluence_instance_base_url> with your authorization credentials encoded string, the respective space’s key and your instance’s base URL before running it in the terminal.

 

Searches example:

1 2 3 4 5 curl -D- \ -X GET \ -H "Authorization: Basic <your_encoded_string>" \ -H "Content-Type: application/json" \ "<viewtracker_app_base_url>/api/report/searches?baseUrl=<confluence_instance_base_url>"

The above cURL command will not work as shown. You need to replace <your_encoded_string> and <confluence_instance_base_url> with your authorization credentials encoded string and your instance’s base URL before running it in the terminal.