-
Notifications
You must be signed in to change notification settings - Fork 0
Rooms
Kason Chan edited this page Jun 16, 2015
·
14 revisions
Users can be anyone or anything.
Field | Type | Description |
---|---|---|
login |
String |
The user-defined login, handle, or alias that this room identifies themselves with. Nullable. Valid length range: 0 - 50. Example: "login": "playchatroom"
|
avatar_url |
String |
A HTTP-based URL pointing to the room’s avatar image. Nullable. Example: "avatar_url": ""
|
users |
Seq[String] |
Sequence of current room users, limited to 100 users. Example: "users": "["a", "playchatapi"]"
|
privacy |
String |
Privacy setting. Valid values: public , private .Default to private .Example: "privacy": "public"
|
created_at |
Long |
The system datetime that the room was created on PlayChat. Example: "created_at": 1432441527583
|
updated_at |
Long |
The system datetime that the room was updated on PlayChat. Example: "updated_at": 1432441527583
|
Get all rooms for the authenticated user
You must pass authentication information with your request.
GET /user/rooms
200 OK
[ {
"login": "",
"avatar_url": "",
"users": [
"a",
"playchat"
],
"privacy": "private",
"created_at": 1432441527585,
"updated_at": 1432441527585
} ]
Get all public rooms for the specified user
GET /users/:username/rooms
200 OK
[ {
"login": "PlayChatRoom",
"avatar_url": "",
"users": [
"a",
"playchat"
],
"privacy": "public",
"created_at": 1432441527585,
"updated_at": 1432441527599
} ]
Get all public rooms in the order of they were created
GET /rooms
200 OK
[ {
"login": "PlayChatRoom",
"avatar_url": "",
"users": [
"a",
"playchat"
],
"privacy": "public",
"created_at": 1432441527585,
"updated_at": 1432441527599
} ]
Create a new room for the authenticated user
You must pass authentication information with your request.
POST /user/rooms
{
"login": "playchatroom",
"users": [
"a",
"playchat"
]
}
201 Created
{
"login": "",
"avatar_url": "",
"users": [
"a",
"playchat"
],
"privacy": "private",
"created_at": 1432441527585,
"updated_at": 1432441527585
}
Update the room information
You must pass authentication information with your request.
Field | Type | Description |
---|---|---|
login |
String |
The user-defined login, handle, or alias that this room identifies themselves with. Optional. Valid length range: 0 - 50. Example: "login": "playchatroom"
|
privacy |
String |
Privacy setting. Optional. Valid values: public , private .Default to private .Example: "privacy": "public"
|
PUT /user/room
{
"login": "playchatroom",
"users": [
"a",
"playchat"
],
"privacy": "public"
}
200 Ok
{
"login": "",
"avatar_url": "",
"users": [
"a",
"playchat"
],
"privacy": "private",
"created_at": 1432441527585,
"updated_at": 1432441527585
}