2018-05-15 18:55:39 +02:00
|
|
|
# This file contains the API definitions for the Zulip REST API.
|
2017-05-22 18:33:53 +02:00
|
|
|
#
|
2018-05-15 18:55:39 +02:00
|
|
|
# For details on the OpenAPI specification, see http://swagger.io/specification
|
2017-02-24 03:39:44 +01:00
|
|
|
#
|
|
|
|
# Our own documentation lives at
|
|
|
|
#
|
2018-05-15 20:54:48 +02:00
|
|
|
# https://zulip.readthedocs.io/en/latest/subsystems/openapi-api-docs.html
|
2017-02-24 03:39:44 +01:00
|
|
|
#
|
2018-05-15 18:55:39 +02:00
|
|
|
|
|
|
|
openapi: 3.0.1
|
2017-05-22 18:33:53 +02:00
|
|
|
info:
|
2018-05-15 18:55:39 +02:00
|
|
|
version: 1.0.0
|
2017-05-22 18:33:53 +02:00
|
|
|
title: Zulip REST API
|
|
|
|
description: Powerful open source group chat
|
|
|
|
contact:
|
2018-05-15 18:55:39 +02:00
|
|
|
url: https://zulipchat.com
|
2017-05-22 18:33:53 +02:00
|
|
|
license:
|
|
|
|
name: Apache 2.0
|
|
|
|
url: https://www.apache.org/licenses/LICENSE-2.0.html
|
2018-05-15 18:55:39 +02:00
|
|
|
servers:
|
|
|
|
- url: 'https://your.zulip.server/api/v1'
|
2017-05-22 18:33:53 +02:00
|
|
|
|
2018-05-15 18:55:39 +02:00
|
|
|
#######################
|
2017-05-22 18:33:53 +02:00
|
|
|
# Endpoint definitions
|
2018-05-15 18:55:39 +02:00
|
|
|
#######################
|
2017-05-22 18:33:53 +02:00
|
|
|
paths:
|
2017-06-25 21:00:55 +02:00
|
|
|
/messages/{message_id}:
|
2017-06-25 16:50:27 +02:00
|
|
|
patch:
|
|
|
|
description: Edit a message that has already been sent.
|
|
|
|
parameters:
|
|
|
|
- name: message_id
|
|
|
|
in: path
|
2018-05-15 18:55:39 +02:00
|
|
|
description: The ID of the message that you wish to edit/update.
|
|
|
|
schema:
|
|
|
|
type: integer
|
|
|
|
example: 42
|
2017-06-25 16:50:27 +02:00
|
|
|
required: true
|
|
|
|
- name: subject
|
|
|
|
in: query
|
2018-05-15 18:55:39 +02:00
|
|
|
description: |
|
|
|
|
The topic of the message. Only required for stream messages.
|
|
|
|
Maximum length of 60 characters.
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
default:
|
|
|
|
example: Castle
|
2017-06-25 16:50:27 +02:00
|
|
|
- name: propagate_mode
|
|
|
|
in: query
|
|
|
|
description: |
|
2018-05-15 18:55:39 +02:00
|
|
|
Which message(s) should be edited: just the one indicated in
|
|
|
|
`message_id`, messages in the same topic that had been sent after
|
|
|
|
this one, or all of them.
|
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
enum:
|
|
|
|
- change_one
|
|
|
|
- change_later
|
|
|
|
- change_all
|
|
|
|
default: change_one
|
|
|
|
example: change_all
|
2017-06-25 16:50:27 +02:00
|
|
|
- name: content
|
|
|
|
in: query
|
2018-05-15 19:28:42 +02:00
|
|
|
description: |
|
|
|
|
The content of the message. Maximum message size of 10000 bytes.
|
2018-05-15 18:55:39 +02:00
|
|
|
schema:
|
|
|
|
type: string
|
|
|
|
example: Hello
|
2017-06-27 03:48:27 +02:00
|
|
|
security:
|
|
|
|
- basicAuth: []
|
|
|
|
responses:
|
|
|
|
'200':
|
2018-05-15 19:28:42 +02:00
|
|
|
description: Success
|
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/JsonSuccess'
|
2017-06-27 03:48:27 +02:00
|
|
|
'400':
|
|
|
|
description: Bad request.
|
2018-05-15 18:55:39 +02:00
|
|
|
content:
|
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
allOf:
|
|
|
|
- $ref: '#/components/schemas/JsonError'
|
|
|
|
- properties:
|
|
|
|
msg:
|
|
|
|
enum:
|
|
|
|
- Your organization has turned off message editing
|
|
|
|
- You don't have permission to edit this message
|
|
|
|
- The time limit for editing this message has past
|
|
|
|
- Nothing to change
|
|
|
|
- Topic can't be empty
|
2018-05-15 19:28:42 +02:00
|
|
|
- example:
|
|
|
|
{
|
|
|
|
"code": "BAD_REQUEST",
|
|
|
|
"msg": "You don't have permission to edit this message",
|
|
|
|
"result": "error"
|
|
|
|
}
|
2018-05-15 18:55:39 +02:00
|
|
|
components:
|
|
|
|
#######################
|
|
|
|
# Security definitions
|
|
|
|
#######################
|
|
|
|
securitySchemes:
|
|
|
|
BasicAuth:
|
|
|
|
type: http
|
|
|
|
scheme: basic
|
2017-06-27 03:48:27 +02:00
|
|
|
description: |
|
2018-05-15 18:55:39 +02:00
|
|
|
Basic authentication, with the user's email as the username, and the
|
|
|
|
API key as the password. The API key can be fetched using the
|
|
|
|
`/fetch_api_key` or `/dev_fetch_api_key` endpoints.
|
2018-05-15 19:28:42 +02:00
|
|
|
|
2018-05-15 18:55:39 +02:00
|
|
|
schemas:
|
|
|
|
JsonResponse:
|
|
|
|
type: object
|
|
|
|
properties:
|
2017-06-25 17:52:59 +02:00
|
|
|
result:
|
2017-05-24 05:22:50 +02:00
|
|
|
type: string
|
2018-05-15 18:55:39 +02:00
|
|
|
JsonSuccess:
|
|
|
|
allOf:
|
|
|
|
- $ref: '#/components/schemas/JsonResponse'
|
|
|
|
- required:
|
|
|
|
- result
|
|
|
|
- msg
|
|
|
|
- properties:
|
|
|
|
result:
|
|
|
|
enum:
|
|
|
|
- success
|
|
|
|
msg:
|
|
|
|
type: string
|
2018-05-15 19:28:42 +02:00
|
|
|
- example:
|
|
|
|
{
|
|
|
|
"msg": "",
|
|
|
|
"result": "success"
|
|
|
|
}
|
2018-05-15 18:55:39 +02:00
|
|
|
JsonError:
|
|
|
|
allOf:
|
|
|
|
- $ref: '#/components/schemas/JsonResponse'
|
|
|
|
- required:
|
|
|
|
- result
|
|
|
|
- msg
|
|
|
|
- properties:
|
|
|
|
result:
|
|
|
|
enum:
|
|
|
|
- error
|
|
|
|
msg:
|
|
|
|
type: string
|
|
|
|
|
|
|
|
###################
|
|
|
|
# Shared responses
|
|
|
|
###################
|
|
|
|
responses:
|
|
|
|
SimpleSuccess:
|
|
|
|
description: Success
|
2017-05-24 01:54:20 +02:00
|
|
|
content:
|
2018-05-15 18:55:39 +02:00
|
|
|
application/json:
|
|
|
|
schema:
|
|
|
|
$ref: '#/components/schemas/JsonSuccess'
|