Page views
GET
/api/v1/sites/{id}/views
const url = 'http://localhost:3000/api/v1/sites/example/views';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url http://localhost:3000/api/v1/sites/example/views \ --header 'Authorization: Bearer <token>'How often its pages were read over the last 30 days, per brand and page, most read first. Asset downloads aren’t counted here.
Scope: write.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string
Portal id
Responses
Section titled “Responses”Views
Media typeapplication/json
object
data
required
object
days
required
How far back
integer
pages
required
Most read first; a page shown counts, not an error, a lock or a redirect
Array<object>
object
brand
required
object
slug
required
string
name
required
string
page
required
The page’s slug when it was read
string
views
required
integer
Examplegenerated
{ "data": { "days": 1, "pages": [ { "brand": { "slug": "example", "name": "example" }, "page": "example", "views": 1 } ] }}default
Section titled “default”An error
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
detail
Examplegenerated
{ "error": { "code": "example", "message": "example", "detail": "example" }}