2014-08-22 06:40:37 -06:00
|
|
|
{
|
|
|
|
"apiVersion": "1.0.0",
|
|
|
|
"swaggerVersion": "1.2",
|
2014-09-03 03:47:00 -06:00
|
|
|
"basePath": "http://localhost:8008/_matrix/client/api/v1",
|
2014-08-22 06:40:37 -06:00
|
|
|
"resourcePath": "/presence",
|
|
|
|
"produces": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"consumes": [
|
|
|
|
"application/json"
|
|
|
|
],
|
|
|
|
"apis": [
|
|
|
|
{
|
|
|
|
"path": "/presence/{userId}/status",
|
|
|
|
"operations": [
|
|
|
|
{
|
|
|
|
"method": "PUT",
|
|
|
|
"summary": "Update this user's presence state.",
|
|
|
|
"notes": "This can only be done by the logged in user.",
|
|
|
|
"type": "void",
|
|
|
|
"nickname": "update_presence",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "body",
|
|
|
|
"description": "The new presence state",
|
|
|
|
"required": true,
|
|
|
|
"type": "PresenceUpdate",
|
|
|
|
"paramType": "body"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "userId",
|
|
|
|
"description": "The user whose presence to set.",
|
|
|
|
"required": true,
|
|
|
|
"type": "string",
|
|
|
|
"paramType": "path"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"method": "GET",
|
|
|
|
"summary": "Get this user's presence state.",
|
|
|
|
"notes": "Get this user's presence state.",
|
|
|
|
"type": "PresenceUpdate",
|
|
|
|
"nickname": "get_presence",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "userId",
|
|
|
|
"description": "The user whose presence to get.",
|
|
|
|
"required": true,
|
|
|
|
"type": "string",
|
|
|
|
"paramType": "path"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
2014-08-27 05:14:26 -06:00
|
|
|
"path": "/presence/list/{userId}",
|
2014-08-22 06:40:37 -06:00
|
|
|
"operations": [
|
|
|
|
{
|
|
|
|
"method": "GET",
|
|
|
|
"summary": "Retrieve a list of presences for all of this user's friends.",
|
|
|
|
"notes": "",
|
|
|
|
"type": "array",
|
|
|
|
"items": {
|
|
|
|
"$ref": "Presence"
|
|
|
|
},
|
|
|
|
"nickname": "get_presence_list",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "userId",
|
|
|
|
"description": "The user whose presence list to get.",
|
|
|
|
"required": true,
|
|
|
|
"type": "string",
|
|
|
|
"paramType": "path"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"method": "POST",
|
|
|
|
"summary": "Add or remove users from this presence list.",
|
|
|
|
"notes": "Add or remove users from this presence list.",
|
|
|
|
"type": "void",
|
|
|
|
"nickname": "modify_presence_list",
|
|
|
|
"parameters": [
|
|
|
|
{
|
|
|
|
"name": "userId",
|
|
|
|
"description": "The user whose presence list is being modified.",
|
|
|
|
"required": true,
|
|
|
|
"type": "string",
|
|
|
|
"paramType": "path"
|
|
|
|
},
|
|
|
|
{
|
|
|
|
"name": "body",
|
|
|
|
"description": "The modifications to make to this presence list.",
|
|
|
|
"required": true,
|
|
|
|
"type": "PresenceListModifications",
|
|
|
|
"paramType": "body"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
]
|
|
|
|
}
|
|
|
|
],
|
|
|
|
"models": {
|
|
|
|
"PresenceUpdate": {
|
|
|
|
"id": "PresenceUpdate",
|
|
|
|
"properties": {
|
2014-09-03 04:45:30 -06:00
|
|
|
"presence": {
|
2014-08-22 06:40:37 -06:00
|
|
|
"type": "string",
|
|
|
|
"description": "Enum: The presence state.",
|
|
|
|
"enum": [
|
|
|
|
"offline",
|
|
|
|
"unavailable",
|
|
|
|
"online",
|
|
|
|
"free_for_chat"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"status_msg": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "The user-defined message associated with this presence state."
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"subTypes": [
|
|
|
|
"Presence"
|
|
|
|
]
|
|
|
|
},
|
|
|
|
"Presence": {
|
|
|
|
"id": "Presence",
|
|
|
|
"properties": {
|
2014-09-03 05:09:11 -06:00
|
|
|
"last_active_ago": {
|
2014-08-22 06:40:37 -06:00
|
|
|
"type": "integer",
|
|
|
|
"format": "int64",
|
2014-09-03 05:09:11 -06:00
|
|
|
"description": "The last time this user performed an action on their home server."
|
2014-08-22 06:40:37 -06:00
|
|
|
},
|
|
|
|
"user_id": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "The fully qualified user ID"
|
|
|
|
}
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"PresenceListModifications": {
|
|
|
|
"id": "PresenceListModifications",
|
|
|
|
"properties": {
|
|
|
|
"invite": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "A list of user IDs to add to the list.",
|
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "A fully qualified user ID."
|
|
|
|
}
|
|
|
|
},
|
|
|
|
"drop": {
|
|
|
|
"type": "array",
|
|
|
|
"description": "A list of user IDs to remove from the list.",
|
|
|
|
"items": {
|
|
|
|
"type": "string",
|
|
|
|
"description": "A fully qualified user ID."
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|