openapi: 3.0.3 info: title: SantokuApp REST API version: 1.0.0 description: SantokuAppのREST API。 contact: {} # OpenAPI Generatorを使用した場合、tag毎にAPIクライアントが作成されます。 # 例えば、tagがSystemの場合はSystemApiというAPIクライアントが作成されます。 # なお、タグにはアルファベットを使用するようにしてください。 # タグに日本語などが含まれているとOpenAPI Generatorでうまく認識されないようです。 tags: - name: System - name: Account - name: Terms - name: Event - name: Question - name: Tag - name: Notification - name: Template servers: - url: 'http://localhost:9080/api' security: - Session: [] paths: /system/csrf-token: get: summary: CSRFトークンの取得 tags: - System description: CSRFトークンを取得します。 operationId: get-csrf-token responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/CsrfTokenResponse' '/system/app-updates/{type}/{version}': parameters: - schema: type: string enum: - ios - android name: type in: path required: true description: アプリの種別 - schema: type: string name: version in: path required: true description: アプリのバージョン番号 get: summary: アプリ更新情報の取得 operationId: get-app-updates responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/AppUpdatesResponse' examples: {} '404': $ref: '#/components/responses/BadRequest' description: | 指定されたアプリの種別・バージョン番号に対し、アップデートが必要かどうかの判断結果を返します。 サーバに設定されたバージョン番号と指定されたバージョン番号の比較でアップデートの要否が決定します。 大小比較はセマンティックバージョニングのルールに沿って実施されます。 実際に存在するバージョン番号かどうかは判断結果に影響しません。 次の場合はHTTPステータスコード404(Not Found)を応答します。 - iosまたはandroid以外の種別が指定された場合 - セマンティックバージョンとして認識されないバージョン番号が指定された場合 tags: - System /signup: post: summary: アカウントの登録 tags: - Account description: | アカウントを登録します。アカウントの登録には、ニックネームとパスワードが必要です。 operationId: post-signup requestBody: content: application/json: schema: $ref: '#/components/schemas/AccountRegistration' responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/Account' headers: Location: schema: type: string format: uri-reference example: /api/accounts/me '400': $ref: '#/components/responses/BadRequest' /login: post: summary: ログインする description: | アカウントIDとパスワードを指定してログインします。 tags: - Account operationId: post-login requestBody: content: application/json: schema: $ref: '#/components/schemas/AccountLogin' examples: example: value: accountId: 30b65d82-8a64-4a3a-a097-031313f43c69 password: f48ad168-68e7-4393-845e-e936795799d3 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/AccountLoginResponse' examples: example: value: status: COMPLETE '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' /logout: post: summary: ログアウトする description: ログアウトします。 tags: - Account operationId: post-logout responses: '204': description: No Content '400': $ref: '#/components/responses/BadRequest' '403': $ref: '#/components/responses/Forbidden' '/accounts/{accountId}': parameters: - name: accountId in: path description: アカウントのID required: true schema: type: string get: summary: アカウントの取得 description: | アカウントIDをキーとして登録されているアカウントを取得する。 tags: - Account operationId: get-accounts-accountId responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Account' '/accounts/{accountId}/avatar': parameters: - name: accountId in: path description: アカウントのID required: true schema: type: string get: summary: アバターを取得する description: | アバターを取得する。 サポートしているフォーマットは以下になります。 - png - jpg - jpeg - bmp - gif - webp tags: - Account operationId: get-accounts-accountId-avatar responses: '200': description: OK content: image/*: schema: $ref: '#/components/schemas/AvatarImage' /accounts/me: get: summary: ログイン済みアカウントの取得 description: | ログイン済みのアカウントを取得する。 tags: - Account operationId: get-accounts-me responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Account' '403': $ref: '#/components/responses/Forbidden' /accounts/me/avatar: get: summary: ログイン済みアカウントのアバターを取得する description: | ログイン済みアカウントのアバターを取得する。 サポートしているフォーマットは以下になります。 - png - jpg - jpeg - bmp - gif - webp tags: - Account operationId: get-accounts-me-avatar responses: '200': description: OK content: image/*: schema: $ref: '#/components/schemas/AvatarImage' put: summary: ログイン済みアカウントのアバターを登録する description: | ログイン済みアカウントのアバターを登録する。 tags: - Account operationId: put-accounts-me-avatar requestBody: content: multipart/form-data: schema: $ref: '#/components/schemas/AvatarImage' encoding: avatarImage: contentType: image/* responses: '201': description: Created headers: Location: schema: type: string format: uri-reference description: アカウントのアバター画像のURL /accounts/me/device-token: post: summary: ログイン済みアカウントのデバイス登録トークンの更新 description: | ログイン済みアカウントのデバイス登録トークンを更新する。 tags: - Account operationId: post-accounts-me-device-token requestBody: content: application/json: schema: $ref: '#/components/schemas/UpdateDeviceToken' responses: '204': description: No Content /accounts/me/terms: get: summary: ログイン済みアカウントの利用規約同意状態確認 description: | ログイン済みアカウントの有効な利用規約に同意しているかの状態を取得します。 tags: - Account operationId: get-accounts-me-terms responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/TermsOfServiceAgreementStatus' post: summary: ログイン済みアカウントの利用規約同意 description: | ログイン済みアカウントにおいて、指定された利用規約のバージョンに同意します。 tags: - Account operationId: post-accounts-me-terms requestBody: content: application/json: schema: $ref: '#/components/schemas/TermsOfServiceAgreementStatus' responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/TermsOfServiceAgreementStatus' '400': $ref: '#/components/responses/BadRequest' /accounts/me/delete: post: summary: ログイン済みアカウント削除 description: | ログイン済みアカウントを削除します。 アカウントの削除にパスワードを要求するので、DELETEメソッドではなくPOSTメソッドを利用しています。 参考: [4.3.5. DELETE - RFC 7231](https://datatracker.ietf.org/doc/html/rfc7231#section-4.3.5) > A payload within a DELETE request message has no defined semantics; > sending a payload body on a DELETE request might cause some existing > implementations to reject the request. tags: - Account operationId: delete-accounts-me-delete requestBody: content: application/json: schema: $ref: '#/components/schemas/AccountDeletion' responses: '204': description: No Content '400': $ref: '#/components/responses/BadRequest' '401': $ref: '#/components/responses/Unauthorized' '403': $ref: '#/components/responses/Forbidden' /terms: get: summary: 有効な利用規約の取得 description: | 有効な利用規約を取得します。このAPIの呼び出しには認証情報は不要です。 tags: - Terms security: [] operationId: get-terms responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/TermsOfService' /events: get: summary: イベント一覧取得 responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/Event' '400': $ref: '#/components/responses/BadRequest' operationId: get-events description: 掲載期間中のイベントまたは全イベントの一覧を取得します。 parameters: - schema: type: string enum: - active - all in: query name: target description: 取得対象 required: true tags: - Event parameters: [] post: summary: イベント登録 operationId: post-events responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/EventContent' '400': $ref: '#/components/responses/BadRequest' description: イベントを登録します。 requestBody: content: application/json: schema: $ref: '#/components/schemas/EventRegistration' description: '' parameters: [] tags: - Event /questions: get: summary: 質問一覧取得 responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/Question' '400': $ref: '#/components/responses/BadRequest' operationId: get-list-questions description: 質問の一覧を取得します。検索文言やソート条件を指定すると条件に合った質問のみの一覧を取得します。 parameters: - schema: type: string in: query name: keyword description: 検索文言 - schema: type: string enum: - like - update in: query name: sort description: ソート順 - schema: type: string enum: - unanswered - outstanding in: query name: filter description: 絞り込み条件 - schema: type: string in: query name: tag description: 検索タグ tags: - Question parameters: [] post: summary: 質問登録 operationId: post-questions responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/QuestionContent' '400': $ref: '#/components/responses/BadRequest' requestBody: content: application/json: schema: $ref: '#/components/schemas/QuestionRegistration' description: '' description: 質問を登録します。 tags: - Question /tags: get: summary: タグ一覧取得 responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/Tag' operationId: get-list-tags description: タグの一覧を取得します。 tags: - Tag parameters: [] /notifications: get: summary: お知らせ一覧取得 responses: '200': description: OK content: application/xml: schema: type: array items: $ref: '#/components/schemas/Notification' operationId: get-list-notifications description: お知らせの一覧を取得します。 tags: - Notification parameters: [] /templates: get: summary: テンプレート一覧取得 tags: - Template responses: '200': description: OK content: application/json: schema: type: array items: $ref: '#/components/schemas/Template' operationId: get-templates description: 入力のテンプレート一覧を取得します。 '/events/{eventId}': parameters: - schema: type: string name: eventId in: path required: true description: イベントID get: summary: イベント取得 tags: - Event responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/Event' operationId: get-events-eventId description: 特定のイベントを取得します。 '/questions/{questionId}': get: summary: 質問取得 operationId: get-detail-question description: 特定の質問および紐づく回答とコメントを取得します。 responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/QuestionAndAnswer' tags: - Question parameters: - schema: type: string name: questionId in: path description: 質問ID required: true '/questions/{questionId}/answers': parameters: - schema: type: string name: questionId in: path required: true post: summary: 回答登録 operationId: post-questions-questionId-answers responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/AnswerContent' '400': $ref: '#/components/responses/BadRequest' description: 回答を登録します。 requestBody: content: application/json: schema: $ref: '#/components/schemas/AnswerRegistration' description: '' tags: - Question '/questions/{questionId}/comments': post: summary: コメント登録(質問) operationId: post-detail-comment responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/CommentContent' '400': $ref: '#/components/responses/BadRequest' description: 質問に対するコメントを登録します。 requestBody: content: application/json: schema: $ref: '#/components/schemas/CommentRegistration' tags: - Question parameters: - schema: type: string name: questionId in: path required: true description: 質問ID '/questions/{questionId}/answers/{answerId}/comments': parameters: - schema: type: string name: questionId in: path required: true description: 質問ID - schema: type: string name: answerId in: path required: true description: 回答ID post: summary: コメント登録(回答) operationId: post-questions-questionId-answers-answerId-comments responses: '201': description: Created content: application/json: schema: $ref: '#/components/schemas/CommentContent' '400': $ref: '#/components/responses/BadRequest' description: 回答に対するコメントを登録します。 requestBody: content: application/json: schema: $ref: '#/components/schemas/CommentRegistration' tags: - Question /accounts/me/likes: parameters: [] get: summary: いいね済の取得 tags: - Account responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/LikesResponse' operationId: get-accounts-me-likes description: いいね済のイベント、質問、回答、コメントを取得します。 '/accounts/me/likes/events/{eventId}': parameters: - schema: type: string name: eventId in: path required: true description: イベントID put: summary: いいねの実施(イベント) operationId: put-events-eventId-like responses: '204': description: No Content description: イベントに対するいいねを行います。 tags: - Account delete: summary: いいねの取消(イベント) operationId: delete-events-eventId-like responses: '204': description: No Content description: イベントに対するいいねを取り消します。 tags: - Account get: summary: いいね済の取得(イベント) operationId: get-accounts-me-likes-events-eventId responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/LikedEventResponse' description: 特定のイベントについていいね済のイベントを取得します。いいね済の場合はイベントIDが返ります。 tags: - Account '/accounts/me/likes/questions/{questionId}': parameters: - schema: type: string name: questionId in: path required: true description: 質問ID put: summary: いいねの実施(質問) operationId: put-questions-questionId-like responses: '204': description: No Content description: 質問に対するいいねを行います。 tags: - Account delete: summary: いいねの取消(質問) operationId: delete-questions-questionId-like responses: '204': description: No Content description: 質問に対するいいねを取り消します。 tags: - Account get: summary: いいね済の取得(質問) operationId: get-accounts-me-likes-questions-questionId responses: '200': description: OK content: application/json: schema: $ref: '#/components/schemas/LikedQuestionResponse' description: 特定の質問についていいね済の質問および紐づく回答、コメントを取得します。いいね済の場合はIDが返ります。 tags: - Account '/accounts/me/likes/questions/{questionId}/comments/{commentId}': parameters: - schema: type: string name: questionId in: path required: true description: 質問ID - schema: type: string name: commentId in: path required: true description: コメントID put: summary: いいねの実施(質問コメント) operationId: put-questions-questionId-comment-commentId-like responses: '204': description: No Content description: 質問のコメントに対するいいねを行います。 tags: - Account delete: summary: いいねの取消(質問コメント) operationId: delete-questions-questionId-comments-commentId-like responses: '204': description: No Content description: 質問のコメントに対するいいねを取り消します。 tags: - Account '/accounts/me/likes/questions/{questionId}/answers/{answerId}': parameters: - schema: type: string name: questionId in: path required: true description: 質問ID - schema: type: string name: answerId in: path required: true description: 回答ID put: summary: いいねの実施(回答) operationId: put-questions-questionId-answer-answerId-like responses: '204': description: No Content description: 回答に対するいいねを行います。 tags: - Account delete: summary: いいねの取消(回答) operationId: delete-questions-questionId-answers-answerId-like responses: '204': description: No Content description: 回答に対するいいねを取り消します。 tags: - Account '/accounts/me/likes/questions/{questionId}/answers/{answerId}/comments/{commentId}': parameters: - schema: type: string name: questionId in: path required: true description: 質問ID - schema: type: string name: answerId in: path required: true description: 回答ID - schema: type: string name: commentId in: path required: true description: コメントID put: summary: いいねの実施(回答コメント) operationId: put-questions-questionId-answer-answerId-comment-commentId-like responses: '204': description: No Content description: 回答のコメントに対するいいねを行います。 tags: - Account delete: summary: いいねの取消(回答コメント) operationId: delete-questions-questionId-answers-answerId-comments-commentId-like responses: '204': description: No Content description: 回答のコメントに対するいいねを取り消します。 tags: - Account components: schemas: CsrfTokenResponse: title: CSRF-Token type: object description: CSRFトークンレスポンス properties: csrfTokenValue: type: string description: トークンの値 csrfTokenHeaderName: type: string description: トークンのヘッダー名 csrfTokenParameterName: type: string description: トークンのパラメータ名 required: - csrfTokenValue - csrfTokenHeaderName - csrfTokenParameterName AppUpdatesResponse: title: AppUpdatesResponse type: object description: アプリ更新情報のレスポンス properties: updateRequired: type: boolean description: アップデートが必要かどうか supportedVersion: type: string description: サポートバージョン番号 message: type: string description: メッセージ required: - updateRequired - supportedVersion - message Profile: title: Profile type: object description: プロフィール情報 properties: nickname: type: string description: アカウントのニックネーム avatarImageUrl: type: string description: アカウントのアバター画像のURL type: type: array description: 該当する場合に付与されるアカウントの種類 items: type: string enum: - partner - techlead - administrator points: type: integer description: 今期ポイント数 totalPoints: type: integer description: 累積ポイント数 required: - nickname - type - points - totalPoints Account: title: Account description: アカウント allOf: - $ref: '#/components/schemas/AccountProfile' - $ref: '#/components/schemas/AccountDeviceTokens' AccountProfile: title: AccountProfile type: object description: アカウントプロフィール情報 properties: accountId: type: string description: アカウントID readOnly: true profile: $ref: '#/components/schemas/Profile' required: - accountId AccountDeviceTokens: title: AccountDeviceTokens type: object description: アカウント紐づくデバイストークン properties: deviceTokens: type: array items: type: string description: アカウントに紐づくデバイストークン(デバイストークンの更新期限を超過しているものは除く) required: - deviceTokens AccountRegistration: title: AccountRegistration type: object description: アカウントの登録情報 properties: nickname: type: string description: アカウントのニックネーム password: type: string description: パスワード required: - nickname - password AccountLogin: title: AccountLogin type: object description: アカウントのログイン情報 properties: accountId: type: string description: アカウントID password: type: string description: パスワード required: - accountId - password AccountLoginResponse: title: AccountLoginResponse type: object description: アカウントのログイン結果 properties: status: type: string enum: - COMPLETE required: - status AccountDeletion: title: AccountDeletion type: object description: アカウント削除 properties: password: type: string description: パスワード AvatarImage: title: AvatarImage type: object description: アバター画像 properties: avatarImage: type: string format: binary description: アバター画像 UpdateDeviceToken: title: UpdateDeviceToken type: object description: 更新するデバイス登録トークン properties: newDeviceToken: type: string description: 登録するデバイス登録トークン oldDeviceToken: type: string description: 削除するデバイス登録トークン TermsOfService: title: TermsOfService type: object description: 利用規約 properties: version: type: string description: 最新の利用規約のバージョン url: type: string description: 利用規約のURL required: - version - url TermsOfServiceAgreementStatus: title: TermsOfServiceAgreementStatus type: object description: 利用規約同意状態 properties: hasAgreed: type: boolean description: 有効な利用規約に同意済みかどうか readOnly: true agreedVersion: type: string description: 同意した利用規約のバージョン required: - agreedVersion ErrorResponse: title: Error type: object description: エラーレスポンス properties: code: type: string description: エラーコード message: type: string description: エラーメッセージ required: - code - message Event: allOf: - $ref: '#/components/schemas/EventContent' - $ref: '#/components/schemas/AccountProfile' title: Event description: イベント Question: title: Question description: 質問 allOf: - $ref: '#/components/schemas/QuestionContent' - $ref: '#/components/schemas/AccountProfile' Answer: title: Answer description: 回答 allOf: - $ref: '#/components/schemas/AnswerContent' - $ref: '#/components/schemas/AccountProfile' Comment: title: Comment description: コメント allOf: - $ref: '#/components/schemas/CommentContent' - $ref: '#/components/schemas/AccountProfile' EventContent: type: object title: EventContent description: イベント内容 properties: eventId: type: string description: イベントID readOnly: true title: type: string description: イベントのタイトル content: type: string description: イベントの内容 endDate: type: string description: 掲載終了日 format: date likes: type: integer description: いいね数 required: - eventId - title - content - endDate - likes QuestionContent: type: object title: QuestionContent description: 質問内容 properties: questionId: type: string description: 質問ID readOnly: true title: type: string description: 質問のタイトル content: type: string description: 質問内容 tags: type: array description: 質問に設定されているタグ items: $ref: '#/components/schemas/Tag' datetime: type: string description: 質問日時 format: date-time beginner: type: boolean description: 初心者か否か resolved: type: boolean description: 解決済か否か views: type: integer description: 閲覧数 answers: type: integer description: 回答数 likes: type: integer description: いいね数 comments: type: integer description: コメント数 lastUpdatedAt: type: string format: date-time description: 最終更新日 required: - questionId - title - content - tags - datetime - beginner - resolved - views - answers - likes - comments AnswerContent: type: object title: AnswerContent description: 回答内容 properties: answerId: type: string description: 回答ID readOnly: true content: type: string description: 回答内容 datetime: type: string description: 回答日時 format: date-time likes: type: integer description: いいね数 comments: type: integer description: コメント数 required: - answerId - content - datetime - likes - comments CommentContent: type: object title: CommentContent description: コメント内容 properties: commentId: type: string description: コメントID readOnly: true content: type: string description: コメント内容 datetime: type: string description: コメント日時 format: date-time likes: type: integer description: いいね数 required: - commentId - content - datetime - likes Notification: type: object title: Notification description: お知らせ情報 properties: notificationId: type: string description: お知らせID readOnly: true title: type: string description: お知らせのタイトル datetime: type: string description: 発行日時 format: date-time contentUrl: type: string description: お知らせページのURL format: uri-reference required: - notificationId - title - datetime - contentUrl Tag: type: object title: Tag description: タグ情報 properties: tagId: type: string description: タグID readOnly: true tagName: type: string description: タグ名 questions: type: integer description: 設定されている質問数 required: - tagId - tagName - questions Template: type: object title: Template description: 入力内容のテンプレート properties: templateId: type: string description: テンプレートID readOnly: true title: type: string description: テンプレートタイトル content: type: string description: テンプレート内容 required: - templateId - title - content QuestionAndAnswer: type: object title: QuestionAndAnswer description: 質問と回答およびコメント properties: question: type: object description: 質問とコメント required: - question - commentList properties: question: $ref: '#/components/schemas/Question' commentList: type: array description: 質問に対するコメントのリスト items: $ref: '#/components/schemas/Comment' answerList: type: array description: 回答とコメントのリスト items: type: object description: 回答とコメント properties: answer: $ref: '#/components/schemas/Answer' commentList: type: array description: 回答に対するコメントのリスト items: $ref: '#/components/schemas/Comment' required: - answer - commentList required: - question - answerList CommentRegistration: title: CommentRegistration type: object description: 登録するコメント情報 properties: content: type: string description: コメント内容 required: - content EventRegistration: title: EventRegistration type: object description: 登録するイベント情報 properties: title: type: string description: イベントのタイトル content: type: string description: イベント内容 endDate: type: string description: 掲載終了日 format: date required: - title - content - endDate QuestionRegistration: title: QuestionRegistration type: object description: 登録する質問情報 properties: title: type: string description: 質問のタイトル content: type: string description: 質問内容 tags: type: array description: 質問の設定するタグ items: type: string beginner: type: boolean description: 初心者か否か required: - title - content - beginner AnswerRegistration: title: AnswerRegistration type: object description: 登録する回答情報 properties: content: type: string description: 回答内容 required: - content LikedEventResponse: title: LikedEventResponse type: object description: いいね済のイベントID properties: eventId: type: string description: いいね済のイベントID LikedQuestionResponse: title: LikedQuestionResponse description: いいね済の質問IDと紐づく回答ID、コメントID type: object properties: questionId: type: string description: 質問ID liked: type: boolean description: 質問にいいね済か commentId: type: array description: いいね済の質問コメントID items: type: string answer: type: array description: いいね済の質問に紐づく回答 items: type: object description: いいね済の質問に紐づく回答 properties: answerId: type: string description: いいね済の回答ID liked: type: boolean description: 回答にいいね済か commentId: type: array description: いいね済の回答コメントID items: type: string required: - questionId - liked - commentId - answer LikesResponse: allOf: - description: いいね済のイベントID items: $ref: '#/components/schemas/LikedEventResponse' - description: いいね済の質問ID、回答ID、コメントID items: $ref: '#/components/schemas/LikedQuestionResponse' title: LikesResponse description: いいね済のイベントID、質問ID、回答ID、コメントID type: array items: type: object responses: BadRequest: description: Bad Request content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' Unauthorized: description: Unauthorized content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' Forbidden: description: Forbidden content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' NotFound: description: Not Found content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' Conflict: description: Conflict content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' PayloadTooLarge: description: Payload Too Large content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' ServiceUnavailable: description: Service Unavailable content: application/json: schema: $ref: '#/components/schemas/ErrorResponse' securitySchemes: Session: type: apiKey in: cookie name: NABLARCH_SID description: Cookieに格納されたセッションIDで認証状態を維持します。