> ## Documentation Index
> Fetch the complete documentation index at: https://developer.rocket.chat/llms.txt
> Use this file to discover all available pages before exploring further.
# Get User By Time of the Day
>
Retrieve users by hours at a particular time of the day in a week.
Permission required: `view-engagement-dashboard`
### Changelog
| Version | Description |
| ---------------- | ------------|
|3.1.0 | Added |
## OpenAPI
````json GET /api/v1/engagement-dashboard/users/users-by-time-of-the-day-in-a-week
{
"openapi": "3.0.0",
"info": {
"version": "1.0.0",
"title": "Statistics"
},
"servers": [
{
"url": "https://apiexplorer.support.rocket.chat"
}
],
"tags": [
{
"name": "Channels Engagement"
},
{
"name": "Messages Engagement"
},
{
"name": "Statistics"
},
{
"name": "Users Engagement"
}
],
"paths": {
"/api/v1/engagement-dashboard/users/users-by-time-of-the-day-in-a-week": {
"get": {
"tags": [
"Users Engagement"
],
"summary": "Get User By Time of the Day",
"description": "\n\nRetrieve users by hours at a particular time of the day in a week.\n\nPermission required: `view-engagement-dashboard` \n\n### Changelog\n| Version | Description | \n| ---------------- | ------------|\n|3.1.0 | Added |",
"operationId": "get-api-v1-engagement-dashboard-users-users-by-time-of-the-day-in-a-week",
"parameters": [
{
"$ref": "#/components/parameters/Auth-Token"
},
{
"$ref": "#/components/parameters/UserId"
},
{
"$ref": "#/components/parameters/start"
},
{
"$ref": "#/components/parameters/end"
}
],
"responses": {
"200": {
"description": "OK",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"week": {
"type": "array",
"items": {
"type": "object",
"properties": {
"users": {
"type": "integer"
},
"hour": {
"type": "integer"
},
"day": {
"type": "integer"
},
"month": {
"type": "integer"
},
"year": {
"type": "integer"
}
}
}
},
"success": {
"type": "boolean"
}
}
},
"examples": {
"Success Example": {
"value": {
"week": [
{
"users": 1,
"hour": 23,
"day": 2,
"month": 5,
"year": 2023
},
{
"users": 1,
"hour": 22,
"day": 2,
"month": 5,
"year": 2023
},
{
"users": 1,
"hour": 21,
"day": 2,
"month": 5,
"year": 2023
},
{
"users": 1,
"hour": 20,
"day": 2,
"month": 5,
"year": 2023
},
{
"users": 1,
"hour": 19,
"day": 2,
"month": 5,
"year": 2023
},
{
"users": 1,
"hour": 18,
"day": 2,
"month": 5,
"year": 2023
},
{
"users": 1,
"hour": 17,
"day": 2,
"month": 5,
"year": 2023
},
{
"users": 1,
"hour": 16,
"day": 2,
"month": 5,
"year": 2023
},
{
"users": 1,
"hour": 15,
"day": 2,
"month": 5,
"year": 2023
},
{
"users": 1,
"hour": 14,
"day": 2,
"month": 5,
"year": 2023
},
{
"users": 1,
"hour": 1,
"day": 1,
"month": 5,
"year": 2023
}
],
"success": true
}
}
}
}
}
},
"400": {
"$ref": "#/components/responses/keyError"
},
"401": {
"$ref": "#/components/responses/authorizationError"
},
"403": {
"$ref": "#/components/responses/forbiddenError"
}
}
}
}
},
"components": {
"parameters": {
"Auth-Token": {
"name": "X-Auth-Token",
"in": "header",
"description": "The token of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "RScctEHSmLGZGywfIhWyRpyofhKOiMoUIpimhvheU3f"
},
"UserId": {
"name": "X-User-Id",
"in": "header",
"description": "The user ID of the authenticated user.",
"required": true,
"schema": {
"type": "string"
},
"example": "rbAXPnMktTFbNpwtJ"
},
"start": {
"name": "start",
"in": "query",
"description": "The start date.",
"required": true,
"schema": {
"type": "string"
},
"example": "2023-10-29T14:48:00Z"
},
"end": {
"name": "end",
"in": "query",
"description": "The end date.",
"required": true,
"schema": {
"type": "string"
},
"example": "2023-11-05T14:48:00Z"
}
},
"responses": {
"keyError": {
"description": "Bad Request",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
}
},
"examples": {
"Missing key": {
"value": {
"success": false,
"error": "Match error: Missing key 'start'"
}
},
"Example 2": {
"value": {
"success": false,
"error": "Match error: Failed Match.Where validation in field start"
}
}
}
}
}
},
"authorizationError": {
"description": "Unauthorized",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
}
}
},
"examples": {
"Authorization Error": {
"value": {
"success": false,
"error": "You must be logged in to do this."
}
}
}
}
}
},
"forbiddenError": {
"description": "Forbidden",
"content": {
"application/json": {
"schema": {
"type": "object",
"properties": {
"success": {
"type": "boolean"
},
"error": {
"type": "string"
},
"errorType": {
"type": "string"
}
}
},
"examples": {
"Permission Error": {
"value": {
"success": false,
"error": "User does not have the permissions required for this action",
"errorType": "error-forbidden"
}
}
}
}
}
}
}
}
}
````