Skip to content

Instantly share code, notes, and snippets.

@dafujii
Created April 18, 2020 13:05
Show Gist options
  • Save dafujii/93693fa18fb5bf95b6343cad9b777e1f to your computer and use it in GitHub Desktop.
Save dafujii/93693fa18fb5bf95b6343cad9b777e1f to your computer and use it in GitHub Desktop.
{
"openapi": "3.0.0",
"info": {
"title": "Chatwork API",
"version": "v2"
},
"servers": [
{
"url": "https://api.chatwork.com/{version}",
"variables": {
"version": {
"default": "version"
}
}
}
],
"paths": {
"/rooms/{room_id}/members": {
"parameters": [
{
"name": "room_id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "ルームID"
}
]
},
"/rooms/{room_id}/messages/read": {
"parameters": [
{
"name": "room_id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "ルームID"
}
]
},
"/rooms/{room_id}/messages/unread": {
"parameters": [
{
"name": "room_id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "ルームID"
}
]
},
"/rooms/{room_id}/messages/{message_id}": {
"parameters": [
{
"name": "message_id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "メッセージID"
},
{
"name": "room_id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "ルームID"
}
]
},
"/rooms/{room_id}/tasks/{task_id}/status": {
"parameters": [
{
"name": "task_id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "タスクID"
},
{
"name": "room_id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "ルームID"
}
]
},
"/rooms/{room_id}/files/{file_id}": {
"parameters": [
{
"name": "file_id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "ファイルID"
},
{
"name": "room_id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "ルームID"
}
]
},
"/rooms/{room_id}/link": {
"parameters": [
{
"name": "room_id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "ルームID"
}
]
},
"/incoming_requests/{request_id}": {
"parameters": [
{
"name": "request_id",
"in": "path",
"required": true,
"schema": {
"type": "integer"
},
"description": "リクエストID"
}
]
}
},
"components": {
"schemas": {},
"responses": {
"trait_nocontent_response_204": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": ""
}
}
}
},
"trait_unauthorized_response_401": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": {
"errors": [
"Invalid API token"
]
},
"type": "object",
"properties": {
"errors": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
},
"trait_room_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": {
"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"
},
"type": "object",
"properties": {
"room_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"type": {
"enum": [
"my",
"direct",
"group"
],
"type": "string"
},
"role": {
"enum": [
"admin",
"member",
"readonly"
],
"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"
},
"description": {
"type": "string"
}
},
"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"
]
}
}
}
},
"trait_room_list_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": [
{
"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
}
],
"type": "array",
"items": {
"type": "object",
"properties": {
"room_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"type": {
"enum": [
"my",
"direct",
"group"
],
"type": "string"
},
"role": {
"enum": [
"admin",
"member",
"readonly"
],
"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"
]
}
}
}
}
},
"trait_task_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": {
"task_id": 3,
"account": {
"account_id": 123,
"name": "Bob",
"avatar_image_url": "https://example.com/abc.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",
"limit_type": "date"
},
"type": "object",
"properties": {
"task_id": {
"type": "integer"
},
"account": {
"type": "object",
"properties": {
"account_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"avatar_image_url": {
"type": "string"
}
},
"required": [
"account_id",
"name",
"avatar_image_url"
]
},
"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": {
"enum": [
"open",
"done"
],
"type": "string"
},
"limit_type": {
"enum": [
"none",
"date",
"time"
],
"type": "string"
}
},
"required": [
"task_id",
"account",
"assigned_by_account",
"message_id",
"body",
"limit_time",
"status",
"limit_type"
]
}
}
}
},
"trait_my_task_list_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": [
{
"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",
"limit_type": "date"
}
],
"type": "array",
"items": {
"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": {
"enum": [
"open",
"done"
],
"type": "string"
},
"limit_type": {
"enum": [
"none",
"date",
"time"
],
"type": "string"
}
},
"required": [
"task_id",
"room",
"assigned_by_account",
"message_id",
"body",
"limit_time",
"status",
"limit_type"
]
}
}
}
}
},
"trait_room_task_list_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": [
{
"task_id": 3,
"account": {
"account_id": 123,
"name": "Bob",
"avatar_image_url": "https://example.com/abc.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",
"limit_type": "date"
}
],
"type": "array",
"items": {
"type": "object",
"properties": {
"task_id": {
"type": "integer"
},
"account": {
"type": "object",
"properties": {
"account_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"avatar_image_url": {
"type": "string"
}
},
"required": [
"account_id",
"name",
"avatar_image_url"
]
},
"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": {
"enum": [
"open",
"done"
],
"type": "string"
},
"limit_type": {
"enum": [
"none",
"date",
"time"
],
"type": "string"
}
},
"required": [
"task_id",
"account",
"assigned_by_account",
"message_id",
"body",
"limit_time",
"status",
"limit_type"
]
}
}
}
}
},
"trait_my_account_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": {
"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.example.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",
"login_mail": "account@example.com"
},
"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"
},
"login_mail": {
"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"
]
}
}
}
},
"trait_account_list_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": [
{
"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"
}
],
"type": "array",
"items": {
"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"
}
},
"type": "object"
}
}
}
}
},
"trait_room_member_list_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": [
{
"account_id": 123,
"role": "member",
"name": "John Smith",
"chatwork_id": "tarochatworkid",
"organization_id": 101,
"organization_name": "Hello Company",
"department": "Marketing",
"avatar_image_url": "https://example.com/abc.png"
}
],
"type": "array",
"items": {
"properties": {
"account_id": {
"type": "integer"
},
"role": {
"enum": [
"admin",
"member",
"readonly"
],
"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"
],
"type": "object"
}
}
}
}
},
"trait_file_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": {
"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
},
"type": "object",
"properties": {
"file_id": {
"type": "integer"
},
"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"
},
"filename": {
"type": "string"
},
"filesize": {
"type": "integer"
},
"upload_time": {
"type": "integer"
},
"download_url": {
"type": "string"
}
},
"required": [
"file_id",
"account",
"message_id",
"filename",
"filesize",
"upload_time"
]
}
}
}
},
"trait_file_list_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": [
{
"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
}
],
"type": "array",
"items": {
"type": "object",
"properties": {
"file_id": {
"type": "integer"
},
"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"
},
"filename": {
"type": "string"
},
"filesize": {
"type": "integer"
},
"upload_time": {
"type": "integer"
}
},
"required": [
"file_id",
"account",
"message_id",
"filename",
"filesize",
"upload_time"
]
}
}
}
}
},
"trait_message_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": {
"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
},
"type": "object",
"properties": {
"message_id": {
"type": "string"
},
"account": {
"type": "object",
"properties": {
"account_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"avatar_image_url": {
"type": "string"
}
},
"required": [
"account_id",
"name",
"avatar_image_url"
]
},
"body": {
"type": "string"
},
"send_time": {
"type": "integer"
},
"update_time": {
"type": "integer"
}
},
"required": [
"message_id",
"account",
"body",
"send_time",
"update_time"
]
}
}
}
},
"trait_message_list_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": [
{
"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
}
],
"type": "array",
"items": {
"type": "object",
"properties": {
"message_id": {
"type": "string"
},
"account": {
"type": "object",
"properties": {
"account_id": {
"type": "integer"
},
"name": {
"type": "string"
},
"avatar_image_url": {
"type": "string"
}
},
"required": [
"account_id",
"name",
"avatar_image_url"
]
},
"body": {
"type": "string"
},
"send_time": {
"type": "integer"
},
"update_time": {
"type": "integer"
}
},
"required": [
"message_id",
"account",
"body",
"send_time",
"update_time"
]
}
}
}
}
},
"trait_invitation_link_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": {
"public": true,
"url": "https://example.chatwork.com/g/randomcode42",
"need_acceptance": true,
"description": "Link description text"
},
"type": "object",
"properties": {
"public": {
"type": "boolean"
},
"url": {
"type": "string"
},
"need_acceptance": {
"type": "boolean"
},
"description": {
"type": "string"
}
},
"required": [
"public"
]
}
}
}
},
"trait_incoming_request_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": {
"account_id": 363,
"room_id": 1234,
"name": "John Smith",
"chatwork_id": "tarochatworkid",
"organization_id": 101,
"organization_name": "Hello Company",
"department": "Marketing",
"avatar_image_url": "https://example.com/abc.png"
},
"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"
]
}
}
}
},
"trait_incoming_request_list_response_200": {
"description": "",
"content": {
"application/json": {
"schema": {
"example": [
{
"request_id": 123,
"account_id": 363,
"message": "hogehoge",
"name": "John Smith",
"chatwork_id": "tarochatworkid",
"organization_id": 101,
"organization_name": "Hello Company",
"department": "Marketing",
"avatar_image_url": "https://example.com/abc.png"
}
],
"type": "array",
"items": {
"properties": {
"request_id": {
"type": "integer"
},
"account_id": {
"type": "integer"
},
"message": {
"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": [
"request_id",
"account_id",
"message",
"name",
"chatwork_id",
"organization_id",
"organization_name",
"department",
"avatar_image_url"
],
"type": "object"
}
}
}
}
}
},
"parameters": {
"trait_room_members_members_admin_ids": {
"name": "members_admin_ids",
"in": "query",
"required": true,
"description": "[string-list:type=integer]作成したチャットに参加メンバーのうち、管理者権限にしたいユーザーのアカウントIDの配列。最低1人は指定する必要がある。コンタクト済みユーザーか組織内ユーザーのアカウントIDのみ指定できる。\n",
"schema": {
"type": "string"
}
},
"trait_room_members_members_member_ids": {
"name": "members_member_ids",
"in": "query",
"required": true,
"description": "[string-list:type=integer]作成したチャットに参加メンバーのうち、メンバー権限にしたいユーザーのアカウントIDの配列。コンタクト済みユーザーか組織内ユーザーのアカウントIDのみ指定できる。\n",
"schema": {
"type": "string"
}
},
"trait_room_members_members_readonly_ids": {
"name": "members_readonly_ids",
"in": "query",
"required": true,
"description": "[string-list:type=integer]作成したチャットに参加メンバーのうち、閲覧のみ権限にしたいユーザーのアカウントIDの配列。コンタクト済みユーザーか組織内ユーザーのアカウントIDのみ指定できる。\n",
"schema": {
"type": "string"
}
},
"trait_room_icon_icon_preset": {
"name": "icon_preset",
"in": "query",
"required": true,
"description": "グループチャットのアイコン種類\n",
"schema": {
"enum": [
"group",
"check",
"document",
"meeting",
"event",
"project",
"business",
"study",
"security",
"star",
"idea",
"heart",
"magcup",
"beer",
"music",
"sports",
"travel"
],
"type": "string"
}
}
},
"examples": {},
"requestBodies": {},
"headers": {},
"securitySchemes": {
"oauth_2_0": {
"description": "Chatwork APIはOAuth2.0 Bearer Token Usageをサポートしています。\n",
"type": "oauth2",
"flows": {
"authorizationCode": {
"authorizationUrl": "https://www.chatwork.com/packages/oauth2/login.php\n",
"tokenUrl": "https://oauth.chatwork.com/token",
"scopes": {}
}
}
}
},
"links": {},
"callbacks": {}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment