v58

latestOpenAPI 3.0.3agplraw.githubusercontent.com2026-08-01187461.6 MB
files_integration

Get the token of the room associated to the given file id

This is the counterpart of self::getRoomByShareToken() for file ids instead of share tokens, 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 given file id a new room is created; the new room is a public room associated with a "file" object with the given file id. 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 shared and the user must be the owner of a public share of the file (like a link share, for example) or have direct access to that file; an error is returned otherwise. A user has direct access to a file if they have access to it (or to an ancestor) through a user, group, circle or room share (but not through a link share, for example), or if they are the owner of such a file.

get/ocs/v2.php/apps/spreed/api/{apiVersion}/file/{fileId}

Path parameters

apiVersion'v1' required
fileIdstring required

ID of the file

Headers

OCS-APIRequestboolean required

Required to be true for the API request to pass

Response

Room token returned