10 KiB
API v1 Documentation
Base endpoint is: /ocs/v2.php/apps/spreed/api/v1
Constants
Room types
1"one to one"2group3public
Participant types
1owner2moderator3user4guest5user following a public link
Room management
Creating a new room
-
Method:
POST -
Endpoint:
/room -
Data:
field type Description roomTypeint invitestring user id ( roomType = 1), group id (roomType = 2) -
Response:
-
Header:
200 OKwhen the "one to one" room already exists201 Createdwhen the room was created400 Bad Requestwhen an invalid room type was given401 Unauthorizedwhen the user is not logged in404 Not Foundwhen the user or group does not exist
-
Data:
field type Description tokenstring Token identifier of the room which is used for further interaction
-
Get user´s rooms
-
Method:
GET -
Endpoint:
/room -
Response:
-
Header:
200 OK401 Unauthorizedwhen the user is not logged in
-
Data: Array of rooms, each room has at least:
field type Description tokenstring Token identifier of the room which is used for further interaction typeint namestring Name of the room (can also be empty) displayNamestring nameif non empty, otherwise it falls back to a list of participantsparticipantTypeint Permissions level of the current user lastPingint Timestamp of the last ping of the current user (should be used for sorting) sessionIdstring '0'if not connected, otherwise a 512 character long string
-
Get single room (also for guests)
-
Method:
GET -
Endpoint:
/room/{token} -
Response:
-
Header:
200 OK404 Not FoundWhen the room could not be found for the participant
-
Data: See array definition in
Get user´s rooms
-
Rename a room
-
Method:
PUT -
Endpoint:
/room/{token} -
Data:
field type Description roomNamestring New name for the room (1-200 characters) -
Response:
- Header:
200 OK400 Bad RequestWhen the name is too long403 ForbiddenWhen the current user is not a moderator/owner404 Not FoundWhen the room could not be found for the participant405 Method Not AllowedWhen the room is a one to one room
- Header:
Delete a room
-
Method:
DELETE -
Endpoint:
/room/{token} -
Response:
- Header:
200 OK403 ForbiddenWhen the current user is not a moderator/owner404 Not FoundWhen the room could not be found for the participant
- Header:
Allow guests in a room (public room)
-
Method:
POST -
Endpoint:
/room/{token}/public -
Response:
- Header:
200 OK403 ForbiddenWhen the current user is not a moderator/owner404 Not FoundWhen the room could not be found for the participant
- Header:
Disallow guests in a room (group room)
-
Method:
DELETE -
Endpoint:
/room/{token}/public -
Response:
- Header:
200 OK403 ForbiddenWhen the current user is not a moderator/owner404 Not FoundWhen the room could not be found for the participant
- Header:
Set room password
-
Method:
PUT -
Endpoint:
/room/{token}/password -
Data:
field type Description passwordstring Set a new password for the room -
Response:
- Header:
200 OK403 ForbiddenWhen the current user is not a moderator/owner403 ForbiddenWhen the room is not a public room404 Not FoundWhen the room could not be found for the participant
- Header:
Participant management
Get list of participants in a room
-
Method:
GET -
Endpoint:
/room/{token}/participants -
Response:
-
Header:
200 OK404 Not FoundWhen the room could not be found for the participant
-
Data: Array of participants, each participant has at least:
field type Description userIdstring Is empty for guests displayNamestring Can be empty for guests participantTypeint Permissions level of the participant lastPingint Timestamp of the last ping of the user (should be used for sorting) sessionIdstring '0'if not connected, otherwise a 512 character long string
-
Add a participant to a room
-
Method:
POST -
Endpoint:
/room/{token}/participants -
Data:
field type Description newParticipantstring User to add -
Response:
-
Header:
200 OK403 ForbiddenWhen the current user is not a moderator/owner404 Not FoundWhen the room could not be found for the participant404 Not FoundWhen the user to add could not be found
-
Data:
field type Description typestring In case the room type changed, the new value is returned
-
Delete a participant from a room
-
Method:
DELETE -
Endpoint:
/room/{token}/participants -
Data:
field type Description participantstring User to remove -
Response:
- Header:
200 OK403 ForbiddenWhen the current user is not a moderator/owner403 ForbiddenWhen the participant to remove is an owner404 Not FoundWhen the room could not be found for the participant404 Not FoundWhen the participant to remove could not be found
- Header:
Remove yourself from a room
-
Method:
DELETE -
Endpoint:
/room/{token}/participants/self -
Response:
- Header:
200 OK404 Not FoundWhen the room could not be found for the participant
- Header:
Promote a user to a moderator
-
Method:
POST -
Endpoint:
/room/{token}/moderators -
Data:
field type Description participantstring User to promote -
Response:
- Header:
200 OK403 ForbiddenWhen the current user is not a moderator/owner403 ForbiddenWhen the participant to remove is an owner404 Not FoundWhen the room could not be found for the participant404 Not FoundWhen the participant to remove could not be found412 Precondition FailedWhen the participant to promote is not a normal user (type3)
- Header:
Demote a moderator to a user
-
Method:
DELETE -
Endpoint:
/room/{token}/moderators -
Data:
field type Description participantstring User to promote -
Response:
- Header:
200 OK403 ForbiddenWhen the current user is not a moderator/owner404 Not FoundWhen the room could not be found for the participant404 Not FoundWhen the participant to remove could not be found412 Precondition FailedWhen the participant to demote is not a moderator (type2)
- Header:
Call management
Get list of connected participants
-
Method:
GET -
Endpoint:
/call/{token} -
Response:
-
Header:
200 OK404 Not FoundWhen the room could not be found for the participant
-
Data: Array of participants, each participant has at least:
field type Description userIdstring Is empty for guests lastPingint Timestamp of the last ping of the user (should be used for sorting) sessionIdstring 512 character long string
-
Join a call
-
Method:
POST -
Endpoint:
/call/{token} -
Data:
field type Description passwordstring Optional: Password is only required for users which are of type 4or5and only when the room hashasPasswordset to true. -
Response:
-
Header:
200 OK403 ForbiddenWhen the password is required and didn't match404 Not FoundWhen the room could not be found for the participant
-
Data:
field type Description sessionIdstring 512 character long string
-
Send ping to keep the call alive
-
Method:
POST -
Endpoint:
/call/{token}/ping -
Response:
- Header:
200 OK404 Not FoundWhen the room could not be found for the participant
- Header:
Leave a call (but staying in the room for future calls)
-
Method:
DELETE -
Endpoint:
/call/{token} -
Response:
- Header:
200 OK404 Not FoundWhen the room could not be found for the participant
- Header:
Signaling
See the Draft in the wiki…