Get the total number of views a piece of content has.
read:confluence-content.summary
read:analytics.content:confluence
Connect app scope required: READ
string
Requiredstring
Returns the total number of views for the content.
1
2
3
4
5
6
7
8
9
10
11
12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asUser().requestConfluence(route`/wiki/rest/api/analytics/content/{contentId}/views`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
{
"id": 15,
"count": 42
}
Get the total number of distinct viewers a piece of content has.
read:confluence-content.summary
read:analytics.content:confluence
Connect app scope required: READ
string
Requiredstring
Returns the total number of distinct viewers for the content.
1
2
3
4
5
6
7
8
9
10
11
12
// This sample uses Atlassian Forge
// https://developer.atlassian.com/platform/forge/
import api, { route } from "@forge/api";
const response = await api.asUser().requestConfluence(route`/wiki/rest/api/analytics/content/{contentId}/viewers`, {
headers: {
'Accept': 'application/json'
}
});
console.log(`Response: ${response.status} ${response.statusText}`);
console.log(await response.json());
1
2
3
4
{
"id": 15,
"count": 53
}
Rate this page: