Confirmed users
632
edits
Line 125: | Line 125: | ||
=== GET /rooms/{token} === | === GET /rooms/{token} === | ||
This endpoint is used to retrieve information about a single room, including a list of room participants. | |||
Because providing this information to users who are not in the room would be surprising for those in the room, we only allow the room owner and users in the room to access this method. Room owners are authenticated via their HAWK credentials, while room participants are authenticated via the sessionToken bearer token provided to them when they joined the room. | |||
GET /rooms/3jKS_Els9IU HTTP/1.1 | |||
Accept: */* | |||
Accept-Encoding: gzip, deflate | |||
'''Authorization: <elided>''' | |||
Host: localhost:5000 | |||
* For a desktop client user, the "Authorization" header field is populated with the HAWK token (using a scheme of "Hawk"), just like it is for other requests. | |||
* For the standalone client, the "Authorization" header field is encoded using [http://tools.ietf.org/html/rfc1945#section-11.1 Basic authentication]. The user ID portion is the sessionToken provided to the user when they joined the room, and the password is blank. | |||
HTTP/1.1 200 OK | |||
Connection: keep-alive | |||
Content-Length: 30 | |||
Content-Type: application/json; charset=utf-8 | |||
Date: Wed, 16 Jul 2014 13:23:04 GMT | |||
ETag: W/"1e-2896316483" | |||
Timestamp: 1405516984 | |||
{ | |||
"roomToken": "3jKS_Els9IU", | |||
"context": { | |||
"value": "PWjHj89HBS-...ICUX3Iqd9ZsfDNLoUeAb5KGJgEtDy-7ag52rYY5mGgP2GQ==", | |||
"alg": "AES-GCM", | |||
"wrappedKey": "KLPCJEy8vewUeHFFLtvMNA" | |||
}, | |||
"roomUrl": "http://localhost:3000/rooms/3jKS_Els9IU", | |||
"roomOwner": "Alexis", | |||
"maxSize": 2, | |||
"clientMaxSize": 2, | |||
"creationTime": 1405517546, | |||
"ctime": 1405517824, | |||
"expiresAt": 1405534180, | |||
"participants": [ | |||
{ "displayName": "Alexis", "account": "alexis@example.com", "roomConnectionId": "2a1787a6-4a73-43b5-ae3e-906ec1e763cb" }, | |||
{ "displayName": "Adam", "roomConnectionId": "781f012b-f1ea-4ce1-9105-7cfc36fb4ec7" } | |||
] | |||
} | |||
* '''roomToken''' - The token that uniquely identifies this room | |||
* '''context''' - Has the same meaning as in '''POST /rooms''' | |||
* '''roomUrl''' - A URL that can be given to other users to allow them to join the room. | |||
* '''roomOwner''' - The user-friendly display name indicating the name of the room's owner. | |||
* '''maxSize''' - The maximum number of users allowed in the room at one time (as configured by the room owner). | |||
* '''clientMaxSize''' - The current maximum number of users allowed in the room, as constrained by the clients currently participating in the session. If no client has a supported size smaller than "maxSize", then this will be equal to "maxSize". Under no circumstances can "clientMaxSize" be larger than "maxSize". | |||
* '''creationTime''' - The time (in seconds since the Unix epoch) at which the room was created. | |||
* '''expiresAt''' - The time (in seconds since the Unix epoch) at which the room goes away. | |||
* '''participants''' - An array containing a list of the current room participants. Each participant is formatted with the same fields as described in [[#User Identification in a Room]]. | |||
* '''ctime''' - Similar in spirit to the Unix filesystem "ctime" (change time) attribute. The time, in seconds since the Unix epoch, that any of the following happened to the room: | |||
** The room was created | |||
** The owner modified its attributes with "PATCH /rooms/{token}" | |||
** A user joined the room | |||
** A user left the room | |||
=== GET /rooms === | === GET /rooms === |