Skip to content
Permalink
Browse files
Document incoming webhook APIs
  • Loading branch information
cometkim committed Nov 16, 2016
1 parent 0eab776 commit 1ae3314f0935eebba8c885d8969dcad72f801501
Showing with 111 additions and 0 deletions.
  1. +1 −0 Makefile
  2. +22 −0 source/definitions.yaml
  3. +88 −0 source/incoming-webhooks.yaml
@@ -13,6 +13,7 @@ build:
@cat $(SOURCE_DIR)/posts.yaml >> $(HTML_DIR)/mattermost-openapi.yaml
@cat $(SOURCE_DIR)/files.yaml >> $(HTML_DIR)/mattermost-openapi.yaml
@cat $(SOURCE_DIR)/preferences.yaml >> $(HTML_DIR)/mattermost-openapi.yaml
@cat $(SOURCE_DIR)/incoming-webhooks.yaml >> $(HTML_DIR)/mattermost-openapi.yaml
@cat $(SOURCE_DIR)/definitions.yaml >> $(HTML_DIR)/mattermost-openapi.yaml

@echo Complete
@@ -293,6 +293,28 @@ definitions:
items:
$ref: '#/definitions/User'

IncomingWebhook:
type: object
properties:
id:
description: The unique identifier for this incoming webhook
type: string
create_at:
type: integer
update_at:
type: integer
delete_at:
type: integer
channel_id:
description: The ID of a public channel or private group that receives the webhook payloads
type: string
description:
description: The description for this incoming webhook
type: string
display_name:
description: The display name for this incoming webhook
type: string

externalDocs:
description: Find out more about Mattermost
url: 'https://about.mattermost.com'
@@ -0,0 +1,88 @@
'/teams/{team_id}/hooks/incoming/list':
get:
tags:
- incoming-webhooks
summary: Get incoming webhooks for the team
paramaters:
- name: team_id
in: path
description: Team ID of incoming webhooks to return
required: true
type: string
responses:
'200':
description: The list of incoming webhooks
schema:
type: array
items:
$ref: '#/definitions/IncomingWebhook
'/teams/{team_id}/hooks/incoming/create':
post:
tags:
- incoming-webhooks
summary: Create a incoming webhook to team
parameters:
- name: team_id
in: path
description: Team ID the incoming webhook belong to
required: true
type: string
- in: body
name: body
description: Abbreviated incoming webhook object
required: true
schema:
type: object
required:
- channel_id
properties:
channel_id:
type: string
description: The ID of a public channel or private group that receives the webhook payloads
display_name:
type: string
description: The display name for this incoming webhook
description:
type: string
description: The description for this incoming webhook
responses:
'200':
description: Incoming webhook created successfully
schema:
$ref: '#/definitions/IncomingWebhook
'/teams/{team_id}/hooks/incoming/delete':
post:
tags:
- incoming-webhooks
summary: Delete a incoming webhook
parameters:
- name: team_id
in: path
description: Team ID of the incoming webhook
required: true
type: string
- in: body
name: body
description: The incoming webhook id object
required: true
schema:
type: object
required:
- id
properties:
id:
type: string
description: The ID of the incoming webhook to delete
responses:
'200':
description: The incoming webhook id that was successfully deleted.
schema:
type: object
required:
- id
properties:
id:
type: string
description: The incoming webhook ID

0 comments on commit 1ae3314

Please sign in to comment.