View Data by Week
Retrieves aggregated view data organized by week for the authenticated creator's content.
Endpoint
GET /api/view-data/week
Authentication
Authentication is required. The user must have a creator role.
Query Parameters
None
Response
Success Response
Code: 200 OK
Content:
[
{
"date": "06/07/2022",
"count": 0
},
{
"date": "06/13/2022",
"count": 1
}
]
The response is an array of objects, each containing:
date: The start date of the week in MM/DD/YYYY formatcount: The number of views recorded during that week
Error Response
Code: 400 Bad Request
Content: {error}
Notes
- This endpoint returns view data for all content owned by the authenticated creator
- The data is aggregated by week to provide a time-series view of engagement
- Weeks typically start on Monday and end on Sunday
- The response includes a series of consecutive weeks, even those with zero views
- This endpoint is commonly used for generating trend charts in creator dashboards
Example
curl -X GET "https://api.tribesocial.io/api/view-data/week" \
-H "Authorization: Bearer YOUR_AUTH_TOKEN" \
-H "Content-Type: application/json"