|DataResponse, array{}> * * 200: Account details returned * 404: Account not found */ #[NoAdminRequired] #[ApiRoute(verb: 'GET', url: '/v1/{userId}', root: '/hovercard')] public function getUser(string $userId): DataResponse { $contact = $this->manager->findOne($this->userSession->getUser(), IShare::TYPE_USER, $userId); if (!$contact) { return new DataResponse([], Http::STATUS_NOT_FOUND); } $data = $contact->jsonSerialize(); $actions = $data['actions']; if ($data['topAction']) { array_unshift($actions, $data['topAction']); } /** @var CoreContactsAction[] $actions */ return new DataResponse([ 'userId' => $userId, 'displayName' => $contact->getFullName(), 'actions' => $actions, ]); } }