From e04017a08216fba98e98a088dcbc236ac116fe9a Mon Sep 17 00:00:00 2001 From: yurabakhtin Date: Tue, 20 Jul 2021 12:58:34 +0300 Subject: [PATCH 1/5] Docs for polls module --- docs/CHANGELOG.md | 1 + docs/html/poll.html | 512 ++++++++++++++++++++++++++ docs/swagger/poll.yaml | 790 +++++++++++++++++++++++++++++++++++++++++ 3 files changed, 1303 insertions(+) create mode 100644 docs/html/poll.html create mode 100644 docs/swagger/poll.yaml diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index fd39e3c..34016ee 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -5,6 +5,7 @@ Changelog -------------------------- - Enh #33: Move endpoints to external modules - Fix #60: Cleanup code for prepare params +- Enh #86: Docs for polls module 0.3.1 (Unreleased) diff --git a/docs/html/poll.html b/docs/html/poll.html new file mode 100644 index 0000000..4b0b63d --- /dev/null +++ b/docs/html/poll.html @@ -0,0 +1,512 @@ + + + + + + HumHub - Polls API + + + + + + + + + +

HumHub - Polls API (1.0.0)

Download OpenAPI specification:Download

E-mail: info@humhub.com License: AGPLv2

Welcome to the HumHub polls module API reference.

+

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Polls

Find all polls

query Parameters
page
string >= 0

The number of page of the result set.

+
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

+

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Find all polls by container

path Parameters
id
required
integer

ID of content container

+
query Parameters
page
string >= 0

The number of page of the result set.

+
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

+

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Delete polls by container

path Parameters
id
required
integer

The id of content container

+

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Records successfully deleted!"
}

Poll

Create new poll

path Parameters
id
required
integer

The id of content container

+
Request Body schema: application/json

Poll information

+
required
object
newAnswers
required
Array of strings

New answers

+

Responses

Request samples

Content type
application/json
{
  • "Poll": {
    },
  • "newAnswers": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 4,
  • "contentcontainer_id": 2,
  • "question": "Poll question from API?",
  • "description": "Poll description from API",
  • "allow_multiple": 1,
  • "created_at": "2021-07-20T09:55:06.192Z",
  • "created_by": {},
  • "updated_at": "2021-07-20T09:55:06.193Z",
  • "updated_by": {},
  • "is_random": 1,
  • "closed": 1,
  • "anonymous": 0,
  • "show_result_after_close": 0,
  • "answers": [
    ]
}

Get a poll by id

path Parameters
id
required
integer

The id of the poll

+

Responses

Response samples

Content type
application/json
{
  • "id": 4,
  • "contentcontainer_id": 2,
  • "question": "Poll question from API?",
  • "description": "Poll description from API",
  • "allow_multiple": 1,
  • "created_at": "2021-07-20T09:55:06.192Z",
  • "created_by": {},
  • "updated_at": "2021-07-20T09:55:06.193Z",
  • "updated_by": {},
  • "is_random": 1,
  • "closed": 1,
  • "anonymous": 0,
  • "show_result_after_close": 0,
  • "answers": [
    ]
}

Update a poll by id

path Parameters
id
required
integer

The id of the poll

+
Request Body schema: application/json

Poll information

+
required
object
answers
Array of strings

Updating answers

+
newAnswers
required
Array of strings

New answers

+

Responses

Request samples

Content type
application/json
{
  • "Poll": {
    },
  • "answers": [
    ],
  • "newAnswers": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 4,
  • "contentcontainer_id": 2,
  • "question": "Poll question from API?",
  • "description": "Poll description from API",
  • "allow_multiple": 1,
  • "created_at": "2021-07-20T09:55:06.192Z",
  • "created_by": {},
  • "updated_at": "2021-07-20T09:55:06.193Z",
  • "updated_by": {},
  • "is_random": 1,
  • "closed": 1,
  • "anonymous": 0,
  • "show_result_after_close": 0,
  • "answers": [
    ]
}

Delete a poll by id

path Parameters
id
required
integer

The id of the poll

+

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully deleted!"
}

Poll management

Close a poll by id

path Parameters
id
required
integer

The id of the poll

+

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Poll has been successfully closed."
}

Open a poll by id

path Parameters
id
required
integer

The id of the poll

+

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Poll has been successfully reopened."
}

Poll voting

Vote on a poll by id

path Parameters
id
required
integer

The id of the poll

+
Request Body schema: application/json
answers
Array of integers

Selected answers

+

Responses

Request samples

Content type
application/json
{
  • "answers": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "You have voted."
}

Reset vote on a poll by id

path Parameters
id
required
integer

The id of the poll

+

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "You have reset your vote."
}

Get votes on a poll for current user

path Parameters
id
required
integer

The id of the poll

+

Responses

Response samples

Content type
application/json
[
  • [
    ]
]
+ + + + \ No newline at end of file diff --git a/docs/swagger/poll.yaml b/docs/swagger/poll.yaml new file mode 100644 index 0000000..d764763 --- /dev/null +++ b/docs/swagger/poll.yaml @@ -0,0 +1,790 @@ +swagger: '2.0' +info: + description: | + Welcome to the HumHub polls module API reference. + + version: 1.0.0 + title: HumHub - Polls API + contact: + email: info@humhub.com + license: + name: AGPLv2 + url: 'https://www.humhub.org/en/licences' +basePath: /api/v1 + +paths: + '/polls': + get: + tags: + - Polls + summary: Find all polls + description: '' + produces: + - application/json + - application/xml + parameters: + - $ref: 'common.yaml#/components/parameters/pageParam' + - $ref: 'common.yaml#/components/parameters/limitParam' + responses: + '200': + description: Success + schema: + type: object + properties: + total: + $ref: 'common.yaml#/components/properties/totalProperty' + page: + $ref: 'common.yaml#/components/properties/pageProperty' + pages: + $ref: 'common.yaml#/components/properties/pagesProperty' + links: + $ref: 'common.yaml#/components/properties/linksProperty' + results: + type: array + items: + $ref: '#/definitions/Poll' + + '/polls/container/{id}': + get: + tags: + - Polls + summary: Find all polls by container + description: '' + produces: + - application/json + - application/xml + parameters: + - name: id + in: path + description: ID of content container + required: true + type: integer + - $ref: 'common.yaml#/components/parameters/pageParam' + - $ref: 'common.yaml#/components/parameters/limitParam' + responses: + 200: + description: Success + schema: + type: object + properties: + total: + $ref: 'common.yaml#/components/properties/totalProperty' + page: + $ref: 'common.yaml#/components/properties/pageProperty' + pages: + $ref: 'common.yaml#/components/properties/pagesProperty' + links: + $ref: 'common.yaml#/components/properties/linksProperty' + results: + type: array + items: + $ref: '#/definitions/Poll' + 404: + description: Not found + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Content container not found! + + post: + tags: + - Poll + summary: Create new poll + description: '' + produces: + - application/json + parameters: + - in: path + name: id + description: The id of content container + required: true + type: integer + - $ref: "#/definitions/PollNewParams" + responses: + 200: + description: Success + schema: + $ref: "#/definitions/Poll" + 403: + description: Forbidden + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: You are not allowed to create a poll! + 404: + description: Not found + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Content container not found! + 422: + description: Validation failed + 500: + description: Internal server error + schema: + type: object + properties: + code: + type: integer + example: 500 + message: + type: string + example: Internal error while save a poll! + + delete: + tags: + - Polls + summary: Delete polls by container + produces: + - application/json + parameters: + - name: id + in: path + description: The id of content container + required: true + type: integer + responses: + 200: + description: Success + schema: + type: object + properties: + code: + type: integer + example: 200 + message: + type: string + example: Records successfully deleted! + 404: + description: Not found + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Content container not found! + + '/polls/poll/{id}': + get: + tags: + - Poll + summary: Get a poll by id + description: '' + produces: + - application/json + parameters: + - name: id + in: path + description: The id of the poll + required: true + type: integer + responses: + 200: + description: Success + schema: + $ref: "#/definitions/Poll" + 404: + description: Not found + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll not found + + put: + tags: + - Poll + summary: Update a poll by id + description: '' + produces: + - application/json + parameters: + - name: id + in: path + description: The id of the poll + required: true + type: integer + - $ref: "#/definitions/PollEditParams" + responses: + 200: + description: Success + schema: + $ref: "#/definitions/Poll" + 403: + description: Forbidden + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: You are not allowed to update this poll! + 404: + description: Not found + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll is not found! + 422: + description: Validation failed + 500: + description: Internal server error + schema: + type: object + properties: + code: + type: integer + example: 500 + message: + type: string + example: Internal error while update poll! + + delete: + tags: + - Poll + summary: Delete a poll by id + produces: + - application/json + parameters: + - name: id + in: path + description: The id of the poll + required: true + type: integer + responses: + 200: + description: Success + schema: + type: object + properties: + code: + type: integer + example: 200 + message: + type: string + example: Successfully deleted! + 403: + description: Forbidden + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: You are not allowed to delete this content! + 404: + description: Not found + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Content record not found! + 500: + description: Bad request + schema: + type: object + properties: + code: + type: integer + example: 500 + message: + type: string + example: Internal error while delete content! + +#----------------------------------------------------------------------------------------------------------------------- +# Begin Poll Management +#----------------------------------------------------------------------------------------------------------------------- + + '/polls/poll/{id}/close': + patch: + tags: + - Poll management + summary: Close a poll by id + description: '' + produces: + - application/json + parameters: + - name: id + in: path + description: The id of the poll + required: true + type: integer + responses: + 200: + description: Success + schema: + type: object + properties: + code: + type: integer + example: 200 + message: + type: string + example: Poll has been successfully closed. + 403: + description: Forbidden + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: You are not allowed to close this poll! + 404: + description: Not found + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll not found + 500: + description: Bad request + schema: + type: object + properties: + code: + type: integer + example: 500 + message: + type: string + example: Internal error while close this poll! + + '/polls/poll/{id}/open': + patch: + tags: + - Poll management + summary: Open a poll by id + description: '' + produces: + - application/json + parameters: + - name: id + in: path + description: The id of the poll + required: true + type: integer + responses: + 200: + description: Success + schema: + type: object + properties: + code: + type: integer + example: 200 + message: + type: string + example: Poll has been successfully reopened. + 403: + description: Forbidden + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: You are not allowed to open this poll! + 404: + description: Not found + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll is not found! + 500: + description: Bad request + schema: + type: object + properties: + code: + type: integer + example: 500 + message: + type: string + example: Internal error while open this poll! + +#----------------------------------------------------------------------------------------------------------------------- +# Begin Poll Voting +#----------------------------------------------------------------------------------------------------------------------- + + '/polls/vote/{id}': + put: + tags: + - Poll voting + summary: Vote on a poll by id + description: '' + produces: + - application/json + parameters: + - name: id + in: path + description: The id of the poll + required: true + type: integer + - name: body + in: body + required: true + schema: + type: object + required: + - status + properties: + answers: + type: array + description: Selected answers + items: + type: integer + example: + - 1 + - 4 + responses: + 200: + description: Success + schema: + type: object + properties: + code: + type: integer + example: 200 + message: + type: string + example: You have voted. + 403: + description: Forbidden + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: Voting for multiple answers is disabled! + 404: + description: Not found + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll is not found! + + delete: + tags: + - Poll voting + summary: Reset vote on a poll by id + description: '' + produces: + - application/json + parameters: + - name: id + in: path + description: The id of the poll + required: true + type: integer + responses: + 200: + description: Success + schema: + type: object + properties: + code: + type: integer + example: 200 + message: + type: string + example: You have reset your vote. + 403: + description: Forbidden + schema: + type: object + properties: + code: + type: integer + example: 403 + message: + type: string + example: Voting for multiple answers is disabled! + 404: + description: Not found + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll is not found! + + get: + tags: + - Poll voting + summary: Get votes on a poll for current user + description: '' + produces: + - application/json + parameters: + - name: id + in: path + description: The id of the poll + required: true + type: integer + responses: + 200: + description: Success + schema: + type: array + items: + type: integer + example: [11,13,24] + 404: + description: Not found + schema: + type: object + properties: + code: + type: integer + example: 404 + message: + type: string + example: Poll is not found! + +securityDefinitions: + $ref: "common.yaml#/securityDefinitions" + +definitions: + Poll: + type: object + properties: + id: + type: integer + format: int64 + readOnly: true + example: 4 + contentcontainer_id: + type: integer + format: int64 + readOnly: true + example: 2 + question: + type: string + example: Poll question from API? + description: + type: string + example: Poll description from API + allow_multiple: + type: integer + format: int64 + example: 1 + created_at: + type: string + example: 2021-07-20 09:43:12 + created_by: + $ref: "user.yaml#/definitions/UserShort" + updated_at: + type: string + example: 2021-07-20 09:43:12 + updated_by: + $ref: "user.yaml#/definitions/UserShort" + is_random: + type: integer + format: int64 + example: 1 + closed: + type: integer + format: int64 + example: 1 + anonymous: + type: integer + format: int64 + example: 0 + show_result_after_close: + type: integer + format: int64 + example: 0 + answers: + type: array + items: + $ref: "#/definitions/Answer" + + Answer: + type: object + properties: + id: + type: integer + format: int64 + readOnly: true + example: 1 + poll_id: + type: integer + format: int64 + readOnly: true + example: 4 + answer: + type: string + example: First answer text + created_at: + type: string + example: 2021-07-20 10:43:12 + created_by: + $ref: "user.yaml#/definitions/UserShort" + updated_at: + type: string + example: 2021-07-20 10:43:12 + updated_by: + $ref: "user.yaml#/definitions/UserShort" + + PollNewParams: + in: body + name: body + required: true + description: Poll information + schema: + type: object + required: + - Poll + - newAnswers + properties: + Poll: + type: object + required: + - question + properties: + question: + type: string + example: New question from API? + description: + type: string + example: New description from API? + allow_multiple: + type: integer + format: int64 + example: 0 + is_random: + type: integer + format: int64 + example: 1 + anonymous: + type: integer + format: int64 + example: 0 + show_result_after_close: + type: integer + format: int64 + example: 0 + newAnswers: + type: array + description: New answers + items: + type: string + example: + - "First answer" + - "Second answer" + - "Third answer" + + PollEditParams: + in: body + name: body + required: true + description: Poll information + schema: + type: object + required: + - Poll + - newAnswers + properties: + Poll: + type: object + required: + - question + properties: + question: + type: string + example: New question from API? + description: + type: string + example: New description from API? + allow_multiple: + type: integer + format: int64 + example: 0 + is_random: + type: integer + format: int64 + example: 1 + anonymous: + type: integer + format: int64 + example: 0 + show_result_after_close: + type: integer + format: int64 + example: 0 + answers: + type: array + description: Updating answers + items: + type: string + example: + - "1": "Updated first answer" + - "2": "Updated second answer" + - "3": "Updated third answer" + newAnswers: + type: array + description: New answers + items: + type: string + example: + - "Fourth answer" + - "Fifth answer" \ No newline at end of file From 45e99e7588b5bfa8c4a31b7c576b634df4b51594 Mon Sep 17 00:00:00 2001 From: yurabakhtin Date: Tue, 20 Jul 2021 14:29:48 +0300 Subject: [PATCH 2/5] Update postman collection with modules Comments, Content, File, Like, Polls --- .../Humhub API.postman_collection.json | 727 +++++++++++++++++- 1 file changed, 726 insertions(+), 1 deletion(-) diff --git a/docs/postman/Humhub API.postman_collection.json b/docs/postman/Humhub API.postman_collection.json index 4b7de73..ebcb534 100644 --- a/docs/postman/Humhub API.postman_collection.json +++ b/docs/postman/Humhub API.postman_collection.json @@ -1,6 +1,6 @@ { "info": { - "_postman_id": "9c760779-1f50-4f02-9024-cd520a16ce1f", + "_postman_id": "8cd645a3-817f-4ca4-9973-719e821b459b", "name": "Humhub Rest API", "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" }, @@ -3595,6 +3595,731 @@ ] } ] + }, + { + "name": "Comment", + "item": [ + { + "name": "Get Comment by id", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{API_URL}}/comment/5", + "host": [ + "{{API_URL}}" + ], + "path": [ + "comment", + "5" + ] + } + }, + "response": [] + }, + { + "name": "Delete Comment by id", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{API_URL}}/comment/41", + "host": [ + "{{API_URL}}" + ], + "path": [ + "comment", + "41" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Content", + "item": [ + { + "name": "Get contents by Container id", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{API_URL}}/content/find-by-container/39", + "host": [ + "{{API_URL}}" + ], + "path": [ + "content", + "find-by-container", + "39" + ], + "query": [ + { + "key": "XDEBUG_SESSION_START", + "value": "PHPSTORM", + "disabled": true + } + ] + } + }, + "response": [] + }, + { + "name": "List all Containers", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{API_URL}}/content/container", + "host": [ + "{{API_URL}}" + ], + "path": [ + "content", + "container" + ] + } + }, + "response": [] + }, + { + "name": "Get Content by id", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{API_URL}}/content/283", + "host": [ + "{{API_URL}}" + ], + "path": [ + "content", + "283" + ] + } + }, + "response": [] + }, + { + "name": "Delete Content by id", + "request": { + "method": "DELETE", + "header": [], + "url": { + "raw": "{{API_URL}}/content/300", + "host": [ + "{{API_URL}}" + ], + "path": [ + "content", + "300" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "File", + "item": [ + { + "name": "Download File", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{API_URL}}/file/download/26", + "host": [ + "{{API_URL}}" + ], + "path": [ + "file", + "download", + "26" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Like", + "item": [ + { + "name": "Get Like by id", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{API_URL}}/like/3", + "host": [ + "{{API_URL}}" + ], + "path": [ + "like", + "3" + ] + } + }, + "response": [] + }, + { + "name": "Find Likes by content id", + "request": { + "method": "GET", + "header": [], + "url": { + "raw": "{{API_URL}}/like/find-by-object?model=humhub\\modules\\post\\models\\Post&pk=1", + "host": [ + "{{API_URL}}" + ], + "path": [ + "like", + "find-by-object" + ], + "query": [ + { + "key": "model", + "value": "humhub\\modules\\post\\models\\Post" + }, + { + "key": "pk", + "value": "1" + } + ] + } + }, + "response": [] + }, + { + "name": "Delete Like by id Copy", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "username", + "value": "admin", + "type": "string" + }, + { + "key": "password", + "value": "yb6pas", + "type": "string" + } + ] + }, + "method": "DELETE", + "header": [], + "url": { + "raw": "{{API_URL}}/like/3", + "host": [ + "{{API_URL}}" + ], + "path": [ + "like", + "3" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Polls", + "item": [ + { + "name": "Container", + "item": [ + { + "name": "Get polls by container", + "request": { + "method": "GET", + "header": [ + { + "description": "admin", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_ADMIN}}" + }, + { + "description": "test", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_TEST}}", + "disabled": true + } + ], + "url": { + "raw": "{{API_URL}}/polls/container/2", + "host": [ + "{{API_URL}}" + ], + "path": [ + "polls", + "container", + "2" + ] + } + }, + "response": [] + }, + { + "name": "Delete polls by container", + "request": { + "method": "DELETE", + "header": [ + { + "description": "admin", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_ADMIN}}" + }, + { + "description": "test", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_TEST}}", + "disabled": true + } + ], + "url": { + "raw": "{{API_URL}}/tasks/container/1", + "host": [ + "{{API_URL}}" + ], + "path": [ + "tasks", + "container", + "1" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Poll", + "item": [ + { + "name": "Get poll by id", + "request": { + "method": "GET", + "header": [ + { + "description": "admin", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_ADMIN}}" + }, + { + "description": "test", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_TEST}}", + "disabled": true + }, + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{API_URL}}/polls/poll/1", + "host": [ + "{{API_URL}}" + ], + "path": [ + "polls", + "poll", + "1" + ] + } + }, + "response": [] + }, + { + "name": "Create new poll", + "request": { + "method": "POST", + "header": [ + { + "description": "admin", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_ADMIN}}" + }, + { + "description": "test", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_TEST}}", + "disabled": true + }, + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"Poll\": {\n\t\t\"question\": \"First Space api poll question\",\n\t\t\"description\": \"First Space api poll description\",\n\t\t\"allow_multiple\": 0,\n\t\t\"is_random\": 1,\n\t\t\"anonymous\": 0,\n \"show_result_after_close\": 0\n\t},\n \"newAnswers\": [\n \"First answer.\",\n \"Second answer.\",\n \"Third answer.\"\n ]\n}" + }, + "url": { + "raw": "{{API_URL}}/polls/container/2", + "host": [ + "{{API_URL}}" + ], + "path": [ + "polls", + "container", + "2" + ] + } + }, + "response": [] + }, + { + "name": "Update poll by id", + "request": { + "method": "PUT", + "header": [ + { + "description": "admin", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_ADMIN}}" + }, + { + "description": "test", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_TEST}}", + "disabled": true + }, + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n\t\"Poll\": {\n\t\t\"question\": \"Updated poll question from API\",\n\t\t\"description\": \"Updated poll description from API\",\n\t\t\"allow_multiple\": 0,\n\t\t\"is_random\": 1,\n\t\t\"anonymous\": 0,\n \"show_result_after_close\": 0\n\t},\n \"answers\": {\n \"31\": \"First answer.\",\n \"32\": \"Second answer.\",\n \"3\": \"Third answer.\"\n },\n \"newAnswers\": [\"New answer 1\", \"New answer 2\"]\n}" + }, + "url": { + "raw": "{{API_URL}}/polls/poll/2", + "host": [ + "{{API_URL}}" + ], + "path": [ + "polls", + "poll", + "2" + ] + } + }, + "response": [] + }, + { + "name": "Delete poll by id", + "request": { + "method": "DELETE", + "header": [ + { + "description": "admin", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_ADMIN}}", + "disabled": true + }, + { + "description": "test", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_TEST}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{API_URL}}/polls/poll/2", + "host": [ + "{{API_URL}}" + ], + "path": [ + "polls", + "poll", + "2" + ] + } + }, + "response": [] + }, + { + "name": "Close poll by id", + "request": { + "method": "PATCH", + "header": [ + { + "description": "admin", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_ADMIN}}", + "disabled": true + }, + { + "description": "test", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_TEST}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{API_URL}}/polls/poll/1/close", + "host": [ + "{{API_URL}}" + ], + "path": [ + "polls", + "poll", + "1", + "close" + ] + } + }, + "response": [] + }, + { + "name": "Open poll by id", + "request": { + "method": "PATCH", + "header": [ + { + "description": "admin", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_ADMIN}}", + "disabled": true + }, + { + "description": "test", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_TEST}}" + } + ], + "body": { + "mode": "raw", + "raw": "" + }, + "url": { + "raw": "{{API_URL}}/polls/poll/1/open", + "host": [ + "{{API_URL}}" + ], + "path": [ + "polls", + "poll", + "1", + "open" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Vote", + "item": [ + { + "name": "Get votes poll by id", + "request": { + "auth": { + "type": "basic", + "basic": [ + { + "key": "password", + "value": "admin", + "type": "string" + }, + { + "key": "username", + "value": "admin", + "type": "string" + } + ] + }, + "method": "GET", + "header": [ + { + "description": "admin", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_ADMIN}}" + }, + { + "description": "test", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_TEST}}", + "disabled": true + }, + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{API_URL}}/polls/vote/5", + "host": [ + "{{API_URL}}" + ], + "path": [ + "polls", + "vote", + "5" + ] + } + }, + "response": [] + }, + { + "name": "Vote poll by id", + "request": { + "method": "PUT", + "header": [ + { + "description": "admin", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_ADMIN}}" + }, + { + "description": "test", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_TEST}}", + "disabled": true + }, + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "body": { + "mode": "raw", + "raw": "{\n \"answers\": [13,15,1,44]\n}" + }, + "url": { + "raw": "{{API_URL}}/polls/vote/5", + "host": [ + "{{API_URL}}" + ], + "path": [ + "polls", + "vote", + "5" + ] + } + }, + "response": [] + }, + { + "name": "Reset vote on poll by id", + "request": { + "method": "DELETE", + "header": [ + { + "description": "admin", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_ADMIN}}" + }, + { + "description": "test", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_TEST}}", + "disabled": true + }, + { + "key": "Content-Type", + "name": "Content-Type", + "value": "application/json", + "type": "text" + } + ], + "url": { + "raw": "{{API_URL}}/polls/vote/5", + "host": [ + "{{API_URL}}" + ], + "path": [ + "polls", + "vote", + "5" + ] + } + }, + "response": [] + } + ] + }, + { + "name": "Get all polls", + "request": { + "method": "GET", + "header": [ + { + "description": "admin", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_ADMIN}}", + "disabled": true + }, + { + "description": "test", + "key": "Authorization", + "type": "text", + "value": "{{AUTHORIZATION_TEST}}" + } + ], + "url": { + "raw": "{{API_URL}}/polls", + "host": [ + "{{API_URL}}" + ], + "path": [ + "polls" + ] + } + }, + "response": [] + } + ] } ], "auth": { From 8f0241f68146a8756ba7053525fa9a89dc44a09b Mon Sep 17 00:00:00 2001 From: yurabakhtin Date: Tue, 20 Jul 2021 14:39:27 +0300 Subject: [PATCH 3/5] Update postman collection --- docs/postman/Humhub API.postman_collection.json | 17 +---------------- 1 file changed, 1 insertion(+), 16 deletions(-) diff --git a/docs/postman/Humhub API.postman_collection.json b/docs/postman/Humhub API.postman_collection.json index ebcb534..ea49f0c 100644 --- a/docs/postman/Humhub API.postman_collection.json +++ b/docs/postman/Humhub API.postman_collection.json @@ -3796,23 +3796,8 @@ "response": [] }, { - "name": "Delete Like by id Copy", + "name": "Delete Like by id", "request": { - "auth": { - "type": "basic", - "basic": [ - { - "key": "username", - "value": "admin", - "type": "string" - }, - { - "key": "password", - "value": "yb6pas", - "type": "string" - } - ] - }, "method": "DELETE", "header": [], "url": { From a61d1448aa87da49286ab770c673c7dd04fdac88 Mon Sep 17 00:00:00 2001 From: yurabakhtin Date: Tue, 20 Jul 2021 15:37:24 +0300 Subject: [PATCH 4/5] Update manual doc and remove duplicated docs of the external modules --- docs/MANUAL.md | 1 + docs/html/calendar.html | 546 ------------------ docs/html/cfiles.html | 563 ------------------ docs/html/mail.html | 555 ------------------ docs/html/poll.html | 512 ----------------- docs/html/task.html | 582 ------------------- docs/html/wiki.html | 549 ------------------ docs/swagger/calendar.yaml | 743 ------------------------ docs/swagger/cfiles.yaml | 706 ----------------------- docs/swagger/mail.yaml | 537 ----------------- docs/swagger/poll.yaml | 790 ------------------------- docs/swagger/task.yaml | 1116 ------------------------------------ docs/swagger/wiki.yaml | 705 ----------------------- 13 files changed, 1 insertion(+), 7904 deletions(-) delete mode 100644 docs/html/calendar.html delete mode 100644 docs/html/cfiles.html delete mode 100644 docs/html/mail.html delete mode 100644 docs/html/poll.html delete mode 100644 docs/html/task.html delete mode 100644 docs/html/wiki.html delete mode 100644 docs/swagger/calendar.yaml delete mode 100644 docs/swagger/cfiles.yaml delete mode 100644 docs/swagger/mail.yaml delete mode 100644 docs/swagger/poll.yaml delete mode 100644 docs/swagger/task.yaml delete mode 100644 docs/swagger/wiki.yaml diff --git a/docs/MANUAL.md b/docs/MANUAL.md index 76a2f00..61278d6 100644 --- a/docs/MANUAL.md +++ b/docs/MANUAL.md @@ -30,6 +30,7 @@ The base url for all APIs is: `https://yourhost/api/v1/` - [Tasks](https://www.humhub.com/en/marketplace/tasks/docs/swagger/task.html) - [Wiki](https://www.humhub.com/en/marketplace/wiki/docs/swagger/wiki.html) - [Mail](https://www.humhub.com/en/marketplace/mail/docs/swagger/mail.html) +- [Polls](https://www.humhub.com/en/marketplace/polls/docs/swagger/mail.html) The folder `/docs/html`contains HTML rendered documentations for all available API endpoints. diff --git a/docs/html/calendar.html b/docs/html/calendar.html deleted file mode 100644 index 91c72b6..0000000 --- a/docs/html/calendar.html +++ /dev/null @@ -1,546 +0,0 @@ - - - - - - HumHub - Calendar API - - - - - - - - - -

HumHub - Calendar API (1.0.0)

Download OpenAPI specification:Download

E-mail: info@humhub.com License: AGPLv2

Welcome to the HumHub calendar module API reference.

-

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Calendar

Find all calendars entries

query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Find all calendar entries by container

path Parameters
id
required
integer

ID of content container

-
query Parameters
topics
string
Example: topics=Music,Dancing

Coma separated list of topics to filter

-
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Deletes a calendar entries by container

path Parameters
id
required
integer

The id of content container

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Records successfully deleted!"
}

Calendar entry

Create new calendar entry

path Parameters
id
required
integer

The id of content container

-
Request Body schema: application/json

Calendar entry information

-
required
object
required
object

Responses

Request samples

Content type
application/json
{
  • "CalendarEntry": {
    },
  • "CalendarEntryForm": {
    }
}

Response samples

Content type
application/json
{
  • "id": 6,
  • "title": "Space event by API",
  • "description": "Space event by API description",
  • "start_datetime": "2019-02-27 00:00:00",
  • "end_datetime": "2019-02-28 23:59:00",
  • "all_day": 1,
  • "participation_mode": 2,
  • "color": "#6fdbe8",
  • "allow_decline": 1,
  • "allow_maybe": 1,
  • "time_zone": "America/Los_Angeles",
  • "participant_info": "",
  • "closed": 0,
  • "max_participants": null,
  • "content": {}
}

Get calendar entry by id

path Parameters
id
required
integer

The id of the calendar entry

-

Responses

Response samples

Content type
application/json
{
  • "id": 6,
  • "title": "Space event by API",
  • "description": "Space event by API description",
  • "start_datetime": "2019-02-27 00:00:00",
  • "end_datetime": "2019-02-28 23:59:00",
  • "all_day": 1,
  • "participation_mode": 2,
  • "color": "#6fdbe8",
  • "allow_decline": 1,
  • "allow_maybe": 1,
  • "time_zone": "America/Los_Angeles",
  • "participant_info": "",
  • "closed": 0,
  • "max_participants": null,
  • "content": {}
}

Update calendar entry by id

path Parameters
id
required
integer

The id of the calendar entry

-
Request Body schema: application/json

Calendar entry information

-
required
object
required
object

Responses

Request samples

Content type
application/json
{
  • "CalendarEntry": {
    },
  • "CalendarEntryForm": {
    }
}

Response samples

Content type
application/json
{
  • "id": 6,
  • "title": "Space event by API",
  • "description": "Space event by API description",
  • "start_datetime": "2019-02-27 00:00:00",
  • "end_datetime": "2019-02-28 23:59:00",
  • "all_day": 1,
  • "participation_mode": 2,
  • "color": "#6fdbe8",
  • "allow_decline": 1,
  • "allow_maybe": 1,
  • "time_zone": "America/Los_Angeles",
  • "participant_info": "",
  • "closed": 0,
  • "max_participants": null,
  • "content": {}
}

Delete the calendar entry by id

path Parameters
id
required
integer

The id of calendar entry

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Calendar entry successfully deleted!"
}

Calendar entry management

Attach files to calendar entry

path Parameters
id
required
integer

The id of the calendar entry

-
Request Body schema: multipart/form-data
files
required
Array of file

The files to upload.

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Files successfully uploaded."
}

Remove file from calendar entry

path Parameters
id
required
integer

The id of the calendar entry

-
fileId
required
string

The id of file to remove.

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "File successfully removed."
}

Participants

Change the user participant

path Parameters
id
required
integer

The id of the calendar entry

-
Request Body schema: application/json
type
required
integer <int64>
Enum: 0 1 2 3

Participant type:

-
    -
  • 1 - decline.
  • -
  • 2 - maybe.
  • -
  • 3 - accept.
  • -
  • 0 - remove from participants.
  • -
-

Responses

Request samples

Content type
application/json
{
  • "type": 3
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Participation successfully changed."
}
- - - - \ No newline at end of file diff --git a/docs/html/cfiles.html b/docs/html/cfiles.html deleted file mode 100644 index e625692..0000000 --- a/docs/html/cfiles.html +++ /dev/null @@ -1,563 +0,0 @@ - - - - - - HumHub - cFiles API - - - - - - - - - -

HumHub - cFiles API (1.0.0)

Download OpenAPI specification:Download

E-mail: info@humhub.com License: AGPLv2

Welcome to the HumHub cFiles module API reference.

-

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Directory

Find all folders by content container

path Parameters
id
required
integer

The id of content container

-
query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{}

Create new directory

path Parameters
id
required
integer

The id of content container

-
Request Body schema: application/json

Directory information

-
target_id
required
integer <int64>
required
object

Responses

Request samples

Content type
application/json
{
  • "target_id": 1,
  • "Folder": {
    }
}

Response samples

Content type
application/json
{}

Get directory by id

path Parameters
id
required
integer

The id of directory

-

Responses

Response samples

Content type
application/json
{}

Update directory by id

path Parameters
id
required
integer

The id of the directory

-
Request Body schema: application/json

Directory information

-
target_id
required
integer <int64>
required
object

Responses

Request samples

Content type
application/json
{
  • "target_id": 1,
  • "Folder": {
    }
}

Response samples

Content type
application/json
{}

Deletes a directory by id

path Parameters
id
required
integer

The id of directory

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Selected items are successfully deleted!"
}

File

Find all files by content container

path Parameters
id
required
integer

The id of content container

-
query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{}

Upload files

path Parameters
id
required
integer

The id of content container

-
Request Body schema: application/x-www-form-urlencoded
folder_id
required
integer <int64>

Id of directory

-
files
required
Array of file

The files to upload.

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Files successfully uploaded!"
}

Get file info by id

path Parameters
id
required
integer

The id of file

-

Responses

Response samples

Content type
application/json
{}

Deletes a file by id

path Parameters
id
required
integer

The id of file

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully deleted!"
}

Items Management

Make items public

path Parameters
id
required
integer

The id of content container

-
Request Body schema: application/json

Array of items

-
selection
required
Array of strings (Selection)

Item id in format {type}_{id}

-

Responses

Request samples

Content type
application/json
{
  • "selection": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Items successfully marked public!"
}

Make items private

path Parameters
id
required
integer

The id of content container

-
Request Body schema: application/json

Array of items

-
selection
required
Array of strings (Selection)

Item id in format {type}_{id}

-

Responses

Request samples

Content type
application/json
{
  • "selection": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Items successfully marked private!"
}

Move items to another folder

path Parameters
id
required
integer

The id of content container

-
Request Body schema: application/json

Directory information

-
source_id
required
integer <int64>
required
object
selection
required
Array of strings (Selection)

Item id in format {type}_{id}

-

Responses

Request samples

Content type
application/json
{
  • "source_id": 14,
  • "MoveForm": {
    },
  • "selection": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Items successfully moved."
}

Delete items from folder

path Parameters
id
required
integer

The id of content container

-
Request Body schema: application/json

Array of items

-
selection
required
Array of strings (Selection)

Item id in format {type}_{id}

-

Responses

Request samples

Content type
application/json
{
  • "selection": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Selected items are successfully deleted!"
}
- - - - \ No newline at end of file diff --git a/docs/html/mail.html b/docs/html/mail.html deleted file mode 100644 index d3f20a3..0000000 --- a/docs/html/mail.html +++ /dev/null @@ -1,555 +0,0 @@ - - - - - - HumHub - Mail API - - - - - - - - - -

HumHub - Mail API (1.0.0)

Download OpenAPI specification:Download

E-mail: info@humhub.com License: AGPLv2

Welcome to the HumHub user module API reference.

-

Mail

API to access and manage mail conversations.

-

Conversation

Find all conversations

query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Create conversation

Request Body schema: application/json

Data for new conversation

-
title
required
string

Conversation title

-
message
required
string

First entry content

-
recipient
required
Array of any

Guid of users

-

Responses

Request samples

Content type
application/json
{
  • "title": "Conversation from API",
  • "message": "First message from API",
  • "recipient": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 23,
  • "title": "Hi guys!",
  • "created_at": "2020-11-23T10:17:40.902Z",
  • "created_by": 1,
  • "updated_at": "2020-11-23T10:17:40.902Z",
  • "updated_by": 2
}

Get conversation by id

path Parameters
messageId
required
integer

The id of conversation

-

Responses

Response samples

Content type
application/json
{
  • "id": 23,
  • "title": "Hi guys!",
  • "created_at": "2020-11-23T10:17:40.902Z",
  • "created_by": 1,
  • "updated_at": "2020-11-23T10:17:40.902Z",
  • "updated_by": 2
}

Entry

Find entries of the conversation

path Parameters
messageId
required
integer

The id of conversation

-
query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Create entry

path Parameters
messageId
required
integer

The id of conversation

-
Request Body schema: application/json

Data for new conversation entry

-
message
required
string

Conversation entry content

-

Responses

Request samples

Content type
application/json
{
  • "message": "Sample entry content from API"
}

Response samples

Content type
application/json
{
  • "id": 23,
  • "user_id": 1,
  • "file_id": null,
  • "content": "Sample message",
  • "created_at": "2020-11-23T10:17:40.902Z",
  • "created_by": 1,
  • "updated_at": "2020-11-23T10:17:40.902Z",
  • "updated_by": 2
}

Get entry

path Parameters
messageId
required
integer

The id of conversation

-
entryId
required
integer

The id of entry

-

Responses

Response samples

Content type
application/json
{
  • "id": 23,
  • "user_id": 1,
  • "file_id": null,
  • "content": "Sample message",
  • "created_at": "2020-11-23T10:17:40.902Z",
  • "created_by": 1,
  • "updated_at": "2020-11-23T10:17:40.902Z",
  • "updated_by": 2
}

Update entry

path Parameters
messageId
required
integer

The id of conversation

-
entryId
required
integer

The id of entry

-
Request Body schema: application/json

Data to update conversation entry

-
content
required
string

Conversation entry content

-

Responses

Request samples

Content type
application/json
{
  • "content": "Updated sample entry content from API"
}

Response samples

Content type
application/json
{
  • "id": 23,
  • "user_id": 1,
  • "file_id": null,
  • "content": "Sample message",
  • "created_at": "2020-11-23T10:17:40.902Z",
  • "created_by": 1,
  • "updated_at": "2020-11-23T10:17:40.902Z",
  • "updated_by": 2
}

Delete entry

path Parameters
messageId
required
integer

The id of conversation

-
entryId
required
integer

The id of entry

-

Responses

Recipient

Find recipients of the conversation

path Parameters
messageId
required
integer

The id of conversation

-

Responses

Response samples

Content type
[
  • {
    }
]

Add recipient to conversation

path Parameters
messageId
required
integer

The id of conversation

-
userId
required
integer

The id of user

-

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Remove recipient from conversation

path Parameters
messageId
required
integer

The id of conversation

-
userId
required
integer

The id of user

-

Responses

Response samples

Content type
application/json
[
  • {
    }
]

Tag

Find tags of the conversation

path Parameters
messageId
required
integer

The id of conversation

-
query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
application/json
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Update tags

path Parameters
messageId
required
integer

The id of conversation

-
Request Body schema: application/json

Data to update conversation tags

-
tags
required
Array of any

Conversation tags

-

Responses

Request samples

Content type
application/json
{
  • "tags": [
    ]
}

Response samples

Content type
application/json
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}
- - - - \ No newline at end of file diff --git a/docs/html/poll.html b/docs/html/poll.html deleted file mode 100644 index 4b0b63d..0000000 --- a/docs/html/poll.html +++ /dev/null @@ -1,512 +0,0 @@ - - - - - - HumHub - Polls API - - - - - - - - - -

HumHub - Polls API (1.0.0)

Download OpenAPI specification:Download

E-mail: info@humhub.com License: AGPLv2

Welcome to the HumHub polls module API reference.

-

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Polls

Find all polls

query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Find all polls by container

path Parameters
id
required
integer

ID of content container

-
query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Delete polls by container

path Parameters
id
required
integer

The id of content container

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Records successfully deleted!"
}

Poll

Create new poll

path Parameters
id
required
integer

The id of content container

-
Request Body schema: application/json

Poll information

-
required
object
newAnswers
required
Array of strings

New answers

-

Responses

Request samples

Content type
application/json
{
  • "Poll": {
    },
  • "newAnswers": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 4,
  • "contentcontainer_id": 2,
  • "question": "Poll question from API?",
  • "description": "Poll description from API",
  • "allow_multiple": 1,
  • "created_at": "2021-07-20T09:55:06.192Z",
  • "created_by": {},
  • "updated_at": "2021-07-20T09:55:06.193Z",
  • "updated_by": {},
  • "is_random": 1,
  • "closed": 1,
  • "anonymous": 0,
  • "show_result_after_close": 0,
  • "answers": [
    ]
}

Get a poll by id

path Parameters
id
required
integer

The id of the poll

-

Responses

Response samples

Content type
application/json
{
  • "id": 4,
  • "contentcontainer_id": 2,
  • "question": "Poll question from API?",
  • "description": "Poll description from API",
  • "allow_multiple": 1,
  • "created_at": "2021-07-20T09:55:06.192Z",
  • "created_by": {},
  • "updated_at": "2021-07-20T09:55:06.193Z",
  • "updated_by": {},
  • "is_random": 1,
  • "closed": 1,
  • "anonymous": 0,
  • "show_result_after_close": 0,
  • "answers": [
    ]
}

Update a poll by id

path Parameters
id
required
integer

The id of the poll

-
Request Body schema: application/json

Poll information

-
required
object
answers
Array of strings

Updating answers

-
newAnswers
required
Array of strings

New answers

-

Responses

Request samples

Content type
application/json
{
  • "Poll": {
    },
  • "answers": [
    ],
  • "newAnswers": [
    ]
}

Response samples

Content type
application/json
{
  • "id": 4,
  • "contentcontainer_id": 2,
  • "question": "Poll question from API?",
  • "description": "Poll description from API",
  • "allow_multiple": 1,
  • "created_at": "2021-07-20T09:55:06.192Z",
  • "created_by": {},
  • "updated_at": "2021-07-20T09:55:06.193Z",
  • "updated_by": {},
  • "is_random": 1,
  • "closed": 1,
  • "anonymous": 0,
  • "show_result_after_close": 0,
  • "answers": [
    ]
}

Delete a poll by id

path Parameters
id
required
integer

The id of the poll

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully deleted!"
}

Poll management

Close a poll by id

path Parameters
id
required
integer

The id of the poll

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Poll has been successfully closed."
}

Open a poll by id

path Parameters
id
required
integer

The id of the poll

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Poll has been successfully reopened."
}

Poll voting

Vote on a poll by id

path Parameters
id
required
integer

The id of the poll

-
Request Body schema: application/json
answers
Array of integers

Selected answers

-

Responses

Request samples

Content type
application/json
{
  • "answers": [
    ]
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "You have voted."
}

Reset vote on a poll by id

path Parameters
id
required
integer

The id of the poll

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "You have reset your vote."
}

Get votes on a poll for current user

path Parameters
id
required
integer

The id of the poll

-

Responses

Response samples

Content type
application/json
[
  • [
    ]
]
- - - - \ No newline at end of file diff --git a/docs/html/task.html b/docs/html/task.html deleted file mode 100644 index 97fe540..0000000 --- a/docs/html/task.html +++ /dev/null @@ -1,582 +0,0 @@ - - - - - - HumHub - Tasks API - - - - - - - - - -

HumHub - Tasks API (1.0.0)

Download OpenAPI specification:Download

E-mail: info@humhub.com License: AGPLv2

Welcome to the HumHub tasks module API reference.

-

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Tasks

Find all tasks

query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Find all tasks by container

path Parameters
id
required
integer

ID of content container

-
query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Deletes a tasks by container

path Parameters
id
required
integer

The id of content container

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Records successfully deleted!"
}

Task

Create new task

path Parameters
id
required
integer

The id of content container

-
Request Body schema: application/json

Task information

-
required
object
required
object

Responses

Request samples

Content type
application/json
{
  • "Task": {
    },
  • "TaskForm": {
    }
}

Response samples

Content type
application/json
{
  • "id": 6,
  • "title": "Space task by API",
  • "description": "Space task by API description",
  • "status": 1,
  • "start_datetime": "2019-02-27 10:00:00",
  • "end_datetime": "2019-02-28 17:59:00",
  • "scheduling": 1,
  • "all_day": 0,
  • "reminders": [
    ],
  • "max_users": null,
  • "color": null,
  • "task_list": {
    },
  • "cal_mode": 1,
  • "review": 1,
  • "created_at": "2020-11-23T10:17:59.098Z",
  • "created_by": {},
  • "content": {},
  • "percentage": 0,
  • "checklist": [
    ],
  • "assigned_users": [],
  • "responsible_users": []
}

Get task by id

path Parameters
id
required
integer

The id of the task

-

Responses

Response samples

Content type
application/json
{
  • "id": 6,
  • "title": "Space task by API",
  • "description": "Space task by API description",
  • "status": 1,
  • "start_datetime": "2019-02-27 10:00:00",
  • "end_datetime": "2019-02-28 17:59:00",
  • "scheduling": 1,
  • "all_day": 0,
  • "reminders": [
    ],
  • "max_users": null,
  • "color": null,
  • "task_list": {
    },
  • "cal_mode": 1,
  • "review": 1,
  • "created_at": "2020-11-23T10:17:59.098Z",
  • "created_by": {},
  • "content": {},
  • "percentage": 0,
  • "checklist": [
    ],
  • "assigned_users": [],
  • "responsible_users": []
}

Update task by id

path Parameters
id
required
integer

The id of the task

-
Request Body schema: application/json

Task information

-
required
object
required
object

Responses

Request samples

Content type
application/json
{
  • "Task": {
    },
  • "TaskForm": {
    }
}

Response samples

Content type
application/json
{
  • "id": 6,
  • "title": "Space task by API",
  • "description": "Space task by API description",
  • "status": 1,
  • "start_datetime": "2019-02-27 10:00:00",
  • "end_datetime": "2019-02-28 17:59:00",
  • "scheduling": 1,
  • "all_day": 0,
  • "reminders": [
    ],
  • "max_users": null,
  • "color": null,
  • "task_list": {
    },
  • "cal_mode": 1,
  • "review": 1,
  • "created_at": "2020-11-23T10:17:59.098Z",
  • "created_by": {},
  • "content": {},
  • "percentage": 0,
  • "checklist": [
    ],
  • "assigned_users": [],
  • "responsible_users": []
}

Delete the task by id

path Parameters
id
required
integer

The id of the task

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Task successfully deleted!"
}

Task management

Change task status

path Parameters
id
required
integer

The id of the task

-
Request Body schema: application/json
title
integer <int64>
Enum: 1 2 3 5

Participant type:

-
    -
  • 1 - pending.
  • -
  • 2 - in progress.
  • -
  • 3 - pending review.
  • -
  • 5 - completed.
  • -
-

Responses

Request samples

Content type
application/json
{
  • "title": 2
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Status successfully changed."
}

Revert task

path Parameters
id
required
integer

The id of the task

-
Request Body schema: application/json
title
integer <int64>
Enum: 1 2 3 4

Participant type:

-
    -
  • 1 - pending.
  • -
  • 2 - in progress.
  • -
  • 3 - pending review.
  • -
  • 4 - completed.
  • -
-

Responses

Request samples

Content type
application/json
{
  • "title": 2
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Task successfully reverted."
}

Attach files to task

path Parameters
id
required
integer

The id of the task

-
Request Body schema: multipart/form-data
files
required
Array of file

The files to upload.

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Files successfully uploaded."
}

Remove file from task

path Parameters
id
required
integer

The id of the task

-
fileId
required
string

The id of file to remove.

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "File successfully removed."
}

Task List

Find all task lists by container

path Parameters
id
required
integer

ID of content container

-
query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Create new task list

path Parameters
id
required
integer

The id of content container

-
Request Body schema: application/json

Task list information

-
required
object
required
object

Responses

Request samples

Content type
application/json
{
  • "TaskList": {
    },
  • "TaskListSettings": {
    }
}

Response samples

Content type
application/json
{
  • "id": 9,
  • "name": "Task list name",
  • "contentcontainer_id": 2,
  • "parent_id": null,
  • "color": "#d1ad0e",
  • "settings": {
    }
}

Get task list by id

path Parameters
id
required
integer

The id of the task list

-

Responses

Response samples

Content type
application/json
{
  • "id": 9,
  • "name": "Task list name",
  • "contentcontainer_id": 2,
  • "parent_id": null,
  • "color": "#d1ad0e",
  • "settings": {
    }
}

Update task list by id

path Parameters
id
required
integer

The id of the task list

-
Request Body schema: application/json

Task list information

-
required
object
required
object

Responses

Request samples

Content type
application/json
{
  • "TaskList": {
    },
  • "TaskListSettings": {
    }
}

Response samples

Content type
application/json
{
  • "id": 9,
  • "name": "Task list name",
  • "contentcontainer_id": 2,
  • "parent_id": null,
  • "color": "#d1ad0e",
  • "settings": {
    }
}

Delete the task list by id

path Parameters
id
required
integer

The id of the task list

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Task list successfully deleted!"
}
- - - - \ No newline at end of file diff --git a/docs/html/wiki.html b/docs/html/wiki.html deleted file mode 100644 index d09c4e3..0000000 --- a/docs/html/wiki.html +++ /dev/null @@ -1,549 +0,0 @@ - - - - - - HumHub - Wiki API - - - - - - - - - -

HumHub - Wiki API (1.0.0)

Download OpenAPI specification:Download

E-mail: info@humhub.com License: AGPLv2

Welcome to the HumHub wiki module API reference.

-

Authentication

Bearer

Security Scheme Type JWT

BasicAuth

Security Scheme Type HTTP
HTTP Authorization Scheme basic

Wiki

Find all wiki pages

query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{}

Find all wiki pages by container

path Parameters
id
required
integer

ID of content container

-
query Parameters
topics
string
Example: topics=Music,Dancing

Coma separated list of topics to filter

-
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
{}

Deletes a wiki pages by container

path Parameters
id
required
integer

The id of content container

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Records successfully deleted!"
}

Wiki Page

Create new wiki page

path Parameters
id
required
integer

The id of content container

-
Request Body schema: application/json

Wiki page information

-
required
object
required
object
object

Responses

Request samples

Content type
application/json
{
  • "WikiPage": {
    },
  • "WikiPageRevision": {
    },
  • "PageEditForm": {
    }
}

Response samples

Content type
application/json
{}

Get wiki page by id

path Parameters
id
required
integer

The id of the wiki page

-

Responses

Response samples

Content type
application/json
{}

Update wiki page by id

path Parameters
id
required
integer

The id of the wiki page

-
Request Body schema: application/json

Wiki page information

-
required
object
required
object
object

Responses

Request samples

Content type
application/json
{
  • "WikiPage": {
    },
  • "WikiPageRevision": {
    },
  • "PageEditForm": {
    }
}

Response samples

Content type
application/json
{}

Deletes a wiki page by id

path Parameters
id
required
integer

The id of wiki page

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Successfully deleted!"
}

Wiki Page Management

Move page to another category

path Parameters
id
required
integer

The id of the wiki page

-
Request Body schema: application/json
target_id
required
integer <int64>

Wiki page category id

-
index
integer <int64>
Default: 0

Index for order

-

Responses

Request samples

Content type
application/json
{
  • "target_id": 2,
  • "index": 2
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Wiki page successfully moved!"
}

Move page to another space

path Parameters
id
required
integer

The id of the wiki page

-
Request Body schema: application/json
target
required
string

Guid of target space container

-

Responses

Request samples

Content type
application/json
{
  • "target": "c1c1c7dc-8197-471b-b5fe-2c12b183623a"
}

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Wiki page successfully moved!"
}

Wiki Page Revision

Find all revisions for page

path Parameters
pageId
required
integer

ID of wiki page

-
query Parameters
page
string >= 0

The number of page of the result set.

-
limit
string [ 1 .. 50 ]
Default: 20

The numbers of items to return per page.

-

Responses

Response samples

Content type
application/json
{
  • "total": 76,
  • "page": 1,
  • "pages": 8,
  • "links": {
    },
  • "results": [
    ]
}

Get revision by id

path Parameters
id
required
integer

The id of the revision

-

Responses

Response samples

Content type
application/json
{
  • "id": 2424,
  • "revision": 1534454147,
  • "is_latest": 1,
  • "wiki_page_id": 201,
  • "created_by": {},
  • "message": "The wiki page content in markdown."
}

Revert page by revision id

path Parameters
id
required
integer

The id of the revision

-

Responses

Response samples

Content type
application/json
{
  • "code": 200,
  • "message": "Wiki page revision successfully reverted"
}
- - - - \ No newline at end of file diff --git a/docs/swagger/calendar.yaml b/docs/swagger/calendar.yaml deleted file mode 100644 index 1ed2975..0000000 --- a/docs/swagger/calendar.yaml +++ /dev/null @@ -1,743 +0,0 @@ -swagger: '2.0' -info: - description: | - Welcome to the HumHub calendar module API reference. - - version: 1.0.0 - title: HumHub - Calendar API - contact: - email: info@humhub.com - license: - name: AGPLv2 - url: 'https://www.humhub.org/en/licences' -basePath: /api/v1 - -paths: - '/calendar': - get: - tags: - - Calendar - summary: Find all calendars entries - description: '' - produces: - - application/json - - application/xml - parameters: - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - '200': - description: Success - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - pages: - $ref: 'common.yaml#/components/properties/pagesProperty' - links: - $ref: 'common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/CalendarEntry' - - '/calendar/container/{id}': - get: - tags: - - Calendar - summary: Find all calendar entries by container - description: '' - produces: - - application/json - - application/xml - parameters: - - name: id - in: path - description: ID of content container - required: true - type: integer - - $ref: 'content.yaml#/components/parameters/topicsParam' - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - 200: - description: Success - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - pages: - $ref: 'common.yaml#/components/properties/pagesProperty' - links: - $ref: 'common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/CalendarEntry' - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - - post: - tags: - - Calendar entry - summary: Create new calendar entry - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of content container - required: true - type: integer - - $ref: "#/definitions/CalendarEntryPostParams" - responses: - 200: - description: Success - schema: - $ref: "#/definitions/CalendarEntry" - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to create calendar entry! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while save calendar entry! - - delete: - tags: - - Calendar - summary: Deletes a calendar entries by container - produces: - - application/json - parameters: - - name: id - in: path - description: The id of content container - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Records successfully deleted! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - - '/calendar/entry/{id}': - get: - tags: - - Calendar entry - summary: Get calendar entry by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the calendar entry - required: true - type: integer - responses: - 200: - description: Success - schema: - $ref: "#/definitions/CalendarEntry" - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Calendar entry not found - - put: - tags: - - Calendar entry - summary: Update calendar entry by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the calendar entry - required: true - type: integer - - $ref: "#/definitions/CalendarEntryPutParams" - responses: - 200: - description: Success - schema: - $ref: "#/definitions/CalendarEntry" - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to edit this calendar entry! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Calendar entry not found - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while update calendar entry! - - delete: - tags: - - Calendar entry - summary: Delete the calendar entry by id - produces: - - application/json - parameters: - - name: id - in: path - description: The id of calendar entry - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Calendar entry successfully deleted! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Calendar entry not found - -#----------------------------------------------------------------------------------------------------------------------- -# Begin Calendar Entry Management -#----------------------------------------------------------------------------------------------------------------------- - - '/calendar/entry/{id}/upload-files': - post: - tags: - - Calendar entry management - summary: Attach files to calendar entry - description: '' - produces: - - application/json - consumes: - - multipart/form-data - parameters: - - in: path - name: id - description: The id of the calendar entry - required: true - type: integer - - in: formData - name: files - type: array - required: true - description: The files to upload. - items: - type: file - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Files successfully uploaded. - 400: - description: Bad Request - schema: - type: object - properties: - code: - type: integer - example: 400 - message: - type: string - example: No files to upload. - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content record not found! - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while saving file. - - '/calendar/entry/{id}remove-file/{fileId}': - delete: - tags: - - Calendar entry management - summary: Remove file from calendar entry - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of the calendar entry - required: true - type: integer - - in: path - name: fileId - required: true - description: The id of file to remove. - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: File successfully removed. - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: Insufficient permissions! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Could not find requested content record or file! - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while removing file. - -#----------------------------------------------------------------------------------------------------------------------- -# Begin Participants -#----------------------------------------------------------------------------------------------------------------------- - - '/calendar/entry/{id}/respond': - post: - tags: - - Participants - summary: Change the user participant - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of the calendar entry - required: true - type: integer - - in: body - name: body - required: true - schema: - type: object - required: - - type - properties: - type: - type: integer - format: int64 - enum: [0,1,2,3] - example: 3 - description: > - Participant type: - * 1 - decline. - * 2 - maybe. - * 3 - accept. - * 0 - remove from participants. - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Participation successfully changed. - 400: - description: Bad request - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Calendar entry not found - -securityDefinitions: - $ref: "common.yaml#/securityDefinitions" - -definitions: - CalendarEntry: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 6 - title: - type: string - example: Space event by API - description: - type: string - example: Space event by API description - start_datetime: - type: string - format: datetime - example: "2019-02-27 00:00:00" - end_datetime: - type: string - format: datetime - example: "2019-02-28 23:59:00" - all_day: - type: integer - format: int64 - example: 1 - participation_mode: - type: integer - format: int64 - example: 2 - color: - type: string - example: "#6fdbe8" - allow_decline: - type: integer - format: int64 - example: 1 - allow_maybe: - type: integer - format: int64 - example: 1 - time_zone: - type: string - example: America/Los_Angeles - participant_info: - type: string - example: "" - closed: - type: integer - format: int64 - example: 0 - max_participants: - type: string - example: null - content: - $ref: "content.yaml#/definitions/Content" - - CalendarEntryPostParams: - in: body - name: body - required: true - description: Calendar entry information - schema: - type: object - required: - - CalendarEntry - - CalendarEntryForm - properties: - CalendarEntry: - type: object - required: - - title - properties: - title: - type: string - example: Api calendar event - description: - type: string - example: Api calendar event description - color: - type: string - example: "#6fdbe8" - all_day: - type: integer - format: int64 - example: 0 - participation_mode: - type: integer - format: int64 - example: 2 - max_participants: - type: integer - format: int64 - example: null - allow_decline: - type: integer - format: int64 - example: 1 - allow_maybe: - type: integer - format: int64 - example: 1 - participant_info: - type: string - example: "" - CalendarEntryForm: - type: object - required: - - start_date - - end_date - properties: - is_public: - type: integer - format: int64 - example: 1 - start_date: - type: string - format: date - example: "2019-03-23" - start_time: - type: string - example: "10:00" - end_date: - type: string - format: date - example: "2019-03-25" - end_time: - type: string - example: "20:30" - timeZone: - type: string - example: America/Los_Angeles - forceJoin: - type: integer - format: int64 - example: 0 - topics: - type: array - items: - type: integer - format: int64 - example: 3 - - CalendarEntryPutParams: - in: body - name: body - required: true - description: Calendar entry information - schema: - type: object - required: - - CalendarEntry - - CalendarEntryForm - properties: - CalendarEntry: - type: object - required: - - title - properties: - title: - type: string - example: Api calendar event - description: - type: string - example: Api calendar event description - color: - type: string - example: "#6fdbe8" - all_day: - type: integer - format: int64 - example: 0 - participation_mode: - type: integer - format: int64 - example: 2 - max_participants: - type: integer - format: int64 - example: null - allow_decline: - type: integer - format: int64 - example: 1 - allow_maybe: - type: integer - format: int64 - example: 1 - participant_info: - type: string - example: "" - CalendarEntryForm: - type: object - required: - - start_date - - end_date - properties: - is_public: - type: integer - format: int64 - example: 1 - start_date: - type: string - format: date - example: "2019-03-23" - start_time: - type: string - example: "10:00" - end_date: - type: string - format: date - example: "2019-03-25" - end_time: - type: string - example: "20:30" - timeZone: - type: string - example: America/Los_Angeles - forceJoin: - type: integer - format: int64 - example: 0 - sendUpdateNotification: - type: integer - format: int64 - example: 0 - topics: - type: array - items: - type: integer - format: int64 - example: 3 \ No newline at end of file diff --git a/docs/swagger/cfiles.yaml b/docs/swagger/cfiles.yaml deleted file mode 100644 index 53f687e..0000000 --- a/docs/swagger/cfiles.yaml +++ /dev/null @@ -1,706 +0,0 @@ -swagger: '2.0' -info: - description: | - Welcome to the HumHub cFiles module API reference. - - version: 1.0.0 - title: HumHub - cFiles API - contact: - email: info@humhub.com - license: - name: AGPLv2 - url: 'https://www.humhub.org/en/licences' -basePath: /api/v1 - -paths: -#----------------------------------------------------------------------------------------------------------------------- -# Begin cFiles Directory endpoints -#----------------------------------------------------------------------------------------------------------------------- - - '/cfiels/folders/container/{id}': - get: - tags: - - Directory - summary: Find all folders by content container - description: '' - produces: - - application/json - - application/xml - parameters: - - in: path - name: id - description: The id of content container - required: true - type: integer - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - 200: - description: Success - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - results: - type: array - items: - $ref: '#/definitions/Directory' - - post: - tags: - - Directory - summary: Create new directory - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of content container - required: true - type: integer - - $ref: "#/definitions/DirectoryParams" - responses: - 200: - description: Success - schema: - $ref: "#/definitions/Directory" - 404: - $ref: "common.yaml#/definitions/ContainerNotFound" - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while save valid directory! - - '/cfiels/folder/{id}': - get: - tags: - - Directory - summary: Get directory by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of directory - required: true - type: integer - responses: - 200: - description: Success - schema: - $ref: "#/definitions/Directory" - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Requested content not found! - - put: - tags: - - Directory - summary: Update directory by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the directory - required: true - type: integer - - $ref: "#/definitions/DirectoryParams" - responses: - 200: - description: Success - schema: - $ref: "#/definitions/Directory" - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: cFiles folder not found! - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while update cFiles folder! - - delete: - tags: - - Directory - summary: Deletes a directory by id - produces: - - application/json - parameters: - - name: id - in: path - description: The id of directory - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Selected items are successfully deleted! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - description: Content record not found! - -#----------------------------------------------------------------------------------------------------------------------- -# Begin cFiles File endpoints -#----------------------------------------------------------------------------------------------------------------------- - - '/cfiels/files/container/{id}': - get: - tags: - - File - summary: Find all files by content container - description: '' - produces: - - application/json - - application/xml - parameters: - - in: path - name: id - description: The id of content container - required: true - type: integer - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - 200: - description: Success - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - results: - type: array - items: - $ref: '#/definitions/File' - - post: - tags: - - File - summary: Upload files - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of content container - required: true - type: integer - - in: formData - name: folder_id - required: true - type: integer - format: int64 - description: Id of directory - - in: formData - name: files - type: array - required: true - description: The files to upload. - items: - type: file - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Files successfully uploaded! - 400: - description: Bad Request - 404: - $ref: "common.yaml#/definitions/ContainerNotFound" - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while save valid directory! - - '/cfiels/file/{id}': - get: - tags: - - File - summary: Get file info by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of file - required: true - type: integer - responses: - 200: - description: Success - schema: - $ref: "#/definitions/File" - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Requested content not found! - - delete: - tags: - - File - summary: Deletes a file by id - produces: - - application/json - parameters: - - name: id - in: path - description: The id of file - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Successfully deleted! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - description: Content record not found! - -#----------------------------------------------------------------------------------------------------------------------- -# Begin cFiles items management -#----------------------------------------------------------------------------------------------------------------------- - - '/cfiels/items/container/{id}/make-public': - patch: - tags: - - Items Management - summary: Make items public - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of content container - required: true - type: integer - - in: body - name: body - description: Array of items - required: true - schema: - type: object - required: - - selection - properties: - selection: - $ref: "#/definitions/Selection" - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Items successfully marked public! - 404: - $ref: "common.yaml#/definitions/ContainerNotFound" - 400: - description: Bad Request - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while setting public visibility for cFiles item! - - '/cfiels/items/container/{id}/make-private': - patch: - tags: - - Items Management - summary: Make items private - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of content container - required: true - type: integer - - in: body - name: body - description: Array of items - required: true - schema: - type: object - required: - - selection - properties: - selection: - $ref: "#/definitions/Selection" - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Items successfully marked private! - 404: - $ref: "common.yaml#/definitions/ContainerNotFound" - 400: - description: Bad Request - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while setting private visibility for cFiles item! - - '/cfiels/items/container/{id}/move': - post: - tags: - - Items Management - summary: Move items to another folder - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of content container - required: true - type: integer - - $ref: "#/definitions/MoveFormParams" - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Items successfully moved. - 404: - $ref: "common.yaml#/definitions/ContainerNotFound" - 400: - description: Bad Request - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while move cFiles items! - - '/cfiels/items/container/{id}/delete': - delete: - tags: - - Items Management - summary: Delete items from folder - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of content container - required: true - type: integer - - in: body - name: body - description: Array of items - required: true - schema: - type: object - required: - - selection - properties: - selection: - $ref: "#/definitions/Selection" - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Selected items are successfully deleted! - 404: - $ref: "common.yaml#/definitions/ContainerNotFound" - 400: - description: Bad Request - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while deleting cFiles item! - -securityDefinitions: - $ref: "common.yaml#/securityDefinitions" - -definitions: - - DirectoryShort: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 4 - title: - type: string - example: "API directory" - description: - type: string - example: "API directory description" - - - Directory: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 4 - title: - type: string - example: "API directory" - description: - type: string - example: "API directory description" - parent_folder_id: - type: integer - format: int64 - example: 1 - type: - type: string - example: null - created_at: - type: string - example: 2019-03-05 15:35:02 - created_by: - $ref: "user.yaml#/definitions/UserShort" - content: - $ref: "content.yaml#/definitions/Content" - - File: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 4 - description: - type: string - example: "API directory description" - parent_folder: - $ref: "#/definitions/DirectoryShort" - created_at: - type: string - example: 2019-03-05 15:35:02 - created_by: - $ref: "user.yaml#/definitions/UserShort" - content: - $ref: "content.yaml#/definitions/Content" - - Selection: - type: array - description: Item id in format {type}_{id} - items: - type: string - example: - - folder_4 - - file_2 - - DirectoryParams: - in: body - name: body - required: true - description: Directory information - schema: - type: object - required: - - target_id - - Folder - properties: - target_id: - type: integer - format: int64 - example: 1 - Folder: - type: object - required: - - title - properties: - title: - type: string - example: API folder - description: - type: string - example: API folder description - visibility: - type: integer - format: int64 - enum: [0,1] - description: > - Allowed visibility statuses: - * 0 - Private - * 1 - Public - example: 1 - - MoveFormParams: - in: body - name: body - required: true - description: Directory information - schema: - type: object - required: - - source_id - - MoveForm - - selection - properties: - source_id: - type: integer - format: int64 - example: 14 - MoveForm: - type: object - required: - - destId - properties: - destId: - type: string - example: 3 - selection: - $ref: "#/definitions/Selection" \ No newline at end of file diff --git a/docs/swagger/mail.yaml b/docs/swagger/mail.yaml deleted file mode 100644 index 1cab0d7..0000000 --- a/docs/swagger/mail.yaml +++ /dev/null @@ -1,537 +0,0 @@ -swagger: '2.0' -info: - description: | - Welcome to the HumHub user module API reference. - - version: 1.0.0 - title: HumHub - Mail API - contact: - email: info@humhub.com - license: - name: AGPLv2 - url: 'https://www.humhub.org/en/licences' -basePath: /api/v1 -schemes: - - http - - https -tags: - - name: Mail - description: API to access and manage mail conversations. -paths: - '/mail': - get: - tags: - - Conversation - summary: Find all conversations - produces: - - application/json - - application/xml - parameters: - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - '200': - description: Successful operation - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - pages: - $ref: 'common.yaml#/components/properties/pagesProperty' - links: - $ref: 'common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/Message' - post: - tags: - - Conversation - summary: Create conversation - produces: - - application/json - parameters: - - in: body - name: body - description: Data for new conversation - required: true - schema: - type: object - required: - - title - - message - - recipient - properties: - title: - type: string - description: Conversation title - example: Conversation from API - message: - type: string - description: First entry content - example: First message from API - recipient: - type: array - description: Guid of users - example: ["8eddbecb-8207-4848-bba6-5910115d3e4a", "b6b66077-916d-4718-af28-5ffc20895d30"] - responses: - '200': - description: successful operation - schema: - $ref: "#/definitions/Message" - '400': - description: Validation failed - '403': - description: You cannot create conversations! - '500': - description: Internal error while save conversation! - - '/mail/{messageId}': - get: - tags: - - Conversation - summary: Get conversation by id - produces: - - application/json - parameters: - - name: messageId - in: path - description: The id of conversation - required: true - type: integer - responses: - '200': - description: successful operation - schema: - $ref: "#/definitions/Message" - '403': - description: You must be a participant of the conversation. - '404': - description: Message not found - - '/mail/{messageId}/entries': - get: - tags: - - Entry - summary: Find entries of the conversation - produces: - - application/json - - application/xml - parameters: - - in: path - name: messageId - description: The id of conversation - required: true - type: integer - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - '200': - description: Successful operation - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - pages: - $ref: 'common.yaml#/components/properties/pagesProperty' - links: - $ref: 'common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/MessageEntry' - - '/mail/{messageId}/entry': - post: - tags: - - Entry - summary: Create entry - produces: - - application/json - parameters: - - in: path - name: messageId - description: The id of conversation - required: true - type: integer - - in: body - name: body - description: Data for new conversation entry - required: true - schema: - type: object - required: - - message - properties: - message: - type: string - description: Conversation entry content - example: Sample entry content from API - responses: - '200': - description: successful operation - schema: - $ref: "#/definitions/MessageEntry" - '400': - description: Validation failed - '403': - description: You must be a participant of the conversation. - '404': - description: Message not found! - '500': - description: Internal error while save entry for the conversation! - - '/mail/{messageId}/entry/{entryId}': - get: - tags: - - Entry - summary: Get entry - produces: - - application/json - parameters: - - name: messageId - in: path - description: The id of conversation - required: true - type: integer - - name: entryId - in: path - description: The id of entry - required: true - type: integer - responses: - '200': - description: successful operation - schema: - $ref: "#/definitions/MessageEntry" - '403': - description: ["You must be a participant of the conversation.", "You cannot edit the conversation entry!"] - '404': - description: ["Message not found!", "Conversation entry not found!"] - put: - tags: - - Entry - summary: Update entry - produces: - - application/json - parameters: - - name: messageId - in: path - description: The id of conversation - required: true - type: integer - - name: entryId - in: path - description: The id of entry - required: true - type: integer - - in: body - name: body - description: Data to update conversation entry - required: true - schema: - type: object - required: - - content - properties: - content: - type: string - description: Conversation entry content - example: Updated sample entry content from API - responses: - '200': - description: successful operation - schema: - $ref: "#/definitions/MessageEntry" - '400': - description: Validation failed - '403': - description: [ "You must be a participant of the conversation.", "You cannot edit the conversation entry!" ] - '404': - description: [ "Message not found!", "Conversation entry not found!" ] - '500': - description: Internal error while save entry for the conversation! - delete: - tags: - - Entry - summary: Delete entry - produces: - - application/json - parameters: - - name: messageId - in: path - description: The id of conversation - required: true - type: integer - - name: entryId - in: path - description: The id of entry - required: true - type: integer - responses: - '200': - description: Conversation entry successfully deleted! - '400': - description: Validation failed - '403': - description: [ "You must be a participant of the conversation.", "You cannot edit the conversation entry!" ] - '404': - description: [ "Message not found!", "Conversation entry not found!" ] - '500': - description: Internal error while delete entry from the conversation! - - '/mail/{messageId}/users': - get: - tags: - - Recipient - summary: Find recipients of the conversation - produces: - - application/json - - application/xml - parameters: - - in: path - name: messageId - description: The id of conversation - required: true - type: integer - responses: - '200': - description: Successful operation - schema: - type: array - items: - $ref: 'user.yaml#/definitions/User' - - '/mail/{messageId}/user/{userId}': - post: - tags: - - Recipient - summary: Add recipient to conversation - produces: - - application/json - parameters: - - in: path - name: messageId - description: The id of conversation - required: true - type: integer - - in: path - name: userId - description: The id of user - required: true - type: integer - responses: - '200': - description: successful operation, list of all recipients of the conversation - schema: - type: array - items: - $ref: 'user.yaml#/definitions/User' - '400': - description: User is already a participant of the conversation. - '403': - description: You must be a participant of the conversation. - '404': - description: Message not found! - '500': - description: Internal error while add a participant into conversation! - delete: - tags: - - Recipient - summary: Remove recipient from conversation - produces: - - application/json - parameters: - - in: path - name: messageId - description: The id of conversation - required: true - type: integer - - in: path - name: userId - description: The id of user - required: true - type: integer - responses: - '200': - description: successful operation, list of all recipients of the conversation - schema: - type: array - items: - $ref: 'user.yaml#/definitions/User' - '400': - description: User is not a participant of the conversation. - '403': - description: You must be a participant of the conversation. - '404': - description: Message not found! - - '/mail/{messageId}/tags': - get: - tags: - - Tag - summary: Find tags of the conversation - produces: - - application/json - parameters: - - in: path - name: messageId - description: The id of conversation - required: true - type: integer - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - '200': - description: Successful operation - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - pages: - $ref: 'common.yaml#/components/properties/pagesProperty' - links: - $ref: 'common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/MessageTag' - put: - tags: - - Tag - summary: Update tags - produces: - - application/json - parameters: - - name: messageId - in: path - description: The id of conversation - required: true - type: integer - - in: body - name: body - description: Data to update conversation tags - required: true - schema: - type: object - required: - - tags - properties: - tags: - type: array - description: Conversation tags - example: ["Meeting", "Holidays", "Work"] - responses: - '200': - description: successful operation - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - pages: - $ref: 'common.yaml#/components/properties/pagesProperty' - links: - $ref: 'common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/MessageTag' - '400': - description: Validation failed - '403': - description: You must be a participant of the conversation. - '404': - description: Message not found! - '500': - description: Internal error while update tags of the conversation! - -definitions: - Message: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 23 - title: - type: string - example: Hi guys! - created_at: - type: string - format: datetime - example: 2020-10-28 10:16:34 - created_by: - type: integer - example: 1 - updated_at: - type: string - format: datetime - example: 2020-10-28 10:17:22 - updated_by: - type: integer - example: 2 - MessageEntry: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 23 - user_id: - type: integer - format: int64 - readOnly: true - example: 1 - file_id: - type: integer - format: int64 - readOnly: true - example: null - content: - type: string - example: Sample message - created_at: - type: string - format: datetime - example: 2020-10-28 10:16:34 - created_by: - type: integer - example: 1 - updated_at: - type: string - format: datetime - example: 2020-10-28 10:17:22 - updated_by: - type: integer - example: 2 - MessageTag: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 12 - name: - type: string - example: Meeting - sort_order: - type: integer - example: 4 - color: - type: string - example: null \ No newline at end of file diff --git a/docs/swagger/poll.yaml b/docs/swagger/poll.yaml deleted file mode 100644 index d764763..0000000 --- a/docs/swagger/poll.yaml +++ /dev/null @@ -1,790 +0,0 @@ -swagger: '2.0' -info: - description: | - Welcome to the HumHub polls module API reference. - - version: 1.0.0 - title: HumHub - Polls API - contact: - email: info@humhub.com - license: - name: AGPLv2 - url: 'https://www.humhub.org/en/licences' -basePath: /api/v1 - -paths: - '/polls': - get: - tags: - - Polls - summary: Find all polls - description: '' - produces: - - application/json - - application/xml - parameters: - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - '200': - description: Success - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - pages: - $ref: 'common.yaml#/components/properties/pagesProperty' - links: - $ref: 'common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/Poll' - - '/polls/container/{id}': - get: - tags: - - Polls - summary: Find all polls by container - description: '' - produces: - - application/json - - application/xml - parameters: - - name: id - in: path - description: ID of content container - required: true - type: integer - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - 200: - description: Success - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - pages: - $ref: 'common.yaml#/components/properties/pagesProperty' - links: - $ref: 'common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/Poll' - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - - post: - tags: - - Poll - summary: Create new poll - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of content container - required: true - type: integer - - $ref: "#/definitions/PollNewParams" - responses: - 200: - description: Success - schema: - $ref: "#/definitions/Poll" - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to create a poll! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while save a poll! - - delete: - tags: - - Polls - summary: Delete polls by container - produces: - - application/json - parameters: - - name: id - in: path - description: The id of content container - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Records successfully deleted! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - - '/polls/poll/{id}': - get: - tags: - - Poll - summary: Get a poll by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the poll - required: true - type: integer - responses: - 200: - description: Success - schema: - $ref: "#/definitions/Poll" - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll not found - - put: - tags: - - Poll - summary: Update a poll by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the poll - required: true - type: integer - - $ref: "#/definitions/PollEditParams" - responses: - 200: - description: Success - schema: - $ref: "#/definitions/Poll" - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to update this poll! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll is not found! - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while update poll! - - delete: - tags: - - Poll - summary: Delete a poll by id - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the poll - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Successfully deleted! - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to delete this content! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content record not found! - 500: - description: Bad request - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while delete content! - -#----------------------------------------------------------------------------------------------------------------------- -# Begin Poll Management -#----------------------------------------------------------------------------------------------------------------------- - - '/polls/poll/{id}/close': - patch: - tags: - - Poll management - summary: Close a poll by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the poll - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Poll has been successfully closed. - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to close this poll! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll not found - 500: - description: Bad request - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while close this poll! - - '/polls/poll/{id}/open': - patch: - tags: - - Poll management - summary: Open a poll by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the poll - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Poll has been successfully reopened. - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to open this poll! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll is not found! - 500: - description: Bad request - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while open this poll! - -#----------------------------------------------------------------------------------------------------------------------- -# Begin Poll Voting -#----------------------------------------------------------------------------------------------------------------------- - - '/polls/vote/{id}': - put: - tags: - - Poll voting - summary: Vote on a poll by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the poll - required: true - type: integer - - name: body - in: body - required: true - schema: - type: object - required: - - status - properties: - answers: - type: array - description: Selected answers - items: - type: integer - example: - - 1 - - 4 - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: You have voted. - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: Voting for multiple answers is disabled! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll is not found! - - delete: - tags: - - Poll voting - summary: Reset vote on a poll by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the poll - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: You have reset your vote. - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: Voting for multiple answers is disabled! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll is not found! - - get: - tags: - - Poll voting - summary: Get votes on a poll for current user - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the poll - required: true - type: integer - responses: - 200: - description: Success - schema: - type: array - items: - type: integer - example: [11,13,24] - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Poll is not found! - -securityDefinitions: - $ref: "common.yaml#/securityDefinitions" - -definitions: - Poll: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 4 - contentcontainer_id: - type: integer - format: int64 - readOnly: true - example: 2 - question: - type: string - example: Poll question from API? - description: - type: string - example: Poll description from API - allow_multiple: - type: integer - format: int64 - example: 1 - created_at: - type: string - example: 2021-07-20 09:43:12 - created_by: - $ref: "user.yaml#/definitions/UserShort" - updated_at: - type: string - example: 2021-07-20 09:43:12 - updated_by: - $ref: "user.yaml#/definitions/UserShort" - is_random: - type: integer - format: int64 - example: 1 - closed: - type: integer - format: int64 - example: 1 - anonymous: - type: integer - format: int64 - example: 0 - show_result_after_close: - type: integer - format: int64 - example: 0 - answers: - type: array - items: - $ref: "#/definitions/Answer" - - Answer: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 1 - poll_id: - type: integer - format: int64 - readOnly: true - example: 4 - answer: - type: string - example: First answer text - created_at: - type: string - example: 2021-07-20 10:43:12 - created_by: - $ref: "user.yaml#/definitions/UserShort" - updated_at: - type: string - example: 2021-07-20 10:43:12 - updated_by: - $ref: "user.yaml#/definitions/UserShort" - - PollNewParams: - in: body - name: body - required: true - description: Poll information - schema: - type: object - required: - - Poll - - newAnswers - properties: - Poll: - type: object - required: - - question - properties: - question: - type: string - example: New question from API? - description: - type: string - example: New description from API? - allow_multiple: - type: integer - format: int64 - example: 0 - is_random: - type: integer - format: int64 - example: 1 - anonymous: - type: integer - format: int64 - example: 0 - show_result_after_close: - type: integer - format: int64 - example: 0 - newAnswers: - type: array - description: New answers - items: - type: string - example: - - "First answer" - - "Second answer" - - "Third answer" - - PollEditParams: - in: body - name: body - required: true - description: Poll information - schema: - type: object - required: - - Poll - - newAnswers - properties: - Poll: - type: object - required: - - question - properties: - question: - type: string - example: New question from API? - description: - type: string - example: New description from API? - allow_multiple: - type: integer - format: int64 - example: 0 - is_random: - type: integer - format: int64 - example: 1 - anonymous: - type: integer - format: int64 - example: 0 - show_result_after_close: - type: integer - format: int64 - example: 0 - answers: - type: array - description: Updating answers - items: - type: string - example: - - "1": "Updated first answer" - - "2": "Updated second answer" - - "3": "Updated third answer" - newAnswers: - type: array - description: New answers - items: - type: string - example: - - "Fourth answer" - - "Fifth answer" \ No newline at end of file diff --git a/docs/swagger/task.yaml b/docs/swagger/task.yaml deleted file mode 100644 index 00e8572..0000000 --- a/docs/swagger/task.yaml +++ /dev/null @@ -1,1116 +0,0 @@ -swagger: '2.0' -info: - description: | - Welcome to the HumHub tasks module API reference. - - version: 1.0.0 - title: HumHub - Tasks API - contact: - email: info@humhub.com - license: - name: AGPLv2 - url: 'https://www.humhub.org/en/licences' -basePath: /api/v1 - -paths: - '/tasks': - get: - tags: - - Tasks - summary: Find all tasks - description: '' - produces: - - application/json - - application/xml - parameters: - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - '200': - description: Success - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - pages: - $ref: 'common.yaml#/components/properties/pagesProperty' - links: - $ref: 'common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/Task' - - '/tasks/container/{id}': - get: - tags: - - Tasks - summary: Find all tasks by container - description: '' - produces: - - application/json - - application/xml - parameters: - - name: id - in: path - description: ID of content container - required: true - type: integer - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - 200: - description: Success - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - pages: - $ref: 'common.yaml#/components/properties/pagesProperty' - links: - $ref: 'common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/Task' - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - - post: - tags: - - Task - summary: Create new task - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of content container - required: true - type: integer - - $ref: "#/definitions/TaskParams" - responses: - 200: - description: Success - schema: - $ref: "#/definitions/Task" - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to create task! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while save valid task! - - delete: - tags: - - Tasks - summary: Deletes a tasks by container - produces: - - application/json - parameters: - - name: id - in: path - description: The id of content container - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Records successfully deleted! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - - '/tasks/task/{id}': - get: - tags: - - Task - summary: Get task by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the task - required: true - type: integer - responses: - 200: - description: Success - schema: - $ref: "#/definitions/Task" - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Task not found - - put: - tags: - - Task - summary: Update task by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the task - required: true - type: integer - - $ref: "#/definitions/TaskParams" - responses: - 200: - description: Success - schema: - $ref: "#/definitions/Task" - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to edit this task! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Task not found - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while update task! - - delete: - tags: - - Task - summary: Delete the task by id - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the task - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Task successfully deleted! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Task not found - -#----------------------------------------------------------------------------------------------------------------------- -# Begin Task Management -#----------------------------------------------------------------------------------------------------------------------- - - '/tasks/task/{id}/processed': - patch: - tags: - - Task management - summary: Change task status - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the task - required: true - type: integer - - name: body - in: body - required: true - schema: - type: object - required: - - status - properties: - title: - type: integer - format: int64 - enum: [1,2,3,5] - example: 2 - description: > - Participant type: - * 1 - pending. - * 2 - in progress. - * 3 - pending review. - * 5 - completed. - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Status successfully changed. - 400: - description: Bad request - schema: - type: object - properties: - code: - type: integer - example: 400 - message: - type: string - example: Invalid status! - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to change status of this task! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Task not found - - '/tasks/task/{id}/revert': - patch: - tags: - - Task management - summary: Revert task - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the task - required: true - type: integer - - name: body - in: body - required: true - schema: - type: object - required: - - status - properties: - title: - type: integer - format: int64 - enum: [1,2,3,4] - example: 2 - description: > - Participant type: - * 1 - pending. - * 2 - in progress. - * 3 - pending review. - * 4 - completed. - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Task successfully reverted. - 400: - description: Bad request - schema: - type: object - properties: - code: - type: integer - example: 400 - message: - type: string - example: Invalid status! - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: You are not allowed to revert this task! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Task not found - - '/tasks/task/{id}/upload-files': - post: - tags: - - Task management - summary: Attach files to task - description: '' - produces: - - application/json - consumes: - - multipart/form-data - parameters: - - in: path - name: id - description: The id of the task - required: true - type: integer - - in: formData - name: files - type: array - required: true - description: The files to upload. - items: - type: file - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Files successfully uploaded. - 400: - description: Bad Request - schema: - type: object - properties: - code: - type: integer - example: 400 - message: - type: string - example: No files to upload. - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content record not found! - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while saving file. - - '/tasks/task/{id}/remove-file/{fileId}': - delete: - tags: - - Task management - summary: Remove file from task - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of the task - required: true - type: integer - - in: path - name: fileId - required: true - description: The id of file to remove. - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: File successfully removed. - 403: - description: Forbidden - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: Insufficient permissions! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Could not find requested content record or file! - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while removing file. - -#----------------------------------------------------------------------------------------------------------------------- -# Begin Task List -#----------------------------------------------------------------------------------------------------------------------- - - '/tasks/lists/container/{id}': - get: - tags: - - Task List - summary: Find all task lists by container - description: '' - produces: - - application/json - - application/xml - parameters: - - name: id - in: path - description: ID of content container - required: true - type: integer - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - 200: - description: Success - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - pages: - $ref: 'common.yaml#/components/properties/pagesProperty' - links: - $ref: 'common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/TaskList' - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - - post: - tags: - - Task List - summary: Create new task list - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of content container - required: true - type: integer - - $ref: "#/definitions/TaskListParams" - responses: - 200: - description: Success - schema: - $ref: "#/definitions/TaskList" - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while save valid task list! - - '/tasks/list/{id}': - get: - tags: - - Task List - summary: Get task list by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the task list - required: true - type: integer - responses: - 200: - description: Success - schema: - $ref: "#/definitions/TaskList" - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Task list not found - - put: - tags: - - Task List - summary: Update task list by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the task list - required: true - type: integer - - $ref: "#/definitions/TaskListParams" - responses: - 200: - description: Success - schema: - $ref: "#/definitions/TaskList" - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Task list not found - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while update task list! - - delete: - tags: - - Task List - summary: Delete the task list by id - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the task list - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Task list successfully deleted! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Task list not found - -securityDefinitions: - $ref: "common.yaml#/securityDefinitions" - -definitions: - Task: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 6 - title: - type: string - example: Space task by API - description: - type: string - example: Space task by API description - status: - type: integer - format: int64 - example: 1 - start_datetime: - type: string - format: datetime - example: "2019-02-27 10:00:00" - end_datetime: - type: string - format: datetime - example: "2019-02-28 17:59:00" - scheduling: - type: integer - format: int64 - example: 1 - all_day: - type: integer - format: int64 - example: 0 - reminders: - type: array - items: - $ref: "#/definitions/Reminder" - max_users: - type: integer - format: int64 - example: null - color: - type: string - example: null - task_list: - type: object - $ref: "#/definitions/TaskList" - cal_mode: - type: integer - format: int64 - example: 1 - review: - type: integer - format: int64 - example: 1 - created_at: - type: string - example: 2019-03-05 15:35:02 - created_by: - $ref: "user.yaml#/definitions/UserShort" - content: - $ref: "content.yaml#/definitions/Content" - percentage: - type: integer - format: int64 - example: 0 - checklist: - type: array - items: - $ref: "#/definitions/Checklist" - assigned_users: - type: array - items: - $ref: "user.yaml#/definitions/UserShort" - responsible_users: - type: array - items: - $ref: "user.yaml#/definitions/UserShort" - - TaskParams: - in: body - name: body - required: true - description: Task information - schema: - type: object - required: - - Task - - TaskForm - properties: - Task: - type: object - required: - - title - properties: - title: - type: string - example: New task by api - description: - type: string - example: Api task description - task_list_id: - type: integer - format: int64 - example: 9 - scheduling: - type: integer - format: int64 - example: 1 - all_day: - type: integer - format: int64 - example: 0 - selectedReminders: - type: array - description: Id's of reminder mode - items: - type: integer - format: int64 - example: - - 1 - - 4 - cal_mode: - type: integer - format: int64 - example: 1 - description: Add schedule to the space calendar - assignedUsers: - type: array - description: guid's of user - items: - type: string - example: - - ad82fbfa-9621-489f-993a-0cf6d8be5747 - - 231acc8c-a8f5-4450-8b96-f670ffc1496b - responsibleUsers: - type: array - description: guid's of user - items: - type: string - example: - - ad82fbfa-9621-489f-993a-0cf6d8be5747 - review: - type: integer - format: int64 - example: 1 - description: Review by responsible user - TaskForm: - type: object - required: - - start_date - - end_date - - start_time - - end_time - properties: - is_public: - type: integer - format: int64 - example: 1 - start_date: - type: string - format: date - description: Required if Task scheduling param is set - example: "2019-03-23" - start_time: - type: string - description: Required if Task scheduling param is set and Task all_day param isn't set - example: "10:00" - end_date: - type: string - format: date - description: Required if Task scheduling param is set - example: "2019-03-25" - end_time: - type: string - description: Required if Task scheduling param is set and Task all_day param isn't set - example: "20:30" - timeZone: - type: string - example: America/Los_Angeles - newItems: - type: array - description: Checklist items - items: - type: string - example: - - first item - - second item - - TaskListParams: - in: body - name: body - required: true - description: Task list information - schema: - type: object - required: - - TaskList - - TaskListSettings - properties: - TaskList: - type: object - required: - - title - properties: - name: - type: string - example: New task list by api - color: - type: string - example: "#6fdbe8" - TaskListSettings: - type: object - properties: - hide_if_completed: - type: integer - format: int64 - default: 1 - example: 1 - - Checklist: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 14 - task_id: - type: integer - format: int64 - example: 6 - title: - type: string - example: first item - description: - type: string - example: item description - completed: - type: integer - format: int64 - example: 0 - sort_order: - type: integer - format: int64 - example: 0 - - Reminder: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 14 - task_id: - type: integer - format: int64 - example: 6 - reminder_mode: - type: integer - format: int64 - example: 3 - start_reminder_sent: - type: integer - format: int64 - example: 0 - end_reminder_sent: - type: integer - format: int64 - example: 0 - - TaskList: - type: object - properties: - id: - type: integer - format: int64 - example: 9 - name: - type: string - example: Task list name - contentcontainer_id: - type: integer - format: int64 - example: 2 - parent_id: - type: integer - format: int64 - example: null - color: - type: string - example: "#d1ad0e" - settings: - type: object - properties: - hide_if_completed: - type: integer - format: int64 - example: 1 - sort_order: - type: integer - format: int64 - example: 0 diff --git a/docs/swagger/wiki.yaml b/docs/swagger/wiki.yaml deleted file mode 100644 index 89afb5f..0000000 --- a/docs/swagger/wiki.yaml +++ /dev/null @@ -1,705 +0,0 @@ -swagger: '2.0' -info: - description: | - Welcome to the HumHub wiki module API reference. - - version: 1.0.0 - title: HumHub - Wiki API - contact: - email: info@humhub.com - license: - name: AGPLv2 - url: 'https://www.humhub.org/en/licences' -basePath: /api/v1 - -paths: - '/wiki': - get: - tags: - - Wiki - summary: Find all wiki pages - description: '' - produces: - - application/json - - application/xml - parameters: - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - '200': - description: Success - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - results: - type: array - items: - $ref: '#/definitions/WikiPage' - - '/wiki/container/{id}': - get: - tags: - - Wiki - summary: Find all wiki pages by container - description: '' - produces: - - application/json - - application/xml - parameters: - - name: id - in: path - description: ID of content container - required: true - type: integer - - $ref: 'content.yaml#/components/parameters/topicsParam' - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - 200: - description: Success - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - results: - type: array - items: - $ref: '#/definitions/WikiPage' - - post: - tags: - - Wiki Page - summary: Create new wiki page - description: '' - produces: - - application/json - parameters: - - in: path - name: id - description: The id of content container - required: true - type: integer - - $ref: "#/definitions/WikiPageParams" - responses: - 200: - description: Success - schema: - $ref: "#/definitions/WikiPage" - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while save valid wiki page! - - delete: - tags: - - Wiki - summary: Deletes a wiki pages by container - produces: - - application/json - parameters: - - name: id - in: path - description: The id of content container - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Records successfully deleted! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Content container not found! - - - '/wiki/page/{id}': - get: - tags: - - Wiki Page - summary: Get wiki page by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the wiki page - required: true - type: integer - responses: - 200: - description: Success - schema: - $ref: "#/definitions/WikiPage" - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Requested content not found! - - put: - tags: - - Wiki Page - summary: Update wiki page by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the wiki page - required: true - type: integer - - $ref: "#/definitions/WikiPageParams" - responses: - 200: - description: Success - schema: - $ref: "#/definitions/WikiPage" - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Page not found! - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while update wiki page! - - delete: - tags: - - Wiki Page - summary: Deletes a wiki page by id - produces: - - application/json - parameters: - - name: id - in: path - description: The id of wiki page - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Successfully deleted! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - description: Content record not found! - -#----------------------------------------------------------------------------------------------------------------------- -# Begin Wiki Page Management -#----------------------------------------------------------------------------------------------------------------------- - - '/wiki/page/{id}/change-index': - patch: - tags: - - Wiki Page Management - summary: Move page to another category - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the wiki page - required: true - type: integer - - name: body - in: body - required: true - schema: - type: object - required: - - target_id - properties: - target_id: - type: integer - format: int64 - example: 2 - description: Wiki page category id - index: - type: integer - format: int64 - default: 0 - example: 2 - description: Index for order - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Wiki page successfully moved! - 400: - description: Bad request - schema: - type: object - properties: - code: - type: integer - example: 400 - message: - type: string - example: Wrong target category. - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Page not found! - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while change wiki page index! - - '/wiki/page/{id}/move': - patch: - tags: - - Wiki Page Management - summary: Move page to another space - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the wiki page - required: true - type: integer - - name: body - in: body - required: true - schema: - type: object - required: - - target - properties: - target: - type: string - example: c1c1c7dc-8197-471b-b5fe-2c12b183623a - description: Guid of target space container - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Wiki page successfully moved! - 400: - description: Bad request - schema: - type: object - properties: - code: - type: integer - example: 400 - message: - type: string - example: Target content container guid is required! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Page not found! - 422: - description: Validation failed - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 500 - message: - type: string - example: Internal error while move wiki page! - -#----------------------------------------------------------------------------------------------------------------------- -# Begin Wiki Page Revision -#----------------------------------------------------------------------------------------------------------------------- - - '/wiki/page/{pageId}/revisions': - get: - tags: - - Wiki Page Revision - summary: Find all revisions for page - description: '' - produces: - - application/json - parameters: - - name: pageId - in: path - description: ID of wiki page - required: true - type: integer - - $ref: 'common.yaml#/components/parameters/pageParam' - - $ref: 'common.yaml#/components/parameters/limitParam' - responses: - 200: - description: Success - schema: - type: object - properties: - total: - $ref: 'common.yaml#/components/properties/totalProperty' - page: - $ref: 'common.yaml#/components/properties/pageProperty' - pages: - $ref: 'common.yaml#/components/properties/pagesProperty' - links: - $ref: 'common.yaml#/components/properties/linksProperty' - results: - type: array - items: - $ref: '#/definitions/WikiPageRevision' - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Page not found! - - '/wiki/revision/{id}': - get: - tags: - - Wiki Page Revision - summary: Get revision by id - description: '' - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the revision - required: true - type: integer - responses: - 200: - description: Success - schema: - $ref: "#/definitions/WikiPageRevision" - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Wiki page revision not found! - - '/wiki/revision/{id}/revert': - patch: - tags: - - Wiki Page Revision - summary: Revert page by revision id - produces: - - application/json - parameters: - - name: id - in: path - description: The id of the revision - required: true - type: integer - responses: - 200: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 200 - message: - type: string - example: Wiki page revision successfully reverted - 400: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 400 - message: - type: string - example: Revert not possible. Already latest revision! - 403: - description: Success - schema: - type: object - properties: - code: - type: integer - example: 403 - message: - type: string - example: Page not editable! - 404: - description: Not found - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Wiki page revision not found! - 500: - description: Internal server error - schema: - type: object - properties: - code: - type: integer - example: 404 - message: - type: string - example: Internal error while revert wiki page! - - -securityDefinitions: - $ref: "common.yaml#/securityDefinitions" - -definitions: - WikiPage: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 201 - title: - type: string - example: "Some Wikipage title" - is_home: - type: integer - format: int64 - example: 1 - admin_only: - type: integer - format: int64 - example: 1 - is_category: - type: integer - format: int64 - example: 0 - parent_page_id: - type: integer - format: int64 - example: null - permalink: - type: string - example: http://localhost/content/perma?id=609 - latest_revision: - readOnly: true - $ref: "#/definitions/WikiPageRevision" - content: - $ref: "content.yaml#/definitions/Content" - - WikiPageRevision: - type: object - properties: - id: - type: integer - format: int64 - readOnly: true - example: 2424 - revision: - type: integer - format: int64 - readOnly: true - example: 1534454147 - is_latest: - type: integer - format: int64 - readOnly: true - example: 1 - wiki_page_id: - type: integer - format: int64 - readOnly: true - example: 201 - created_by: - readOnly: true - $ref: "user.yaml#/definitions/UserShort" - message: - type: string - example: "The wiki page content in markdown." - - WikiPageParams: - in: body - name: body - required: true - description: Wiki page information - schema: - type: object - required: - - WikiPage - - WikiPageRevision - properties: - WikiPage: - type: object - required: - - title - properties: - title: - type: string - example: First api page - is_home: - type: integer - format: int64 - example: 0 - admin_only: - type: integer - format: int64 - example: 0 - is_category: - type: integer - format: int64 - example: 0 - parent_page_id: - type: integer - format: int64 - example: 0 - WikiPageRevision: - type: object - required: - - content - properties: - content: - type: string - example: First api page content - PageEditForm: - type: object - properties: - is_public: - type: integer - format: int64 - example: 0 - topics: - type: array - description: Topic id's - items: - type: integer - format: int64 - example: - - 2 - - 8 \ No newline at end of file From 3865a2e567bb0d25be7d1b375042e8cbeae18f1b Mon Sep 17 00:00:00 2001 From: Lucas Bartholemy Date: Tue, 20 Jul 2021 14:44:33 +0200 Subject: [PATCH 5/5] Update MANUAL.md --- docs/MANUAL.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/MANUAL.md b/docs/MANUAL.md index 61278d6..9e2d145 100644 --- a/docs/MANUAL.md +++ b/docs/MANUAL.md @@ -30,7 +30,7 @@ The base url for all APIs is: `https://yourhost/api/v1/` - [Tasks](https://www.humhub.com/en/marketplace/tasks/docs/swagger/task.html) - [Wiki](https://www.humhub.com/en/marketplace/wiki/docs/swagger/wiki.html) - [Mail](https://www.humhub.com/en/marketplace/mail/docs/swagger/mail.html) -- [Polls](https://www.humhub.com/en/marketplace/polls/docs/swagger/mail.html) +- [Polls](https://www.humhub.com/en/marketplace/polls/docs/swagger/polls.html) The folder `/docs/html`contains HTML rendered documentations for all available API endpoints.