diff --git a/docs/README.md b/docs/README.md
index 55cdf954c..d1ee7f793 100644
--- a/docs/README.md
+++ b/docs/README.md
@@ -2,20 +2,13 @@
Organisations represent a top-level grouping entity. There may be many organisations defined in a single deployment.
-## Add new organisation
-
-### Request parameters
-
-| Parameter | Type | Method | Description | Default | Required? |
-| --------- | ---- | ------ | ----------- | ------- | --------- |
-
## Archive organisation
### Request parameters
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
-| id | uint64 | POST | ID of Organisation | N/A | NO |
+| id | uint64 | POST | ID of Organisation | N/A | YES |
## Update organisation details
@@ -32,7 +25,7 @@ Organisations represent a top-level grouping entity. There may be many organisat
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
-| id | uint64 | GET | ID of Organisation | N/A | NO |
+| id | uint64 | GET | ID of Organisation | N/A | YES |
## Remove organisation
@@ -40,7 +33,7 @@ Organisations represent a top-level grouping entity. There may be many organisat
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
-| id | uint64 | GET | ID of Organisation | N/A | NO |
+| id | uint64 | GET | ID of Organisation | N/A | YES |
## Search organisations
@@ -54,19 +47,13 @@ Organisations represent a top-level grouping entity. There may be many organisat
An organisation may have many teams. Teams may have many channels available. Access to channels may be shared between teams.
-## Add new team
-
-### Request parameters
-
-| Parameter | Type | Method | Description | Default | Required? |
-| --------- | ---- | ------ | ----------- | ------- | --------- |
-
## Archive team
### Request parameters
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | POST | ID of Organisation | N/A | YES |
## Update team details
@@ -74,6 +61,9 @@ An organisation may have many teams. Teams may have many channels available. Acc
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | POST | ID of Team | N/A | NO |
+| name | string | POST | Name of Team | N/A | YES |
+| members | []uint64 | POST | Team member IDs | N/A | NO |
## Move team to different organisation
@@ -81,13 +71,16 @@ An organisation may have many teams. Teams may have many channels available. Acc
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | POST | ID of Organisation | N/A | YES |
+| organisation_id | uint64 | POST | ID of Organisation | N/A | YES |
-## Read team details
+## Read team details and memberships
### Request parameters
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | GET | ID of Organisation | N/A | YES |
## Remove team
@@ -95,6 +88,7 @@ An organisation may have many teams. Teams may have many channels available. Acc
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | GET | ID of Organisation | N/A | YES |
## Search teams
@@ -102,25 +96,19 @@ An organisation may have many teams. Teams may have many channels available. Acc
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| query | string | GET | Search query | N/A | NO |
# Channels
A channel is a representation of a sequence of messages. It has meta data like channel subject. Channels may be public, private or direct (between two users).
-## Add new channel
-
-### Request parameters
-
-| Parameter | Type | Method | Description | Default | Required? |
-| --------- | ---- | ------ | ----------- | ------- | --------- |
-| name | type | POST | title | N/A | NO |
-
## Archive channel
### Request parameters
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | POST | ID of Channel | N/A | YES |
## Update channel details
@@ -128,6 +116,18 @@ A channel is a representation of a sequence of messages. It has meta data like c
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | POST | ID of Channel | N/A | NO |
+| name | string | POST | Name of Channel | N/A | YES |
+| topic | string | POST | Subject of Channel | N/A | YES |
+
+## Merge one team into another
+
+### Request parameters
+
+| Parameter | Type | Method | Description | Default | Required? |
+| --------- | ---- | ------ | ----------- | ------- | --------- |
+| destination | uint64 | POST | Destination Channel ID | N/A | YES |
+| source | uint64 | POST | Source Channel ID | N/A | YES |
## Move channel to different team or organisation
@@ -135,6 +135,7 @@ A channel is a representation of a sequence of messages. It has meta data like c
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | POST | ID of Channel | N/A | YES |
## Read channel details
@@ -142,6 +143,7 @@ A channel is a representation of a sequence of messages. It has meta data like c
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | GET | ID of Channel | N/A | YES |
## Remove channel
@@ -149,6 +151,7 @@ A channel is a representation of a sequence of messages. It has meta data like c
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | GET | ID of Channel | N/A | YES |
## Search channels
@@ -156,6 +159,7 @@ A channel is a representation of a sequence of messages. It has meta data like c
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| query | string | GET | Search query | N/A | NO |
# Messages
@@ -179,19 +183,15 @@ The following event types may be sent with a message event:
| EDITED | A message has been edited by the sender |
| REMOVED | A message has been removed by the sender |
-## Add new message
-
-### Request parameters
-
-| Parameter | Type | Method | Description | Default | Required? |
-| --------- | ---- | ------ | ----------- | ------- | --------- |
-
-## Update message details
+## New message / edit message
### Request parameters
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | POST | ID of Message | N/A | NO |
+| channel_id | uint64 | POST | ID of Channel where to post message | N/A | NO |
+| contents | string | POST | Message contents (markdown) | N/A | YES |
## Flag message for user (bookmark)
@@ -199,6 +199,7 @@ The following event types may be sent with a message event:
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | POST | ID of Message | N/A | YES |
## Pin message to channel (public bookmark)
@@ -206,6 +207,7 @@ The following event types may be sent with a message event:
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | POST | ID of Message | N/A | YES |
## Read message details
@@ -213,6 +215,7 @@ The following event types may be sent with a message event:
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| channel_id | uint64 | POST | ID of Channel to read messages from | N/A | YES |
## Remove message
@@ -220,6 +223,7 @@ The following event types may be sent with a message event:
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| id | uint64 | GET | ID of Message | N/A | YES |
## Search messages
@@ -227,37 +231,11 @@ The following event types may be sent with a message event:
| Parameter | Type | Method | Description | Default | Required? |
| --------- | ---- | ------ | ----------- | ------- | --------- |
+| query | string | GET | Search string to match against messages | N/A | NO |
+| message_type | string | GET | Limit results to message type | N/A
Values:
- `history`
- `message`
- `attachment`
- `media`
| NO |
# Members
-## Add new member
-
-### Request parameters
-
-| Parameter | Type | Method | Description | Default | Required? |
-| --------- | ---- | ------ | ----------- | ------- | --------- |
-
-## Update member details
-
-### Request parameters
-
-| Parameter | Type | Method | Description | Default | Required? |
-| --------- | ---- | ------ | ----------- | ------- | --------- |
-
-## Read member details
-
-### Request parameters
-
-| Parameter | Type | Method | Description | Default | Required? |
-| --------- | ---- | ------ | ----------- | ------- | --------- |
-
-## Remove member
-
-### Request parameters
-
-| Parameter | Type | Method | Description | Default | Required? |
-| --------- | ---- | ------ | ----------- | ------- | --------- |
-
## Search members (Directory)
### Request parameters
diff --git a/docs/README.tpl b/docs/README.tpl
index abae0b4ca..66ec0316e 100644
--- a/docs/README.tpl
+++ b/docs/README.tpl
@@ -14,7 +14,7 @@
| --------- | ---- | ------ | ----------- | ------- | --------- |
{foreach $call.parameters as $method => $params}
{foreach $params as $param}
- | {param.name} | {param.type} | {method|toupper} | {param.title} | {if empty($param.default)}N/A{else}{param.default}{/if} | {if $param.required}YES{else}NO{/if} |
+ | {param.name} | {param.type} | {method|toupper} | {param.title} | {if empty($param.default)}N/A{else}{param.default}{/if}{if $param.values}
Values:
{foreach $param.values as $value}- `{value}`
{/foreach}
{/if} | {if $param.required}YES{else}NO{/if} |
{/foreach}
{/foreach}
diff --git a/docs/src/channel.json b/docs/src/channel.json
index 9a280eacf..88dce3ded 100644
--- a/docs/src/channel.json
+++ b/docs/src/channel.json
@@ -5,47 +5,128 @@
"Interface": "Channel",
"Path": "/channel",
"APIs": {
- "add": {
- "Method": "POST",
- "Title": "Add new channel",
- "Path": "/add",
- "Parameters": {}
- },
"archive": {
"Method": "POST",
"Title": "Archive channel",
"Path": "/archive",
- "Parameters": {}
+ "Parameters": {
+ "post": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Channel",
+ "type": "uint64"
+ }
+ ]
+ }
},
"edit": {
"Method": "POST",
"Title": "Update channel details",
"Path": "/edit",
- "Parameters": {}
+ "Parameters": {
+ "post": [
+ {
+ "name": "id",
+ "required": false,
+ "title": "ID of Channel",
+ "type": "uint64"
+ },
+ {
+ "name": "name",
+ "required": true,
+ "title": "Name of Channel",
+ "type": "string"
+ },
+ {
+ "name": "topic",
+ "required": true,
+ "title": "Subject of Channel",
+ "type": "string"
+ }
+ ]
+ }
+ },
+ "merge": {
+ "Method": "POST",
+ "Title": "Merge one team into another",
+ "Path": "/merge",
+ "Parameters": {
+ "post": [
+ {
+ "name": "destination",
+ "required": true,
+ "title": "Destination Channel ID",
+ "type": "uint64"
+ },
+ {
+ "name": "source",
+ "required": true,
+ "title": "Source Channel ID",
+ "type": "uint64"
+ }
+ ]
+ }
},
"move": {
"Method": "POST",
"Title": "Move channel to different team or organisation",
"Path": "/move",
- "Parameters": {}
+ "Parameters": {
+ "post": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Channel",
+ "type": "uint64"
+ }
+ ]
+ }
},
"read": {
"Method": "GET",
"Title": "Read channel details",
"Path": "/read",
- "Parameters": {}
+ "Parameters": {
+ "get": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Channel",
+ "type": "uint64"
+ }
+ ]
+ }
},
"remove": {
"Method": "DELETE",
"Title": "Remove channel",
"Path": "/remove",
- "Parameters": {}
+ "Parameters": {
+ "get": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Channel",
+ "type": "uint64"
+ }
+ ]
+ }
},
"search": {
"Method": "GET",
"Title": "Search channels",
"Path": "/search",
- "Parameters": {}
+ "Parameters": {
+ "get": [
+ {
+ "name": "query",
+ "required": false,
+ "title": "Search query",
+ "type": "string"
+ }
+ ]
+ }
}
}
}
\ No newline at end of file
diff --git a/docs/src/member.json b/docs/src/member.json
index 73c498e77..427003b5f 100644
--- a/docs/src/member.json
+++ b/docs/src/member.json
@@ -4,30 +4,6 @@
"Interface": "Member",
"Path": "/member",
"APIs": {
- "add": {
- "Method": "POST",
- "Title": "Add new member",
- "Path": "/add",
- "Parameters": {}
- },
- "edit": {
- "Method": "POST",
- "Title": "Update member details",
- "Path": "/edit",
- "Parameters": {}
- },
- "read": {
- "Method": "GET",
- "Title": "Read member details",
- "Path": "/read",
- "Parameters": {}
- },
- "remove": {
- "Method": "DELETE",
- "Title": "Remove member",
- "Path": "/remove",
- "Parameters": {}
- },
"search": {
"Method": "GET",
"Title": "Search members (Directory)",
diff --git a/docs/src/message.json b/docs/src/message.json
index 6d2b15f44..e5bd562bf 100644
--- a/docs/src/message.json
+++ b/docs/src/message.json
@@ -4,47 +4,119 @@
"Interface": "Message",
"Path": "/message",
"APIs": {
- "add": {
- "Method": "POST",
- "Title": "Add new message",
- "Path": "/add",
- "Parameters": {}
- },
"edit": {
"Method": "POST",
- "Title": "Update message details",
+ "Title": "New message / edit message",
"Path": "/edit",
- "Parameters": {}
+ "Parameters": {
+ "post": [
+ {
+ "name": "id",
+ "required": false,
+ "title": "ID of Message",
+ "type": "uint64"
+ },
+ {
+ "name": "channel_id",
+ "required": false,
+ "title": "ID of Channel where to post message",
+ "type": "uint64"
+ },
+ {
+ "name": "contents",
+ "required": true,
+ "title": "Message contents (markdown)",
+ "type": "string"
+ }
+ ]
+ }
},
"flag": {
"Method": "POST",
"Title": "Flag message for user (bookmark)",
"Path": "/flag",
- "Parameters": {}
+ "Parameters": {
+ "post": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Message",
+ "type": "uint64"
+ }
+ ]
+ }
},
"pin": {
"Method": "POST",
"Title": "Pin message to channel (public bookmark)",
"Path": "/pin",
- "Parameters": {}
+ "Parameters": {
+ "post": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Message",
+ "type": "uint64"
+ }
+ ]
+ }
},
"read": {
"Method": "GET",
"Title": "Read message details",
"Path": "/read",
- "Parameters": {}
+ "Parameters": {
+ "post": [
+ {
+ "name": "channel_id",
+ "required": true,
+ "title": "ID of Channel to read messages from",
+ "type": "uint64"
+ }
+ ]
+ }
},
"remove": {
"Method": "DELETE",
"Title": "Remove message",
"Path": "/remove",
- "Parameters": {}
+ "Parameters": {
+ "get": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Message",
+ "type": "uint64"
+ }
+ ]
+ }
},
"search": {
"Method": "GET",
"Title": "Search messages",
"Path": "/search",
- "Parameters": {}
+ "Parameters": {
+ "get": [
+ {
+ "name": "query",
+ "required": false,
+ "title": "Search string to match against messages",
+ "type": "string"
+ },
+ {
+ "name": "message_type",
+ "required": false,
+ "title": "Limit results to message type",
+ "type": "string",
+ "values": [
+ "history",
+ "message",
+ "attachment",
+ "media"
+ ]
+ }
+ ]
+ }
}
}
}
\ No newline at end of file
diff --git a/docs/src/organisation.json b/docs/src/organisation.json
index 7fa509d64..ec5cc07d6 100644
--- a/docs/src/organisation.json
+++ b/docs/src/organisation.json
@@ -5,41 +5,86 @@
"Interface": "Organisation",
"Path": "/organisation",
"APIs": {
- "add": {
- "Method": "POST",
- "Title": "Add new organisation",
- "Path": "/add",
- "Parameters": {}
- },
"archive": {
"Method": "POST",
"Title": "Archive organisation",
"Path": "/archive",
- "Parameters": {}
+ "Parameters": {
+ "post": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Organisation",
+ "type": "uint64"
+ }
+ ]
+ }
},
"edit": {
"Method": "POST",
"Title": "Update organisation details",
"Path": "/edit",
- "Parameters": {}
+ "Parameters": {
+ "post": [
+ {
+ "name": "id",
+ "required": false,
+ "title": "ID of Organisation",
+ "type": "uint64"
+ },
+ {
+ "name": "name",
+ "required": true,
+ "title": "Name of Organisation",
+ "type": "string"
+ }
+ ]
+ }
},
"read": {
"Method": "GET",
"Title": "Read organisation details",
"Path": "/read",
- "Parameters": {}
+ "Parameters": {
+ "get": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Organisation",
+ "type": "uint64"
+ }
+ ]
+ }
},
"remove": {
"Method": "DELETE",
"Title": "Remove organisation",
"Path": "/remove",
- "Parameters": {}
+ "Parameters": {
+ "get": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Organisation",
+ "type": "uint64"
+ }
+ ]
+ }
},
"search": {
"Method": "GET",
"Title": "Search organisations",
"Path": "/search",
- "Parameters": {}
+ "Parameters": {
+ "get": [
+ {
+ "name": "query",
+ "required": false,
+ "title": "Search query",
+ "type": "string"
+ }
+ ]
+ }
}
}
}
\ No newline at end of file
diff --git a/docs/src/team.json b/docs/src/team.json
index 08a2e6edf..455534174 100644
--- a/docs/src/team.json
+++ b/docs/src/team.json
@@ -5,47 +5,113 @@
"Interface": "Team",
"Path": "/team",
"APIs": {
- "add": {
- "Method": "POST",
- "Title": "Add new team",
- "Path": "/add",
- "Parameters": {}
- },
"archive": {
"Method": "POST",
"Title": "Archive team",
"Path": "/archive",
- "Parameters": {}
+ "Parameters": {
+ "post": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Organisation",
+ "type": "uint64"
+ }
+ ]
+ }
},
"edit": {
"Method": "POST",
"Title": "Update team details",
"Path": "/edit",
- "Parameters": {}
+ "Parameters": {
+ "post": [
+ {
+ "name": "id",
+ "required": false,
+ "title": "ID of Team",
+ "type": "uint64"
+ },
+ {
+ "name": "name",
+ "required": true,
+ "title": "Name of Team",
+ "type": "string"
+ },
+ {
+ "name": "members",
+ "required": false,
+ "title": "Team member IDs",
+ "type": "[]uint64"
+ }
+ ]
+ }
},
"move": {
"Method": "POST",
"Title": "Move team to different organisation",
"Path": "/move",
- "Parameters": {}
+ "Parameters": {
+ "POST": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Organisation",
+ "type": "uint64"
+ },
+ {
+ "name": "organisation_id",
+ "required": true,
+ "title": "ID of Organisation",
+ "type": "uint64"
+ }
+ ]
+ }
},
"read": {
"Method": "GET",
- "Title": "Read team details",
+ "Title": "Read team details and memberships",
"Path": "/read",
- "Parameters": {}
+ "Parameters": {
+ "get": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Organisation",
+ "type": "uint64"
+ }
+ ]
+ }
},
"remove": {
"Method": "DELETE",
"Title": "Remove team",
"Path": "/remove",
- "Parameters": {}
+ "Parameters": {
+ "get": [
+ {
+ "name": "id",
+ "required": true,
+ "title": "ID of Organisation",
+ "type": "uint64"
+ }
+ ]
+ }
},
"search": {
"Method": "GET",
"Title": "Search teams",
"Path": "/search",
- "Parameters": {}
+ "Parameters": {
+ "get": [
+ {
+ "name": "query",
+ "required": false,
+ "title": "Search query",
+ "type": "string"
+ }
+ ]
+ }
}
}
}
\ No newline at end of file