REST API
This API is the primary way to access Page View Insights App remotely, whether you are exporting raw data, or or developing any other integration with external visualization platforms.
SEARCH
Search for page views based on given filter.
POST https://pageview-insights.view26.com/search
REQUEST
Header parameters
Body parameters
startAt
integer
default value : 0
maxResults
integer
default value : 100 max value:1000
filters
filter object
spaceKey
string
Confluence Space Key (not name)
actionType
string
Valid values:
- CREATED
- TRASHED
- VIEWED
- MODIFIED
actionTime
time filter object
duration
string (optional , overrides from/to values if provided)
Valid values:
- currentMonth
- lastMonth
- last30Days
from
Time - YYYY-MM-DD (optional if duration specified)
to
Time - YYYY-MM-DD (optional if duration specified)
Example
curl --request POST \
--header 'Token: <Token String>' \
--header 'Content-Type: application/json' \
--data '
{
"startAt" : 0,
"maxResults" : 10,
"filters": {
"spaceKey" : "",
"actionType" : "CREATED",
"actionTime" : {
"duration" : "last30Days",
"from": "",
"to" : ""
}
}
}' --url 'https://pageview-insights.view26.com/search'
RESPONSE
200 OK
The REST API uses pagination. When you make a request, the response will wrap the returned array of values in a JSON object with paging metadata, for example:
Where:
startAt - is the index of the first item returned in the page of results.
maxResults - is the maximum number of items that can be returned per page.
isLast - indicates whether the page returned is the last one.
data - Results
- header - column headers of data
- value - row values ( sorted based on descending (latest first) order of action time)
pageMap - mapping of Page ID to Page name.
userMap - mapping of User ID to User name.
Example Response
{
"startAt": 0,
"maxResults": 1,
"isLast": false,
"data" : {
"header": [
"Action Type",
"Action Time",
"User Key",
"Page ID",
"Space Key"
],
"values": [
[
"viewed",
"2018-06-05T13:21:14+05:30",
"0",
"7274553",
"TEST"
]
],
"pageMap": {
"7274553": "Reporting for Service Desk"
},
"userMap": {
"0": "Anonymous"
}
}
}
Pseudo Code for Pagination
// Pseudo Code
startAt = 0 maxResults = 50 // Value : 1 to 1000; default : 100 isLast = false for (!isLast) { // Fetch page response = getPage(startAt, maxResults, filter) maxResults = response.MaxResults isLast = response.IsLast startAt = startAt + maxResults // Process page }
401 Unauthorized
409 Conflict
415 Unsupported Media Format
Returns a full JSON representation of a page view data.
Example Response
{
"description": "<error description>",
"error": "error"
}