Skip to content

Instantly share code, notes, and snippets.

@eiel
Created May 14, 2018 04:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eiel/f06eb07a8c741839417a63202ade787e to your computer and use it in GitHub Desktop.
Save eiel/f06eb07a8c741839417a63202ade787e to your computer and use it in GitHub Desktop.
openapi: 3.0.0
servers:
- url: 'https://api.chatwork.com/v2'
info:
title: ChatWork API
version: "v2-oas3"
paths:
/contacts:
get:
responses:
'200':
description: OK
content:
'*/*':
schema:
items:
properties:
account_id:
type: integer
avatar_image_url:
type: string
chatwork_id:
type: string
department:
type: string
name:
type: string
organization_id:
type: integer
organization_name:
type: string
room_id:
type: integer
type: object
required:
- account_id
- room_id
- name
- chatwork_id
- organization_id
- organization_name
- department
- avatar_image_url
type: array
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: 自分のコンタクト一覧を取得
/incoming_requests:
get:
responses:
'200':
description: OK
content:
'*/*':
schema:
items:
properties:
account_id:
type: integer
avatar_image_url:
type: string
chatwork_id:
type: string
department:
type: string
message:
type: string
name:
type: string
organization_id:
type: integer
organization_name:
type: string
request_id:
type: integer
required:
- request_id
- account_id
- message
- name
- chatwork_id
- organization_id
- organization_name
- department
- avatar_image_url
type: object
type: array
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: 自分に対するコンタクト承認依頼一覧を取得する(※100件まで取得可能。今後、より多くのデータを取得する為のページネーションの仕組みを提供予定)
'/incoming_requests/{request_id}':
delete:
parameters:
- in: path
name: request_id
required: true
schema:
type: integer
responses:
'204':
description: No Content
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: 自分に対するコンタクト承認依頼をキャンセルする
put:
parameters:
- in: path
name: request_id
required: true
schema:
type: integer
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
account_id:
type: integer
avatar_image_url:
type: string
chatwork_id:
type: string
department:
type: string
name:
type: string
organization_id:
type: integer
organization_name:
type: string
room_id:
type: integer
required:
- account_id
- room_id
- name
- chatwork_id
- organization_id
- organization_name
- department
- avatar_image_url
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: 自分に対するコンタクト承認依頼を承認する
/me:
get:
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
account_id:
type: integer
avatar_image_url:
type: string
chatwork_id:
type: string
department:
type: string
facebook:
type: string
introduction:
type: string
login_mail:
type: string
mail:
type: string
name:
type: string
organization_id:
type: integer
organization_name:
type: string
room_id:
type: integer
skype:
type: string
tel_extension:
type: string
tel_mobile:
type: string
tel_organization:
type: string
title:
type: string
twitter:
type: string
url:
type: string
required:
- account_id
- room_id
- name
- chatwork_id
- organization_id
- organization_name
- department
- title
- url
- introduction
- mail
- tel_organization
- tel_extension
- tel_mobile
- skype
- facebook
- twitter
- avatar_image_url
- login_mail
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: 自分自身の情報を取得
/my/status:
get:
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
mention_num:
type: integer
mention_room_num:
type: integer
mytask_num:
type: integer
mytask_room_num:
type: integer
unread_num:
type: integer
unread_room_num:
type: integer
required:
- unread_room_num
- mention_room_num
- mytask_room_num
- unread_num
- mention_num
- mytask_num
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: 自分の未読数、未読To数、未完了タスク数を返す
/my/tasks:
get:
parameters:
- in: query
name: assigned_by_account_id
schema:
type: integer
- in: query
name: status
schema:
type: string
enum:
- open
- done
default: open
responses:
'200':
description: OK
content:
'*/*':
schema:
items:
properties:
assigned_by_account:
properties:
account_id:
type: integer
avatar_image_url:
type: string
name:
type: string
required:
- account_id
- name
- avatar_image_url
type: object
body:
type: string
limit_time:
type: integer
message_id:
type: string
room:
properties:
icon_path:
type: string
name:
type: string
room_id:
type: integer
required:
- room_id
- name
- icon_path
type: object
status:
enum:
- open
- done
type: string
task_id:
type: integer
required:
- task_id
- room
- assigned_by_account
- message_id
- body
- limit_time
- status
type: object
type: array
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: 自分のタスク一覧を取得する。(※100件まで取得可能。今後、より多くのデータを取得する為のページネーションの仕組みを提供予定)
/rooms:
get:
responses:
'200':
description: OK
content:
'*/*':
schema:
items:
properties:
file_num:
type: integer
icon_path:
type: string
last_update_time:
type: integer
mention_num:
type: integer
message_num:
type: integer
mytask_num:
type: integer
name:
type: string
role:
enum:
- admin
- member
- readonly
type: string
room_id:
type: integer
sticky:
type: boolean
task_num:
type: integer
type:
enum:
- my
- direct
- group
type: string
unread_num:
type: integer
required:
- room_id
- name
- type
- role
- sticky
- unread_num
- mention_num
- mytask_num
- message_num
- file_num
- task_num
- icon_path
- last_update_time
type: object
type: array
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: 自分のチャット一覧の取得
post:
parameters:
- description: グループチャットのアイコン種類
in: query
name: icon_preset
schema:
type: string
enum:
- group
- check
- document
- meeting
- event
- project
- business
- study
- security
- star
- idea
- heart
- magcup
- beer
- music
- sports
- travel
- description: >
[string-list:type=integer]作成したチャットに参加メンバーのうち、管理者権限にしたいユーザーのアカウントIDの配列。最低1人は指定する必要がある。
in: query
name: members_admin_ids
required: true
schema:
type: string
- description: >
[string-list:type=integer]作成したチャットに参加メンバーのうち、メンバー権限にしたいユーザーのアカウントIDの配列。
in: query
name: members_member_ids
schema:
type: string
- description: >
[string-list:type=integer]作成したチャットに参加メンバーのうち、閲覧のみ権限にしたいユーザーのアカウントIDの配列。
in: query
name: members_readonly_ids
schema:
type: string
- description: 作成したいグループチャットのチャット名
in: query
name: name
required: true
schema:
type: string
minLength: 1
maxLength: 255
- description: グループチャットの概要説明テキスト
in: query
name: description
schema:
type: string
- description: 招待リンクを作成するか
in: query
name: link
required: false
schema:
type: boolean
default: false
- description: リンクのパス部分。省略するとランダムな文字列となる。
in: query
name: link_code
required: false
schema:
type: string
minLength: 1
maxLength: 50
pattern: '^[A-Za-z0-9_-]+$'
- description: 参加に管理者の承認を必要とするか。
in: query
name: link_need_acceptance
required: false
schema:
type: boolean
default: true
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
room_id:
type: integer
required:
- room_id
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: グループチャットを新規作成
'/rooms/{room_id}':
delete:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- description: |
退席すると、このグループチャットにある自分が担当のタスク、および自分が送信したファイルは削除されます。
削除すると、このグループチャットに参加しているメンバー全員のメッセージ、タスク、ファイルはすべて削除されます。
※一度削除すると元に戻せません!
in: query
name: action_type
required: true
schema:
type: string
enum:
- leave
- delete
responses:
'204':
description: No Content
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: グループチャットを退席/削除する
get:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
description:
type: string
file_num:
type: integer
icon_path:
type: string
last_update_time:
type: integer
mention_num:
type: integer
message_num:
type: integer
mytask_num:
type: integer
name:
type: string
role:
enum:
- admin
- member
- readonly
type: string
room_id:
type: integer
sticky:
type: boolean
task_num:
type: integer
type:
enum:
- my
- direct
- group
type: string
unread_num:
type: integer
required:
- room_id
- name
- type
- role
- sticky
- unread_num
- mention_num
- mytask_num
- message_num
- file_num
- task_num
- icon_path
- last_update_time
- description
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: チャットの名前、アイコン、種類(my/direct/group)を取得
put:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- description: グループチャットのアイコン種類
in: query
name: icon_preset
schema:
type: string
enum:
- group
- check
- document
- meeting
- event
- project
- business
- study
- security
- star
- idea
- heart
- magcup
- beer
- music
- sports
- travel
- description: グループチャットのチャット名
in: query
name: name
schema:
type: string
minLength: 1
maxLength: 255
- description: グループチャットの概要説明テキスト
in: query
name: description
schema:
type: string
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
room_id:
type: integer
required:
- room_id
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: チャットの名前、アイコンをアップデート
'/rooms/{room_id}/files':
get:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- in: query
name: account_id
schema:
type: integer
responses:
'200':
description: OK
content:
'*/*':
schema:
items:
properties:
account:
properties:
account_id:
type: integer
avatar_image_url:
type: string
name:
type: string
required:
- account_id
- name
- avatar_image_url
type: object
file_id:
type: integer
filename:
type: string
filesize:
type: integer
message_id:
type: string
upload_time:
type: integer
required:
- file_id
- account
- message_id
- filename
- filesize
- upload_time
type: object
type: array
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: チャットのファイル一覧を取得 (※100件まで取得可能。今後、より多くのデータを取得する為のページネーションの仕組みを提供予定)
'/rooms/{room_id}/files/{file_id}':
get:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- in: path
name: file_id
required: true
schema:
type: integer
- description: 30秒間だけダウンロード可能なURLを生成します
in: query
name: create_download_url
schema:
type: boolean
default: false
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
account:
properties:
account_id:
type: integer
avatar_image_url:
type: string
name:
type: string
required:
- account_id
- name
- avatar_image_url
type: object
download_url:
type: string
file_id:
type: integer
filename:
type: string
filesize:
type: integer
message_id:
type: string
upload_time:
type: integer
required:
- file_id
- account
- message_id
- filename
- filesize
- upload_time
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: ファイル情報を取得
'/rooms/{room_id}/link':
delete:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
description:
type: string
need_acceptance:
type: boolean
public:
type: boolean
url:
type: string
required:
- public
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: 招待リンクを削除する
get:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
description:
type: string
need_acceptance:
type: boolean
public:
type: boolean
url:
type: string
required:
- public
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: 招待リンクを取得する
post:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- description: リンクのパス部分。省略するとランダムな文字列となる。
in: query
name: code
required: false
schema:
type: string
minLength: 1
maxLength: 50
pattern: '^[A-Za-z0-9_-]+$'
- description: 参加に管理者の承認を必要とするか。
in: query
name: need_acceptance
required: false
schema:
type: boolean
default: true
- description: リンクページに表示される説明文。
in: query
name: description
required: false
schema:
type: string
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
description:
type: string
need_acceptance:
type: boolean
public:
type: boolean
url:
type: string
required:
- public
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: 招待リンクを作成する
put:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- description: リンクのパス部分。省略するとランダムな文字列となる。
in: query
name: code
required: false
schema:
type: string
minLength: 1
maxLength: 50
pattern: '^[A-Za-z0-9_-]+$'
- description: 参加に管理者の承認を必要とするか。
in: query
name: need_acceptance
required: false
schema:
type: boolean
default: true
- description: リンクページに表示される説明文。
in: query
name: description
required: false
schema:
type: string
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
description:
type: string
need_acceptance:
type: boolean
public:
type: boolean
url:
type: string
required:
- public
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: 招待リンクの情報を変更する
'/rooms/{room_id}/members':
get:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
responses:
'200':
description: OK
content:
'*/*':
schema:
items:
properties:
account_id:
type: integer
avatar_image_url:
type: string
chatwork_id:
type: string
department:
type: string
name:
type: string
organization_id:
type: integer
organization_name:
type: string
role:
enum:
- admin
- member
- readonly
type: string
required:
- account_id
- role
- name
- chatwork_id
- organization_id
- organization_name
- department
- avatar_image_url
type: object
type: array
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: チャットのメンバー一覧を取得
put:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- description: >
[string-list:type=integer]作成したチャットに参加メンバーのうち、管理者権限にしたいユーザーのアカウントIDの配列。最低1人は指定する必要がある。
in: query
name: members_admin_ids
required: true
schema:
type: string
- description: >
[string-list:type=integer]作成したチャットに参加メンバーのうち、メンバー権限にしたいユーザーのアカウントIDの配列。
in: query
name: members_member_ids
schema:
type: string
- description: >
[string-list:type=integer]作成したチャットに参加メンバーのうち、閲覧のみ権限にしたいユーザーのアカウントIDの配列。
in: query
name: members_readonly_ids
schema:
type: string
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
admin:
items:
type: integer
type: array
member:
items:
type: integer
type: array
readonly:
items:
type: integer
type: array
required:
- admin
- member
- readonly
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: チャットのメンバーを一括変更
'/rooms/{room_id}/messages':
get:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- description: 1を指定すると未取得にかかわらず最新の100件を取得します(デフォルトは0)
in: query
name: force
schema:
type: boolean
default: false
responses:
'200':
description: OK
content:
'*/*':
schema:
items:
properties:
account:
properties:
account_id:
type: integer
avatar_image_url:
type: string
name:
type: string
required:
- account_id
- name
- avatar_image_url
type: object
body:
type: string
message_id:
type: string
send_time:
type: integer
update_time:
type: integer
required:
- message_id
- account
- body
- send_time
- update_time
type: object
type: array
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: |
チャットのメッセージ一覧を取得。パラメータ未指定だと前回取得分からの差分のみを返します。(最大100件まで取得)
post:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- in: query
name: body
required: true
schema:
type: string
minLength: 1
maxLength: 65535
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
message_id:
type: string
required:
- message_id
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: チャットに新しいメッセージを追加
'/rooms/{room_id}/messages/read':
put:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- in: query
name: message_id
schema:
type: string
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
mention_num:
type: integer
unread_num:
type: integer
required:
- unread_num
- mention_num
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: メッセージを既読にする
'/rooms/{room_id}/messages/unread':
put:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- in: query
name: message_id
required: true
schema:
type: string
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
mention_num:
type: integer
unread_num:
type: integer
required:
- unread_num
- mention_num
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: メッセージを未読にする
'/rooms/{room_id}/messages/{message_id}':
delete:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- in: path
name: message_id
required: true
schema:
type: integer
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
message_id:
type: string
required:
- message_id
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: メッセージを削除
get:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- in: path
name: message_id
required: true
schema:
type: integer
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
account:
properties:
account_id:
type: integer
avatar_image_url:
type: string
name:
type: string
required:
- account_id
- name
- avatar_image_url
type: object
body:
type: string
message_id:
type: string
send_time:
type: integer
update_time:
type: integer
required:
- message_id
- account
- body
- send_time
- update_time
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: メッセージ情報を取得
put:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- in: path
name: message_id
required: true
schema:
type: integer
- in: query
name: body
required: true
schema:
type: string
minLength: 1
maxLength: 65535
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
message_id:
type: string
required:
- message_id
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: チャットのメッセージを更新する。
'/rooms/{room_id}/tasks':
get:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- in: query
name: account_id
schema:
type: integer
- in: query
name: assigned_by_account_id
schema:
type: integer
- in: query
name: status
schema:
type: string
enum:
- open
- done
default: open
responses:
'200':
description: OK
content:
'*/*':
schema:
items:
properties:
account:
properties:
account_id:
type: integer
avatar_image_url:
type: string
name:
type: string
required:
- account_id
- name
- avatar_image_url
type: object
assigned_by_account:
properties:
account_id:
type: integer
avatar_image_url:
type: string
name:
type: string
required:
- account_id
- name
- avatar_image_url
type: object
body:
type: string
limit_time:
type: integer
message_id:
type: string
status:
enum:
- open
- done
type: string
task_id:
type: integer
required:
- task_id
- account
- assigned_by_account
- message_id
- body
- limit_time
- status
type: object
type: array
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: チャットのタスク一覧を取得 (※100件まで取得可能。今後、より多くのデータを取得する為のページネーションの仕組みを提供予定)
post:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- in: query
name: body
required: true
schema:
type: string
maxLength: 65535
- description: |
[string-list:type=integer]担当者のアカウントIDをカンマ区切りで
in: query
name: to_ids
required: true
schema:
type: string
- description: |
Unix timeで入力してください
in: query
name: limit
schema:
type: integer
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
task_ids:
items:
type: integer
type: array
required:
- task_ids
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: チャットに新しいタスクを追加
'/rooms/{room_id}/tasks/{task_id}':
get:
parameters:
- in: path
name: room_id
required: true
schema:
type: integer
- in: path
name: task_id
required: true
schema:
type: integer
responses:
'200':
description: OK
content:
'*/*':
schema:
properties:
account:
properties:
account_id:
type: integer
avatar_image_url:
type: string
name:
type: string
required:
- account_id
- name
- avatar_image_url
type: object
assigned_by_account:
properties:
account_id:
type: integer
avatar_image_url:
type: string
name:
type: string
required:
- account_id
- name
- avatar_image_url
type: object
body:
type: string
limit_time:
type: integer
message_id:
type: string
status:
enum:
- open
- done
type: string
task_id:
type: integer
required:
- task_id
- account
- assigned_by_account
- message_id
- body
- limit_time
- status
type: object
'401':
description: Unauthorized
content:
'*/*':
schema:
properties:
errors:
items:
type: string
type: array
type: object
description: タスク情報を取得
components:
schemas: {}
securitySchemes:
oauth_2_0:
description: |
チャットワークAPIはOAuth2.0 Bearer Token Usageをサポートしています。
type: oauth2
flows:
authorizationCode:
authorizationUrl: 'https://www.chatwork.com/packages/oauth2/login.php'
tokenUrl: 'https://oauth.chatwork.com/token'
scopes:
'users.all:read': ''
'rooms.all:read_write': ''
'contacts.all:read_write': ''
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment