Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ChatWork APIのSwagger
swagger: '2.0'
info:
title: ChatWork API
version: v2
# the domain of the service
host: api.chatwork.com
# array of all schemes that your API supports
schemes:
- https
# will be prefixed to all paths
basePath: /v2
securityDefinitions:
APIKeyHeader:
type: apiKey
in: header
name: X-ChatWorkToken
security:
- APIKeyHeader: []
paths:
/me:
get:
summary: 自分自身の情報
description: |
自分自身の情報を取得
responses:
"200":
$ref: '#/responses/MyAccount'
"401":
$ref: '#/responses/Unauthorize'
tags:
- me
/my/status:
get:
summary: 自分の未読数、未読To数、未完了タスク数
description: 自分の未読数、未読To数、未完了タスク数を返す
responses:
"200":
$ref: '#/responses/MyStatus'
"401":
$ref: '#/responses/Unauthorize'
tags:
- my
/my/tasks:
get:
summary: 自分のタスク一覧を取得する。
description: |-
自分のタスク一覧を取得する。(※100件まで取得可能。今後、より多くのデータを取得する為のページネーションの仕組みを提供予定)
parameters:
- $ref: '#/parameters/AssignedByAccountId'
- $ref: '#/parameters/Status'
responses:
"200":
$ref: '#/responses/Tasks'
"401":
$ref: '#/responses/Unauthorize'
tags:
- my
- tasks
/contacts:
get:
summary: 自分のコンタクト一覧を取得
description: 自分のコンタクト一覧を取得
responses:
"200":
$ref: '#/responses/Accounts'
"401":
$ref: '#/responses/Unauthorize'
tags:
- contacts
/rooms:
get:
summary: 自分のチャット一覧の取得
description: 自分のチャット一覧の取得
responses:
"200":
$ref: '#/responses/Rooms'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
post:
summary: グループチャットを新規作成
description: グループチャットを新規作成
consumes:
- 'application/x-www-form-urlencoded'
parameters:
- name: description
type: string
description: ''
in: formData
- $ref: '#/parameters/IconPreset'
- $ref: '#/parameters/MembersAdminIds'
- $ref: '#/parameters/MembersMemberIds'
- $ref: '#/parameters/MembersReadonlyIds'
- name: name
type: string
in: formData
description: ''
required: true
responses:
"200":
$ref: '#/responses/RoomId'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
/rooms/{room_id}:
get:
summary: チャットの名前、アイコン、種類(my/direct/group)を取得
description: チャットの名前、アイコン、種類(my/direct/group)を取得
parameters:
- $ref: '#/parameters/RoomId'
responses:
"200":
$ref: '#/responses/Room'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
put:
summary: チャットの名前、アイコンをアップデート
description: チャットの名前、アイコンをアップデート
consumes:
- 'application/x-www-form-urlencoded'
parameters:
- $ref: '#/parameters/RoomId'
- name: description
type: string
in: formData
description: ''
- $ref: '#/parameters/IconPreset'
- name: name
type: string
in: formData
description: ''
responses:
"200":
$ref: '#/responses/Room'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
delete:
summary: グループチャットを退席/削除する
description: グループチャットを退席/削除する
parameters:
- $ref: '#/parameters/RoomId'
responses:
"200":
description: ''
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
/rooms/{room_id}/members:
get:
summary: チャットのメンバー一覧を取得
description: チャットのメンバー一覧を取得
parameters:
- $ref: '#/parameters/RoomId'
responses:
"200":
$ref: '#/responses/Members'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
- members
put:
summary: チャットのメンバーを一括変更
description: チャットのメンバーを一括変更
consumes:
- 'application/x-www-form-urlencoded'
parameters:
- $ref: '#/parameters/RoomId'
- $ref: '#/parameters/MembersAdminIds'
- $ref: '#/parameters/MembersMemberIds'
- $ref: '#/parameters/MembersReadonlyIds'
responses:
"200":
$ref: '#/responses/UpdateMembers'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
- members
/rooms/{room_id}/messages:
get:
summary: メッセージ情報を取得
description: メッセージ情報を取得
parameters:
- $ref: '#/parameters/RoomId'
- name: force
type: integer
in: query
description: ''
responses:
"200":
$ref: '#/responses/Messages'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
- messages
post:
summary: チャットに新しいメッセージを追加
description: チャットに新しいメッセージを追加
consumes:
- 'application/x-www-form-urlencoded'
parameters:
- $ref: '#/parameters/RoomId'
- name: body
type: integer
in: formData
required: true
description: ''
responses:
"200":
$ref: '#/responses/MessageId'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
- messages
/rooms/{room_id}/messages/{message_id}:
get:
summary: メッセージ情報を取得
description: メッセージ情報を取得
parameters:
- $ref: '#/parameters/RoomId'
- name: message_id
type: string
in: path
required: true
description: ''
responses:
"200":
$ref: '#/responses/Message'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
- messages
/rooms/{room_id}/tasks:
get:
summary: チャットのタスク一覧を取得
description: チャットのタスク一覧を取得 (※100件まで取得可能。今後、より多くのデータを取得する為のページネーションの仕組みを提供予定)
parameters:
- $ref: '#/parameters/RoomId'
- $ref: '#/parameters/AccountId'
- $ref: '#/parameters/AssignedByAccountId'
- $ref: '#/parameters/Status'
responses:
"200":
$ref: '#/responses/Tasks'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
- tasks
post:
summary: チャットに新しいタスクを追加
description: チャットに新しいタスクを追加
consumes:
- 'application/x-www-form-urlencoded'
parameters:
- $ref: '#/parameters/RoomId'
- name: body
type: integer
in: formData
required: true
description: 'タスクの内容'
- name: limit
type: integer
in: formData
description: 'タスクの期限'
- name: to_ids
type: array
items:
type: integer
in: formData
collectionFormat: csv
responses:
"200":
$ref: '#/responses/TaskIds'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
- tasks
/rooms/{room_id}/tasks/{task_id}:
get:
summary: タスク情報を取得
description: タスク情報を取得
parameters:
- $ref: '#/parameters/RoomId'
- name: task_id
type: integer
in: path
required: true
description: ''
responses:
"200":
$ref: '#/responses/Task'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
- tasks
/rooms/{room_id}/files:
get:
summary: チャットのファイル一覧を取得
description: チャットのファイル一覧を取得 (※100件まで取得可能。今後、より多くのデータを取得する為のページネーションの仕組みを提供予定)
parameters:
- $ref: '#/parameters/RoomId'
- $ref: '#/parameters/AccountId'
responses:
"200":
$ref: '#/responses/Files'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
- files
/rooms/{room_id}/files/{file_id}:
get:
summary: ファイル情報を取得
description: ファイル情報を取得
parameters:
- $ref: '#/parameters/RoomId'
- name: file_id
type: integer
in: path
required: true
description: ''
- name: create_download_url
type: integer
in: query
description: ''
responses:
"200":
$ref: '#/responses/File'
"401":
$ref: '#/responses/Unauthorize'
tags:
- rooms
- files
definitions:
Status:
type: string
enum:
- open
- done
Me:
type: object
properties:
account_id:
type: integer
room_id:
type: integer
name:
type: string
chatwork_id:
type: string
organization_id:
type: integer
organization_name:
type: string
department:
type: string
title:
type: string
url:
type: string
introduction:
type: string
mail:
type: string
tel_organization:
type: string
tel_extension:
type: string
tel_mobile:
type: string
skype:
type: string
facebook:
type: string
twitter:
type: string
avatar_image_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
Account:
type: object
properties:
account_id:
type: integer
room_id:
type: integer
name:
type: string
chatwork_id:
type: string
organization_id:
type: integer
organization_name:
type: string
department:
type: string
avatar_image_url:
type: string
required:
- account_id
- room_id
- name
- chatwork_id
- organization_id
- organization_name
- department
- avatar_image_url
AccountSummary:
type: object
properties:
account_id:
type: integer
name:
type: string
avatar_image_url:
type: string
required:
- account_id
- name
- avatar_image_url
File:
type: object
properties:
file_id:
type: integer
account:
$ref: '#/definitions/Account'
message_id:
type: string
filename:
type: string
filesize:
type: integer
upload_time:
type: integer
required:
- file_id
- account
- message_id
- filename
- filesize
- upload_time
RoomSummary:
type: object
properties:
room_id:
type: integer
name:
type: string
icon_path:
type: string
required:
- room_id
- name
- icon_path
Message:
type: object
properties:
message_id:
type: string
account:
$ref: '#/definitions/Account'
body:
type: string
send_time:
type: integer
update_time:
type: integer
required:
- message_id
- account
- body
- send_time
- update_time
Task:
type: object
properties:
task_id:
type: integer
room:
$ref: '#/definitions/RoomSummary'
assigned_by_account:
$ref: '#/definitions/AccountSummary'
message_id:
type: string
body:
type: string
limit_time:
type: integer
status:
$ref: '#/definitions/Status'
required:
- task_id
- room
- assigned_by_account
- message_id
- body
- limit_time
- status
Room:
type: object
properties:
room_id:
type: integer
name:
type: string
type:
type: string
enum:
- my
- direct
- group
role:
type: string
sticky:
type: boolean
unread_num:
type: integer
mention_num:
type: integer
mytask_num:
type: integer
message_num:
type: integer
file_num:
type: integer
task_num:
type: integer
icon_path:
type: string
last_update_time:
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
Member:
type: object
properties:
account_id:
type: integer
role:
type: string
name:
type: string
chatwork_id:
type: string
organization_id:
type: integer
organization_name:
type: string
department:
type: string
avatar_image_url:
type: string
required:
- account_id
- role
- name
- chatwork_id
- organization_id
- organization_name
- department
- avatar_image_url
MyStatus:
type: object
properties:
unread_room_num:
type: integer
mention_room_num:
type: integer
mytask_room_num:
type: integer
unread_num:
type: integer
mention_num:
type: integer
required:
- unread_room_num
- mention_room_num
- mytask_room_num
- unread_num
- mention_num
parameters:
IconPreset:
name: icon_preset
type: string
description: ''
in: formData
enum:
- group
- check
- document
- meeting
- event
- project
- business
- study
- security
- star
- idea
- heart
- magcup
- beer
- music
- sports
- travel
AccountId:
name: account_id
type: integer
in: query
required: true
description: ''
AssignedByAccountId:
name: assigned_by_account_id
type: integer
in: query
RoomId:
name: room_id
type: integer
in: path
required: true
description: ''
MembersAdminIds:
name: members_admin_ids
type: array
description: ''
in: formData
items:
type: integer
collectionFormat: csv
required: true
MembersMemberIds:
name: members_member_ids
type: array
description: ''
in: formData
items:
type: integer
collectionFormat: csv
MembersReadonlyIds:
name: members_readonly_ids
type: array
description: ''
in: formData
items:
type: integer
collectionFormat: csv
Status:
name: status
type: string
in: query
enum:
- open
- done
responses:
MyAccount:
description: ''
schema:
$ref: '#/definitions/Me'
examples:
application/json: |-
{
"account_id": 123,
"room_id": 322,
"name": "John Smith",
"chatwork_id": "tarochatworkid",
"organization_id": 101,
"organization_name": "Hello Company",
"department": "Marketing",
"title": "CMO",
"url": "http://mycompany.com",
"introduction": "Self Introduction",
"mail": "taro@example.com",
"tel_organization": "XXX-XXXX-XXXX",
"tel_extension": "YYY-YYYY-YYYY",
"tel_mobile": "ZZZ-ZZZZ-ZZZZ",
"skype": "myskype_id",
"facebook": "myfacebook_id",
"twitter": "mytwitter_id",
"avatar_image_url": "https://example.com/abc.png"
}
MyStatus:
description: ''
schema:
$ref: '#/definitions/MyStatus'
examples:
application/json: |-
{
"unread_room_num": 2,
"mention_room_num": 1,
"mytask_room_num": 3,
"unread_num": 12,
"mention_num": 1,
"mytask_num": 8
}
Accounts:
description: ''
schema:
type: array
items:
$ref: '#/definitions/Account'
examples:
application/json: |-
[
{
"account_id": 123,
"room_id": 322,
"name": "John Smith",
"chatwork_id": "tarochatworkid",
"organization_id": 101,
"organization_name": "Hello Company",
"department": "Marketing",
"avatar_image_url": "https://example.com/abc.png"
}
]
File:
description: ''
schema:
$ref: '#/definitions/File'
examples:
application/json: |-
{
"file_id":3,
"account": {
"account_id":123,
"name":"Bob",
"avatar_image_url": "https://example.com/ico_avatar.png"
},
"message_id": "22",
"filename": "README.md",
"filesize": 2232,
"upload_time": 1384414750
}
Files:
description: ''
schema:
type: array
items:
$ref: '#/definitions/File'
examples:
application/json: |-
[
{
"file_id": 3,
"account": {
"account_id": 123,
"name": "Bob",
"avatar_image_url": "https://example.com/ico_avatar.png"
},
"message_id": "22",
"filename": "README.md",
"filesize": 2232,
"upload_time": 1384414750
}
]
Messages:
description: ''
schema:
type: array
items:
$ref: '#/definitions/Message'
examples:
application/json: |-
[
{
"message_id": "5",
"account": {
"account_id": 123,
"name": "Bob",
"avatar_image_url": "https://example.com/ico_avatar.png"
},
"body": "Hello Chatwork!",
"send_time": 1384242850,
"update_time": 0
}
]
Message:
description: ''
schema:
$ref: '#/definitions/Message'
examples:
application/json: |-
{
"message_id": "5",
"account": {
"account_id": 123,
"name": "Bob",
"avatar_image_url": "https://example.com/ico_avatar.png"
},
"body": "Hello Chatwork!",
"send_time": 1384242850,
"update_time": 0
}
MessageId:
description: ''
schema:
type: object
properties:
room_id:
type: integer
examples:
appliaction/json: |-
{
"message_id": "1234"
}
Task:
description: ''
schema:
$ref: '#/definitions/Task'
examples:
application/json: |-
{
"task_id": 3,
"room": {
"room_id": 5,
"name": "Group Chat Name",
"icon_path": "https://example.com/ico_group.png"
},
"assigned_by_account": {
"account_id": 456,
"name": "Anna",
"avatar_image_url": "https://example.com/def.png"
},
"message_id": "13",
"body": "buy milk",
"limit_time": 1384354799,
"status": "open"
}
Tasks:
description: ''
schema:
type: array
items:
$ref: '#/definitions/Task'
examples:
application/json: |-
[
{
"task_id": 3,
"room": {
"room_id": 5,
"name": "Group Chat Name",
"icon_path": "https://example.com/ico_group.png"
},
"assigned_by_account": {
"account_id": 456,
"name": "Anna",
"avatar_image_url": "https://example.com/def.png"
},
"message_id": "13",
"body": "buy milk",
"limit_time": 1384354799,
"status": "open"
}
]
TaskIds:
description: ''
schema:
type: object
properties:
task_ids:
type: array
items:
type: integer
examples:
application/json: |-
{
"task_ids": [123,124]
}
Rooms:
description: ''
schema:
type: array
items:
$ref: '#/definitions/Room'
examples:
application/json: |-
[
{
"room_id": 123,
"name": "Group Chat Name",
"type": "group",
"role": "admin",
"sticky": false,
"unread_num": 10,
"mention_num": 1,
"mytask_num": 0,
"message_num": 122,
"file_num": 10,
"task_num": 17,
"icon_path": "https://example.com/ico_group.png",
"last_update_time": 1298905200
}
]
Room:
description: ''
schema:
$ref: '#/definitions/Room'
examples:
application/json: |-
{
"room_id": 123,
"name": "Group Chat Name",
"type": "group",
"role": "admin",
"sticky": false,
"unread_num": 10,
"mention_num": 1,
"mytask_num": 0,
"message_num": 122,
"file_num": 10,
"task_num": 17,
"icon_path": "https://example.com/ico_group.png",
"last_update_time": 1298905200,
"description": "room description text"
}
RoomId:
description: ''
schema:
type: object
properties:
room_id:
type: integer
examples:
appliaction/json: |-
{
"room_id": 1234
}
Members:
description: ''
schema:
type: array
items:
$ref: '#/definitions/Member'
UpdateMembers:
description: ''
schema:
type: object
properties:
admin:
type: array
items:
type: integer
member:
type: array
items:
type: integer
readanly:
type: array
items:
type: integer
Unauthorize:
description: '認証エラー時のレスポンス'
schema:
type: object
properties:
errors:
type: array
items:
type: string
examples:
application/json: |-
{
"errors": ["Invalid API token"]
}
{
"swagger": "2.0",
"info": {
"title": "ChatWork API",
"version": "v2"
},
"host": "api.chatwork.com",
"basePath": "/v2",
"schemes": [
"https"
],
"consumes": [],
"produces": [],
"paths": {
"/me": {
"get": {
"summary": "自分自身の情報",
"description": "自分自身の情報を取得\n",
"security": [
{
"api_key": []
}
],
"responses": {
"200": {
"$ref": "#/responses/MyAccount"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"me"
],
"operationId": "get-me-data"
}
},
"/my/status": {
"get": {
"summary": "自分の未読数、未読To数、未完了タスク数",
"description": "自分の未読数、未読To数、未完了タスク数を返す",
"security": [
{
"api_key": []
}
],
"responses": {
"200": {
"$ref": "#/responses/MyStatus"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"my"
],
"operationId": "get-me-unreads"
}
},
"/my/tasks": {
"get": {
"summary": "自分のタスク一覧を取得する。",
"description": "自分のタスク一覧を取得する。(※100件まで取得可能。今後、より多くのデータを取得する為のページネーションの仕組みを提供予定)",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/AssignedByAccountId"
},
{
"$ref": "#/parameters/Status"
}
],
"responses": {
"200": {
"$ref": "#/responses/Tasks"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"my",
"tasks"
],
"operationId": "get-me-tasks"
}
},
"/contacts": {
"get": {
"summary": "自分のコンタクト一覧を取得",
"description": "自分のコンタクト一覧を取得",
"security": [
{
"api_key": []
}
],
"responses": {
"200": {
"$ref": "#/responses/Accounts"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"contacts"
],
"operationId": "get-me-contacts"
}
},
"/rooms": {
"get": {
"summary": "自分のチャット一覧の取得",
"description": "自分のチャット一覧の取得",
"security": [
{
"api_key": []
}
],
"responses": {
"200": {
"$ref": "#/responses/Rooms"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms"
],
"operationId": "get-me-chats"
},
"post": {
"consumes": [
"application/x-www-form-urlencoded"
],
"summary": "グループチャットを新規作成",
"description": "グループチャットを新規作成",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"name": "description",
"type": "string",
"description": "",
"in": "formData"
},
{
"$ref": "#/parameters/IconPreset"
},
{
"$ref": "#/parameters/MembersAdminIds"
},
{
"$ref": "#/parameters/MembersMemberIds"
},
{
"$ref": "#/parameters/MembersReadonlyIds"
},
{
"name": "name",
"type": "string",
"in": "formData",
"description": "",
"required": true
}
],
"responses": {
"200": {
"$ref": "#/responses/RoomId"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms"
],
"operationId": "new-group"
}
},
"/rooms/{room_id}": {
"get": {
"summary": "チャットの名前、アイコン、種類(my/direct/group)を取得",
"description": "チャットの名前、アイコン、種類(my/direct/group)を取得",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/RoomId"
}
],
"responses": {
"200": {
"$ref": "#/responses/Room"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms"
],
"operationId": "get-chat-data"
},
"delete": {
"summary": "グループチャットを退席/削除する",
"description": "グループチャットを退席/削除する",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/RoomId"
}
],
"responses": {
"200": {
"description": ""
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms"
],
"operationId": "leave-group"
},
"put": {
"consumes": [
"application/x-www-form-urlencoded"
],
"summary": "チャットの名前、アイコンをアップデート",
"description": "チャットの名前、アイコンをアップデート",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/RoomId"
},
{
"name": "description",
"type": "string",
"in": "formData",
"description": ""
},
{
"$ref": "#/parameters/IconPreset"
},
{
"name": "name",
"type": "string",
"in": "formData",
"description": ""
}
],
"responses": {
"200": {
"$ref": "#/responses/Room"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms"
],
"operationId": "update-chat-data"
}
},
"/rooms/{room_id}/members": {
"get": {
"summary": "チャットのメンバー一覧を取得",
"description": "チャットのメンバー一覧を取得",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/RoomId"
}
],
"responses": {
"200": {
"$ref": "#/responses/Members"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms",
"members"
],
"operationId": "get-chat-members"
},
"put": {
"consumes": [
"application/x-www-form-urlencoded"
],
"summary": "チャットのメンバーを一括変更",
"description": "チャットのメンバーを一括変更",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/RoomId"
},
{
"$ref": "#/parameters/MembersAdminIds"
},
{
"$ref": "#/parameters/MembersMemberIds"
},
{
"$ref": "#/parameters/MembersReadonlyIds"
}
],
"responses": {
"200": {
"$ref": "#/responses/UpdateMembers"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms",
"members"
],
"operationId": "update-chat-members"
}
},
"/rooms/{room_id}/messages": {
"get": {
"summary": "メッセージ情報を取得",
"description": "メッセージ情報を取得",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/RoomId"
},
{
"name": "force",
"type": "boolean",
"in": "query",
"description": ""
}
],
"responses": {
"200": {
"$ref": "#/responses/Messages"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms",
"messages"
],
"operationId": "get-chat-messages"
},
"post": {
"consumes": [
"application/x-www-form-urlencoded"
],
"summary": "チャットに新しいメッセージを追加",
"description": "チャットに新しいメッセージを追加",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/RoomId"
},
{
"name": "body",
"type": "string",
"in": "formData",
"required": true,
"description": ""
}
],
"responses": {
"200": {
"$ref": "#/responses/MessageId"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms",
"messages"
],
"operationId": "new-chat-message"
}
},
"/rooms/{room_id}/messages/{message_id}": {
"get": {
"summary": "メッセージ情報を取得",
"description": "メッセージ情報を取得",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/RoomId"
},
{
"name": "message_id",
"type": "string",
"in": "path",
"required": true,
"description": ""
}
],
"responses": {
"200": {
"$ref": "#/responses/Message"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms",
"messages"
],
"operationId": "get-chat-message"
}
},
"/rooms/{room_id}/tasks": {
"get": {
"summary": "チャットのタスク一覧を取得",
"description": "チャットのタスク一覧を取得 (※100件まで取得可能。今後、より多くのデータを取得する為のページネーションの仕組みを提供予定)",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/RoomId"
},
{
"$ref": "#/parameters/AccountId"
},
{
"$ref": "#/parameters/AssignedByAccountId"
},
{
"$ref": "#/parameters/Status"
}
],
"responses": {
"200": {
"$ref": "#/responses/Tasks"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms",
"tasks"
],
"operationId": "get-chat-tasks"
},
"post": {
"consumes": [
"application/x-www-form-urlencoded"
],
"summary": "チャットに新しいタスクを追加",
"description": "チャットに新しいタスクを追加",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/RoomId"
},
{
"name": "body",
"type": "string",
"in": "formData",
"required": true,
"description": "タスクの内容"
},
{
"name": "limit",
"type": "integer",
"in": "formData",
"description": "タスクの期限"
},
{
"name": "to_ids",
"type": "array",
"items": {
"type": "string"
},
"in": "formData",
"collectionFormat": "csv"
}
],
"responses": {
"200": {
"$ref": "#/responses/TaskIds"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms",
"tasks"
],
"operationId": "new-chat-task"
}
},
"/rooms/{room_id}/tasks/{task_id}": {
"get": {
"summary": "タスク情報を取得",
"description": "タスク情報を取得",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/RoomId"
},
{
"name": "task_id",
"type": "integer",
"in": "path",
"required": true,
"description": ""
}
],
"responses": {
"200": {
"$ref": "#/responses/Task"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms",
"tasks"
],
"operationId": "get-task-data"
}
},
"/rooms/{room_id}/files": {
"get": {
"summary": "チャットのファイル一覧を取得",
"description": "チャットのファイル一覧を取得 (※100件まで取得可能。今後、より多くのデータを取得する為のページネーションの仕組みを提供予定)",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/RoomId"
},
{
"$ref": "#/parameters/AccountId"
}
],
"responses": {
"200": {
"$ref": "#/responses/Files"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms",
"files"
],
"operationId": "get-chat-files"
}
},
"/rooms/{room_id}/files/{file_id}": {
"get": {
"summary": "ファイル情報を取得",
"description": "ファイル情報を取得",
"security": [
{
"api_key": []
}
],
"parameters": [
{
"$ref": "#/parameters/RoomId"
},
{
"name": "file_id",
"type": "integer",
"in": "path",
"required": true,
"description": ""
},
{
"name": "create_download_url",
"type": "integer",
"in": "query",
"description": ""
}
],
"responses": {
"200": {
"$ref": "#/responses/File"
},
"401": {
"$ref": "#/responses/Unauthorize"
}
},
"tags": [
"rooms",
"files"
],
"operationId": "get-file-data"
}
}
},
"definitions": {
"Status": {
"type": "string",
"enum": [
"open",
"done"
]
},
"Me": {
"type": "object",
"properties": {
"account_id": {
"type": "integer"
},
"room_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"chatwork_id": {
"type": "string"
},
"organization_id": {
"type": "integer"
},
"organization_name": {
"type": "string"
},
"department": {
"type": "string"
},
"title": {
"type": "string"
},
"url": {
"type": "string"
},
"introduction": {
"type": "string"
},
"mail": {
"type": "string"
},
"tel_organization": {
"type": "string"
},
"tel_extension": {
"type": "string"
},
"tel_mobile": {
"type": "string"
},
"skype": {
"type": "string"
},
"facebook": {
"type": "string"
},
"twitter": {
"type": "string"
},
"avatar_image_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"
]
},
"Account": {
"type": "object",
"properties": {
"account_id": {
"type": "integer"
},
"room_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"chatwork_id": {
"type": "string"
},
"organization_id": {
"type": "integer"
},
"organization_name": {
"type": "string"
},
"department": {
"type": "string"
},
"avatar_image_url": {
"type": "string"
}
},
"required": [
"account_id",
"room_id",
"name",
"chatwork_id",
"organization_id",
"organization_name",
"department",
"avatar_image_url"
]
},
"AccountSummary": {
"type": "object",
"properties": {
"account_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"avatar_image_url": {
"type": "string"
}
},
"required": [
"account_id",
"name",
"avatar_image_url"
]
},
"File": {
"type": "object",
"properties": {
"file_id": {
"type": "integer"
},
"account": {
"type": "object",
"properties": {
"account_id": {
"type": "integer"
},
"room_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"chatwork_id": {
"type": "string"
},
"organization_id": {
"type": "integer"
},
"organization_name": {
"type": "string"
},
"department": {
"type": "string"
},
"avatar_image_url": {
"type": "string"
}
},
"required": [
"account_id",
"room_id",
"name",
"chatwork_id",
"organization_id",
"organization_name",
"department",
"avatar_image_url"
]
},
"message_id": {
"type": "string"
},
"filename": {
"type": "string"
},
"filesize": {
"type": "integer"
},
"upload_time": {
"type": "integer"
}
},
"required": [
"file_id",
"account",
"message_id",
"filename",
"filesize",
"upload_time"
]
},
"RoomSummary": {
"type": "object",
"properties": {
"room_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"icon_path": {
"type": "string"
}
},
"required": [
"room_id",
"name",
"icon_path"
]
},
"Message": {
"type": "object",
"properties": {
"message_id": {
"type": "string"
},
"account": {
"type": "object",
"properties": {
"account_id": {
"type": "integer"
},
"room_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"chatwork_id": {
"type": "string"
},
"organization_id": {
"type": "integer"
},
"organization_name": {
"type": "string"
},
"department": {
"type": "string"
},
"avatar_image_url": {
"type": "string"
}
},
"required": [
"account_id",
"room_id",
"name",
"chatwork_id",
"organization_id",
"organization_name",
"department",
"avatar_image_url"
]
},
"body": {
"type": "string"
},
"send_time": {
"type": "integer"
},
"update_time": {
"type": "integer"
}
},
"required": [
"message_id",
"account",
"body",
"send_time",
"update_time"
]
},
"Task": {
"type": "object",
"properties": {
"task_id": {
"type": "integer"
},
"room": {
"type": "object",
"properties": {
"room_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"icon_path": {
"type": "string"
}
},
"required": [
"room_id",
"name",
"icon_path"
]
},
"assigned_by_account": {
"type": "object",
"properties": {
"account_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"avatar_image_url": {
"type": "string"
}
},
"required": [
"account_id",
"name",
"avatar_image_url"
]
},
"message_id": {
"type": "string"
},
"body": {
"type": "string"
},
"limit_time": {
"type": "integer"
},
"status": {
"type": "string",
"enum": [
"open",
"done"
]
}
},
"required": [
"task_id",
"room",
"assigned_by_account",
"message_id",
"body",
"limit_time",
"status"
]
},
"Room": {
"type": "object",
"properties": {
"room_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"type": {
"type": "string",
"enum": [
"my",
"direct",
"group"
]
},
"role": {
"type": "string"
},
"sticky": {
"type": "boolean"
},
"unread_num": {
"type": "integer"
},
"mention_num": {
"type": "integer"
},
"mytask_num": {
"type": "integer"
},
"message_num": {
"type": "integer"
},
"file_num": {
"type": "integer"
},
"task_num": {
"type": "integer"
},
"icon_path": {
"type": "string"
},
"last_update_time": {
"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"
]
},
"Member": {
"type": "object",
"properties": {
"account_id": {
"type": "integer"
},
"role": {
"type": "string"
},
"name": {
"type": "string"
},
"chatwork_id": {
"type": "string"
},
"organization_id": {
"type": "integer"
},
"organization_name": {
"type": "string"
},
"department": {
"type": "string"
},
"avatar_image_url": {
"type": "string"
}
},
"required": [
"account_id",
"role",
"name",
"chatwork_id",
"organization_id",
"organization_name",
"department",
"avatar_image_url"
]
},
"MyStatus": {
"type": "object",
"properties": {
"unread_room_num": {
"type": "integer"
},
"mention_room_num": {
"type": "integer"
},
"mytask_room_num": {
"type": "integer"
},
"unread_num": {
"type": "integer"
},
"mention_num": {
"type": "integer"
}
},
"required": [
"unread_room_num",
"mention_room_num",
"mytask_room_num",
"unread_num",
"mention_num"
]
}
},
"parameters": {
"ChatWorkToken": {
"name": "X-ChatWorkToken",
"in": "header",
"description": "",
"required": true,
"type": "string"
},
"IconPreset": {
"name": "icon_preset",
"type": "string",
"description": "",
"in": "formData",
"enum": [
"group",
"check",
"document",
"meeting",
"event",
"project",
"business",
"study",
"security",
"star",
"idea",
"heart",
"magcup",
"beer",
"music",
"sports",
"travel"
]
},
"AccountId": {
"name": "account_id",
"type": "integer",
"in": "query",
"required": true,
"description": ""
},
"AssignedByAccountId": {
"name": "assigned_by_account_id",
"type": "integer",
"in": "query"
},
"RoomId": {
"name": "room_id",
"type": "integer",
"in": "path",
"required": true,
"description": ""
},
"MembersAdminIds": {
"name": "members_admin_ids",
"type": "array",
"description": "",
"in": "formData",
"items": {
"type": "integer"
},
"collectionFormat": "csv",
"required": true
},
"MembersMemberIds": {
"name": "members_member_ids",
"type": "array",
"description": "",
"in": "formData",
"items": {
"type": "integer"
},
"collectionFormat": "csv"
},
"MembersReadonlyIds": {
"name": "members_readonly_ids",
"type": "array",
"description": "",
"in": "formData",
"items": {
"type": "integer"
},
"collectionFormat": "csv"
},
"Status": {
"name": "status",
"type": "string",
"in": "query",
"enum": [
"open",
"done"
]
}
},
"responses": {
"MyAccount": {
"description": "",
"schema": {
"$ref": "#/definitions/Me"
},
"examples": {
"application/json": "{\n \"account_id\": 123,\n \"room_id\": 322,\n \"name\": \"John Smith\",\n \"chatwork_id\": \"tarochatworkid\",\n \"organization_id\": 101,\n \"organization_name\": \"Hello Company\",\n \"department\": \"Marketing\",\n \"title\": \"CMO\",\n \"url\": \"http://mycompany.com\",\n \"introduction\": \"Self Introduction\",\n \"mail\": \"taro@example.com\",\n \"tel_organization\": \"XXX-XXXX-XXXX\",\n \"tel_extension\": \"YYY-YYYY-YYYY\",\n \"tel_mobile\": \"ZZZ-ZZZZ-ZZZZ\",\n \"skype\": \"myskype_id\",\n \"facebook\": \"myfacebook_id\",\n \"twitter\": \"mytwitter_id\",\n \"avatar_image_url\": \"https://example.com/abc.png\"\n}"
}
},
"MyStatus": {
"description": "",
"schema": {
"$ref": "#/definitions/MyStatus"
},
"examples": {
"application/json": "{\n \"unread_room_num\": 2,\n \"mention_room_num\": 1,\n \"mytask_room_num\": 3,\n \"unread_num\": 12,\n \"mention_num\": 1,\n \"mytask_num\": 8\n }"
}
},
"Accounts": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Account"
}
},
"examples": {
"application/json": "[\n {\n \"account_id\": 123,\n \"room_id\": 322,\n \"name\": \"John Smith\",\n \"chatwork_id\": \"tarochatworkid\",\n \"organization_id\": 101,\n \"organization_name\": \"Hello Company\",\n \"department\": \"Marketing\",\n \"avatar_image_url\": \"https://example.com/abc.png\"\n }\n]"
}
},
"File": {
"description": "",
"schema": {
"$ref": "#/definitions/File"
},
"examples": {
"application/json": "{\n \"file_id\":3,\n \"account\": {\n \"account_id\":123,\n \"name\":\"Bob\",\n \"avatar_image_url\": \"https://example.com/ico_avatar.png\"\n },\n \"message_id\": 22,\n \"filename\": \"README.md\",\n \"filesize\": 2232,\n \"upload_time\": 1384414750\n}"
}
},
"Files": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/File"
}
},
"examples": {
"application/json": "[\n {\n \"file_id\": 3,\n \"account\": {\n \"account_id\": 123,\n \"name\": \"Bob\",\n \"avatar_image_url\": \"https://example.com/ico_avatar.png\"\n },\n \"message_id\": 22,\n \"filename\": \"README.md\",\n \"filesize\": 2232,\n \"upload_time\": 1384414750\n }\n]"
}
},
"Messages": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Message"
}
},
"examples": {
"application/json": "[\n {\n \"message_id\": \"5\",\n \"account\": {\n \"account_id\": 123,\n \"name\": \"Bob\",\n \"avatar_image_url\": \"https://example.com/ico_avatar.png\"\n },\n \"body\": \"Hello Chatwork!\",\n \"send_time\": 1384242850,\n \"update_time\": 0\n }\n]"
}
},
"Message": {
"description": "",
"schema": {
"$ref": "#/definitions/Message"
},
"examples": {
"application/json": "{\n \"message_id\": \"5\",\n \"account\": {\n \"account_id\": 123,\n \"name\": \"Bob\",\n \"avatar_image_url\": \"https://example.com/ico_avatar.png\"\n },\n \"body\": \"Hello Chatwork!\",\n \"send_time\": 1384242850,\n \"update_time\": 0\n}"
}
},
"MessageId": {
"description": "",
"schema": {
"type": "object",
"properties": {
"room_id": {
"type": "integer"
}
}
},
"examples": {
"appliaction/json": "{\n \"message_id\": 1234\n}"
}
},
"Task": {
"description": "",
"schema": {
"$ref": "#/definitions/Task"
},
"examples": {
"application/json": "{\n \"task_id\": 3,\n \"room\": {\n \"room_id\": 5,\n \"name\": \"Group Chat Name\",\n \"icon_path\": \"https://example.com/ico_group.png\"\n },\n \"assigned_by_account\": {\n \"account_id\": 456,\n \"name\": \"Anna\",\n \"avatar_image_url\": \"https://example.com/def.png\"\n },\n \"message_id\": \"13\",\n \"body\": \"buy milk\",\n \"limit_time\": 1384354799,\n \"status\": \"open\"\n}"
}
},
"Tasks": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Task"
}
},
"examples": {
"application/json": "[\n {\n \"task_id\": 3,\n \"room\": {\n \"room_id\": 5,\n \"name\": \"Group Chat Name\",\n \"icon_path\": \"https://example.com/ico_group.png\"\n },\n \"assigned_by_account\": {\n \"account_id\": 456,\n \"name\": \"Anna\",\n \"avatar_image_url\": \"https://example.com/def.png\"\n },\n \"message_id\": \"13\",\n \"body\": \"buy milk\",\n \"limit_time\": 1384354799,\n \"status\": \"open\"\n }\n]"
}
},
"TaskIds": {
"description": "",
"schema": {
"type": "object",
"properties": {
"task_ids": {
"type": "array",
"items": {
"type": "integer"
}
}
}
},
"examples": {
"application/json": "{\n \"task_ids\": [123,124]\n}"
}
},
"Rooms": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Room"
}
},
"examples": {
"application/json": "[\n {\n \"room_id\": 123,\n \"name\": \"Group Chat Name\",\n \"type\": \"group\",\n \"role\": \"admin\",\n \"sticky\": false,\n \"unread_num\": 10,\n \"mention_num\": 1,\n \"mytask_num\": 0,\n \"message_num\": 122,\n \"file_num\": 10,\n \"task_num\": 17,\n \"icon_path\": \"https://example.com/ico_group.png\",\n \"last_update_time\": 1298905200\n }\n]"
}
},
"Room": {
"description": "",
"schema": {
"$ref": "#/definitions/Room"
},
"examples": {
"application/json": "{\n \"room_id\": 123,\n \"name\": \"Group Chat Name\",\n \"type\": \"group\",\n \"role\": \"admin\",\n \"sticky\": false,\n \"unread_num\": 10,\n \"mention_num\": 1,\n \"mytask_num\": 0,\n \"message_num\": 122,\n \"file_num\": 10,\n \"task_num\": 17,\n \"icon_path\": \"https://example.com/ico_group.png\",\n \"last_update_time\": 1298905200,\n \"description\": \"room description text\"\n}"
}
},
"RoomId": {
"description": "",
"schema": {
"type": "object",
"properties": {
"room_id": {
"type": "integer"
}
}
},
"examples": {
"appliaction/json": "{\n \"room_id\": 1234\n}"
}
},
"Members": {
"description": "",
"schema": {
"type": "array",
"items": {
"$ref": "#/definitions/Member"
}
}
},
"UpdateMembers": {
"description": "",
"schema": {
"type": "object",
"properties": {
"admin": {
"type": "array",
"items": {
"type": "integer"
}
},
"member": {
"type": "array",
"items": {
"type": "integer"
}
},
"readanly": {
"type": "array",
"items": {
"type": "integer"
}
}
}
}
},
"Unauthorize": {
"description": "認証エラー時のレスポンス",
"schema": {
"type": "object",
"properties": {
"errors": {
"type": "array",
"items": {
"type": "string"
}
}
}
},
"examples": {
"application/json": "{\n \"errors\": [\"Invalid API token\"]\n}"
}
}
},
"securityDefinitions": {
"api_key": {
"type": "apiKey",
"in": "header",
"name": "X-ChatWorkToken"
}
},
"security": [],
"tags": []
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.