---
title: "RoomsByShareToken (Nextcloud)"
description: "itgen_ncl_roomsbysharetoken_plural"
language: en
source_language: en
translation_state: complete
canonical: https://documentation.invantive.eu/en/datamodels/nextcloud/Spreed.Spreed.RoomsByShareToken
original: https://documentation.invantive.eu/en/datamodels/nextcloud/Spreed.Spreed.RoomsByShareToken
updated: 2026-11-10T15:26:07Z
license: https://documentation.invantive.eu/en/
---

# RoomsByShareToken: Nextcloud itgen_ncl_roomsbysharetoken_plural

`read only` `REST`

- Catalog: `Spreed`
- Schema: `Spreed`
- Label: itgen_ncl_roomsbysharetoken_plural

Returns the token of the room associated to the file of the given share token
This is the counterpart of self::getRoomByFileId() for share tokens instead of file ids, although both return the same room token if the given file id and share token refer to the same file.
If there is no room associated to the file id of the given share token a new room is created; the new room is a public room associated with a "file" object with the file id of the given share token. Unlike normal rooms in which the owner is the user that created the room these are special rooms without owner (although self joined users with direct access to the file become persistent participants automatically when they join until they explicitly leave or no longer have access to the file).
In any case, to create or even get the token of the room, the file must be publicly shared (like a link share, for example); an error is returned otherwise.
Besides the token of the room this also returns the current user ID and display name, if any; this is needed by the Talk sidebar to know the actual current user, as the public share page uses the incognito mode and thus logged-in users as seen as guests.

Can only retrieve data.

## Summary

This is the counterpart of self::getRoomByFileId() for share tokens instead of file ids, although both return the same room token if the given file id and share token refer to the same file.
If there is no room associated to the file id of the given share token a new room is created; the new room is a public room associated with a "file" object with the file id of the given share token. Unlike normal rooms in which the owner is the user that created the room these are special rooms without owner (although self joined users with direct access to the file become persistent participants automatically when they join until they explicitly leave or no longer have access to the file).
In any case, to create or even get the token of the room, the file must be publicly shared (like a link share, for example); an error is returned otherwise.
Besides the token of the room this also returns the current user ID and display name, if any; this is needed by the Talk sidebar to know the actual current user, as the public share page uses the incognito mode and thus logged-in users as seen as guests.

## API Source

- Endpoint: `/ocs/v2.php/apps/spreed/api/{apiVersion}/publicshare/{shareToken}`
- Operation: `get /ocs/v2.php/apps/spreed/api/{apiVersion}/publicshare/{shareToken}`

## Performance Characteristics

| Characteristic | Value |
|---|---:|
| Average access latency (ms) | 305 |
| Full scan rows per minute | 18,900 |

The result can be cached on the client.

## Parameters

| Name | Data Type | Required | Default | Documentation |
|---|---|:---:|---|---|
| `apiVersion` | `` | [ ] | v1 | Values: v1. |
| `shareToken` | `` | [x] |  | Token of the file share |

## Table Columns

The columns of the table `RoomsByShareToken` are shown below. Each column has an SQL data type. A new non-null value must be provided for every required column at all times during insert and update.

| Name | Data Type | Label | Required | Marks | Documentation |
|---|---|---|:---:|---|---|
| `ocs_data_token` | `varchar2` | itgen_ncl_ocs_data_token | [ ] | filters on the platform, writable, `ocs.data.token` |  |
| `ocs_data_userDisplayName` | `varchar2` | itgen_ncl_ocs_data_userdisplayname | [ ] | filters on the platform, writable, `ocs.data.userDisplayName` |  |
| `ocs_data_userId` | `varchar2` | itgen_ncl_ocs_data_userid | [ ] | filters on the platform, writable, `ocs.data.userId` |  |
| `ocs_meta_itemsperpage` | `varchar2` | itgen_ncl_ocs_meta_itemsperpage | [ ] | filters on the platform, writable, `ocs.meta.itemsperpage` |  |
| `ocs_meta_message` | `varchar2` | itgen_ncl_ocs_meta_message | [ ] | filters on the platform, writable, `ocs.meta.message` |  |
| `ocs_meta_status` | `varchar2` | itgen_ncl_ocs_meta_status | [ ] | filters on the platform, writable, `ocs.meta.status` |  |
| `ocs_meta_statuscode` | `int64` | itgen_ncl_ocs_meta_statuscode | [ ] | filters on the platform, writable, `ocs.meta.statuscode` |  |
| `ocs_meta_totalitems` | `varchar2` | itgen_ncl_ocs_meta_totalitems | [ ] | filters on the platform, writable, `ocs.meta.totalitems` |  |

