, array{}> * * 200: A list of dashboard entries or an empty array */ #[NoAdminRequired] #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/dashboard/events', requirements: [ 'apiVersion' => '(v4)', ])] public function getDashboardEvents(): DataResponse { $userId = $this->userSession->getUser()?->getUID(); $entries = $this->service->getDashboardEvents($userId); return new DataResponse($entries); } /** * Get up to 3 events in the next 7 days * sorted by their start timestamp ascending * * Required capability: `mutual-calendar-events` * * @return DataResponse, array{}>|DataResponse * * 200: A list of dashboard entries or an empty array * 403: Room is not a 1 to 1 room, room is invalid, or user is not participant */ #[NoAdminRequired] #[RequireParticipant] #[ApiRoute(verb: 'GET', url: '/api/{apiVersion}/room/{token}/mutual-events', requirements: [ 'apiVersion' => '(v4)', 'token' => '[a-z0-9]{4,30}', ])] public function getMutualEvents(): DataResponse { $userId = $this->userSession->getUser()?->getUID(); try { $entries = $this->service->getMutualEvents($userId, $this->room); } catch (InvalidRoomException|ParticipantNotFoundException) { return new DataResponse(null, Http::STATUS_FORBIDDEN); } return new DataResponse($entries); } }