api docs: Document the GET /messages/<message_id> endpoint.

This commit is contained in:
Yago González
2018-06-23 18:17:05 +02:00
committed by Tim Abbott
parent ab164ba740
commit 9575f1b51f
5 changed files with 125 additions and 27 deletions

View File

@@ -249,33 +249,6 @@ paths:
$ref: '#/definitions/MessageResponse'
/messages/{message_id}:
get:
description: Retrieve the content of a message.
parameters:
- name: message_id
in: path
description: ID of the message to be retrieved.
type: integer
required: true
security:
- basicAuth: []
responses:
'200':
description: Success.
schema:
type: object
required:
- msg
- result
- raw_content
properties:
msg:
type: string
result:
type: string
raw_content:
type: string
description: Body of the queried message.
patch:
description: Edit a message that has already been sent.
parameters:

View File

@@ -467,6 +467,42 @@ paths:
"result": "error"
}
/messages/{message_id}:
get:
description: Get the raw content of a message.
parameters:
- name: message_id
in: path
description: The target message's ID.
schema:
type: integer
example: 42
required: true
security:
- basicAuth: []
responses:
'200':
description: Success.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/JsonSuccess'
- properties:
raw_content:
type: string
description: The raw content of the message.
- example:
{
"raw_content": "**Don't** forget your towel!",
"result": "success",
"msg": ""
}
'400':
description: Bad request.
content:
application/json:
schema:
$ref: '#/components/schemas/InvalidMessageError'
patch:
description: Edit a message that has already been sent.
parameters:
@@ -1476,6 +1512,19 @@ components:
"queue_id": "1518820930:1",
"result": "error"
}
InvalidMessageError:
allOf:
- $ref: '#/components/schemas/JsonSuccess'
- properties:
raw_content:
type: string
description: The raw content of the message.
- example:
{
"msg": "Invalid message(s)",
"code": "BAD_REQUEST",
"result": "error"
}
NonExistingStreamError:
allOf:
- $ref: '#/components/schemas/CodedError'