diff --git a/api-docs/index.php b/api-docs/index.php new file mode 100644 index 0000000..ed9f03a --- /dev/null +++ b/api-docs/index.php @@ -0,0 +1,102 @@ + 0, + 'path' => '/', + 'domain' => '', + 'secure' => true, + 'httponly' => true, + 'samesite' => 'Lax' +]); +session_start(); +session_regenerate_id(true); + +// データベースに接続 +try { + + $option = array( + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + PDO::MYSQL_ATTR_MULTI_STATEMENTS => false + ); + $pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); + +} catch(PDOException $e) { + + // 接続エラーのときエラー内容を取得する + $error_message[] = $e->getMessage(); +} + +//ログイン認証--------------------------------------------------- +blockedIP($_SERVER['REMOTE_ADDR']); +$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user"); +if($is_login === false){ + header("Location: ../index.php"); + exit; +}else{ + $userid = safetext($is_login['userid']); + $username = safetext($is_login['username']); + $loginid = safetext($is_login["loginid"]); + $role = safetext($is_login["role"]); + $sacinfo = safetext($is_login["sacinfo"]); + $myblocklist = safetext($is_login["blocklist"]); + $myfollowlist = safetext($is_login["follow"]); + $is_Admin = safetext($is_login["admin"]); +} + +require('../logout/logout.php'); +?> + + + + uwuzu API Docs - <?php echo safetext($serversettings["serverinfo"]["server_name"]);?> + + + + + + + + + +
+ + + + + + +
+ + + +
+ + + diff --git a/api-docs/loading.css b/api-docs/loading.css new file mode 100644 index 0000000..9c4ae1b --- /dev/null +++ b/api-docs/loading.css @@ -0,0 +1,30 @@ +html, +body, +#loading { + width: 100%; + height: 100%; + position: absolute; +} + +#loading { + display: flex; + align-items: center; +} + +iconify-icon { + margin: 0 auto; +} + +@media (prefers-color-scheme: light) { + #loading { + color: var(--text-color); + background-color: var(--background-color); + } +} + +@media (prefers-color-scheme: dark) { + #loading { + color: var(--background-color); + background-color: var(--dark-background-color); + } +} diff --git a/api-docs/openapi.php b/api-docs/openapi.php new file mode 100644 index 0000000..41fe111 --- /dev/null +++ b/api-docs/openapi.php @@ -0,0 +1,3280 @@ + 0, + 'path' => '/', + 'domain' => '', + 'secure' => true, + 'httponly' => true, + 'samesite' => 'Lax' +]); +session_start(); +session_regenerate_id(true); + +// データベースに接続 +try { + + $option = array( + PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION, + PDO::MYSQL_ATTR_MULTI_STATEMENTS => false + ); + $pdo = new PDO('mysql:charset=utf8mb4;dbname='.DB_NAME.';host='.DB_HOST , DB_USER, DB_PASS, $option); + +} catch(PDOException $e) { + + // 接続エラーのときエラー内容を取得する + $error_message[] = $e->getMessage(); +} + +//ログイン認証--------------------------------------------------- +blockedIP($_SERVER['REMOTE_ADDR']); +$is_login = uwuzuUserLogin($_SESSION, $_COOKIE, $_SERVER['REMOTE_ADDR'], "user"); +if($is_login === false){ + header("Location: ../index.php"); + exit; +}else{ + $userid = safetext($is_login['userid']); + $username = safetext($is_login['username']); + $loginid = safetext($is_login["loginid"]); + $role = safetext($is_login["role"]); + $sacinfo = safetext($is_login["sacinfo"]); + $myblocklist = safetext($is_login["blocklist"]); + $myfollowlist = safetext($is_login["follow"]); + $is_Admin = safetext($is_login["admin"]); +} + +$protocol = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off') ? 'https://' : 'http://'; +$domain = $_SERVER['HTTP_HOST']; +$port = ":" . $_SERVER['REMOTE_PORT']; +if ($protocol === "https://" && $port === 443) { + $port = ""; +} elseif ($protocol === "http://" && $port === 80) { + $port = ""; +} +$origin = $protocol . $domain . $port; + +$mojisizefile = "../server/textsize.txt"; +$max_ueuse_length = (int)safetext(file_get_contents($mojisizefile)); + +require('../logout/logout.php'); +?> + +openapi: 3.1.1 +info: + title: uwuzu API Docs + version: 自称v1.6.5 Hapuego + license: + name: UPUL + url: https://docs.uwuzu.com/docs/aboutuwuzu/upul + contact: + name: uwuzu開発部 + url: https://docs.uwuzu.com/docs/others/contact + email: daichimarukana@gmail.com + description: | + # 概要 + ## 注意事項など + > [!CAUTION] + > v1.3.4からの仕様変更されたAPI(bot-api)はv1.4.0にて廃止されました。 + + > [!WARNING] + > 必ずサンプルコード及びタイトルにあるURLに従って使用してください! + > 少しでも異なるURLにするとエラーなど正常に使用できないおそれがございます。 + + ## APIトークン + ### 概要 + uwuzu APIではほぼ全てのエンドポイントでAPIトークンが必要です。 + ### 取得方法 + #### 公式クライアント + https:///others の最下部にある`APIトークンの発行`を選択してください。 + クライアント名と権限を入力し`次へ`を選択します。 + 仕様上はユーザー認可のページを発行する仕組みです。 + そのためユーザー認可と同じ確認ページが表示されます。 + `許可`を選択することでAPIトークンを取得できます。 + > [!WARNING] + > このAPIトークンが表示されるのは1度きりです。 + > 紛失した場合は不正利用防止のためトークンを無効化し再生成してください。 + #### ユーザー認可 + ユーザー認可によるAPIトークンの取得が可能です。 + [`/api/auth`](./#tag/auth/get/auth)にユーザーをリダイレクトさせることで確認ページを表示できます。 + 許可がされた後、[`/api/token/get`](./#tag/token/get/token/get)に + [`/api/auth`](./#tag/token/get/token/get)で使用したセッションIDと + 同じセッションIDを使用しリクエストすることでAPIトークンが取得できます。 + また、[`/api/token/inquiry`](./#tag/token/get/token/inquiry)で + APIトークンを使用することで付与された権限を確認できます。 + > [!WARNING] + > APIトークンが取得できるのは1度きりです。 + > 紛失した場合は不正利用防止のためトークンを無効化し再生成してください。 + ### 認証方法 + Bearer認証が使用されていますが従来の方法でも可能です。 + #### Bearer認証(推奨) + ヘッダーに`Authorization`を含めてください。 + GET・POSTどちらでも使用できます。 + 内容は`Bearer [APIトークン]`です。 + JavaScriptの例: + ```javascript + fetch('https:///api/me/', { + method: 'POST', + headers: { + Authorization: 'Bearer abcdefg' + }, + credentials: 'omit' + }); + ``` + #### 従来の方法(body・URLパラメータ) + POSTの場合はbody、GETの場合はURLパラメータにAPIトークンを含めてください。 + JavaScriptの例: + ```javascript + // GET + fetch('/api/me/?token=abcdefg'); + + // POST + fetch('/api/me/', { + method: 'POST', + body: JSON.stringify({ + token: 'abcdefg' + }) + }); + ``` + + ## メディアの添付 + ### 概要 + 一部のエンドポイントではメディアを添付することができます。 + ### 注意 + これはGETのURLパラメータには非対応であり、 + POSTのbodyにのみ使用できます。 + また、Base64 EncodeはBase64 URLではないためMIMEタイプ等の記述は不要で、 + Base64 URLを使用することはできません。 + 動画、画像どちらにおいてもEXIFが削除されます。 + そして、画像においてはアップロードされた全ての画像が`.webp`に変換されます。 + ### 対応MIMEタイプ + 対応するMIMEタイプは以下の通りです。 + #### 画像 + - `image/gif` + - `image/jpeg` + - `image/png` + - `image/webp` + - `image/bmp` + #### 動画 + - `video/mpeg` + - `video/mp4` + - `video/webm` + - `video/x-msvideo` + +servers: + - url: https:///api + +security: + - bearerAuth: [] + +paths: + /serverinfo-api: + summary: /serverinfo-api + get: + $ref: "#/components/pathItems/ServerInfoAPI" + post: + $ref: "#/components/pathItems/ServerInfoAPI" + /me/: + summary: /me/ + get: + $ref: "#/components/pathItems/MeAPI" + post: + $ref: "#/components/pathItems/MeAPI" + /me/notification/: + summary: /me/notification/ + get: + tags: + - me + - notification + description: | + 自分宛の通知を取得できます。 + トークンのみ指定の場合直近25件の通知を取得します。 + operationId: me/notification + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/me/notification/index.php + security: + - bearerAuth: [] + parameters: + - page: + $ref: "#/components/parameters/page" + - limit: + $ref: "#/components/parameters/limit" + responses: + 200: + $ref: "#/components/responses/NotificationAPI" + 400: + $ref: "#/components/responses/APIAuthFailed" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - notification_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + post: + tags: + - me + - notification + description: | + 自分宛の通知を取得できます。 + トークンのみ指定の場合直近25件の通知を取得します。 + operationId: me/notification + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/me/notification/index.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + page: + $ref: "#/components/schemas/Page" + limit: + $ref: "#/components/schemas/Limit" + responses: + 200: + $ref: "#/components/responses/NotificationAPI" + 400: + $ref: "#/components/responses/APIAuthFailed" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - notification_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + /me/notification/read: + summary: /me/notification/read + get: + $ref: "#/components/pathItems/NotificationRead" + post: + $ref: "#/components/pathItems/NotificationRead" + /me/settings/: + summary: /me/settings/ + get: + tags: + - me + - settings + description: | + 重要な情報以外の自分のアカウント設定を変更できます。 + オプションパラメータをどれか一つ以上含めてください。 + operationId: me/settings + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/me/settings/index.php + security: + - bearerAuth: [] + parameters: + - name: username + in: query + schema: + title: ユーザー名 + type: string + maximum: 50 + example: あどみん + - name: profile + in: query + schema: + title: プロフィール + type: string + maximum: 1024 + example: あどみんです! + responses: + 200: + $ref: "#/components/responses/SuccessOnly" + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - 表示名を入力してください。(USERNAME_INPUT_PLEASE) + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 413: + $ref: "#/components/responses/SettingsCountOver" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + $ref: "#/components/schemas/UpdateFailed" + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + post: + tags: + - me + - settings + description: | + 重要な情報以外の自分のアカウント設定を変更できます。 + オプションパラメータをどれか一つ以上含めてください。 + operationId: me/settings + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/me/settings/index.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + username: + title: ユーザー名 + type: string + maximum: 50 + example: あどみん + profile: + title: プロフィール + type: string + maximum: 1024 + example: あどみんです! + icon: + title: アイコン画像 + type: string + format: Base64 Encode Image + example: Base64 Data + header: + title: ヘッダー画像 + type: string + format: Base64 Encode Image + example: Base64 Data + responses: + 200: + $ref: "#/components/responses/SuccessOnly" + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - 使用できない画像形式です。(FILE_UPLOAD_DEKINAKATTA) + - 表示名を入力してください。(USERNAME_INPUT_PLEASE) + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 413: + $ref: "#/components/responses/SettingsCountOver" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + description: Internal Server Error + content: + application/json: + schema: + oneOf: + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ERROR + - アップロード失敗!(1)エラーコード:FILE_DEKASUGUI_PHP_INI_KAKUNIN + - アップロード失敗!(1)エラーコード:FILE_DEKASUGUI_HTML_KAKUNIN + - アップロード失敗!(1)エラーコード:FILE_SUKOSHIDAKE_UPLOAD + - アップロード失敗!(1)エラーコード:FILE_UPLOAD_DEKINAKATTA + - アップロード失敗!(1)エラーコード:TMP_FOLDER_NAI + - アップロード失敗!(1)エラーコード:FILE_KAKIKOMI_SIPPAI + - アップロード失敗!(1)エラーコード:PHPINFO()_KAKUNIN + - アップロード失敗!(1)エラーコード:TMP_FILE_NAI + - アップロード失敗!(1)エラーコード:SAVE_FOLDER_KAKIKOMI_KENNAI + - アップロード失敗!(1)エラーコード:MOVE_UPLOAD_FILE_SIPPAI + - アップロード失敗!(1)エラーコード: S3ERROR + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ERROR + - アップロード失敗!(2)エラーコード:FILE_DEKASUGUI_PHP_INI_KAKUNIN + - アップロード失敗!(2)エラーコード:FILE_DEKASUGUI_HTML_KAKUNIN + - アップロード失敗!(2)エラーコード:FILE_SUKOSHIDAKE_UPLOAD + - アップロード失敗!(2)エラーコード:FILE_UPLOAD_DEKINAKATTA + - アップロード失敗!(2)エラーコード:TMP_FOLDER_NAI + - アップロード失敗!(2)エラーコード:FILE_KAKIKOMI_SIPPAI + - アップロード失敗!(2)エラーコード:PHPINFO()_KAKUNIN + - アップロード失敗!(2)エラーコード:TMP_FILE_NAI + - アップロード失敗!(2)エラーコード:SAVE_FOLDER_KAKIKOMI_KENNAI + - アップロード失敗!(2)エラーコード:MOVE_UPLOAD_FILE_SIPPAI + - アップロード失敗!(2)エラーコード: S3ERROR + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + - type: object + properties: + error_code: + $ref: "#/components/schemas/UpdateFailed" + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + /users/: + summary: /users/ + get: + tags: + - users + description: 自分以外のユーザー情報を取得できます。 + operationId: users + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/users/index.php + security: + - bearerAuth: [] + parameters: + - userid: + $ref: "#/components/parameters/useridRequired" + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/User" + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + post: + tags: + - users + description: 自分以外のユーザー情報を取得できます。 + operationId: users + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/users/index.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + userid: + $ref: "#/components/schemas/UserID" + required: + - userid + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/User" + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + /users/follow: + summary: /users/follow + get: + tags: + - users + - follow + description: 自分以外のユーザーをフォローできます。 + operationId: users/follow + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/users/follow.php + security: + - bearerAuth: [] + parameters: + - name: userid + $ref: "#/components/parameters/useridRequired" + responses: + 200: + $ref: "#/components/responses/FollowSuccess" + 400: + $ref: "#/components/responses/FollowBadReq" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + $ref: "#/components/responses/FollowInternalServerError" + post: + tags: + - users + - follow + description: 自分以外のユーザーをフォローできます。 + operationId: users/follow + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/users/follow.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + userid: + $ref: "#/components/schemas/UserID" + required: + - userid + responses: + 200: + $ref: "#/components/responses/FollowSuccess" + 400: + $ref: "#/components/responses/FollowBadReq" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + $ref: "#/components/responses/FollowInternalServerError" + /users/unfollow: + summary: /users/unfollow + get: + tags: + - users + - follow + description: 自分以外のユーザーのフォローを解除できます。 + operationId: users/unfollow + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/users/unfollow.php + security: + - bearerAuth: [] + parameters: + - name: userid + $ref: "#/components/parameters/useridRequired" + responses: + 200: + $ref: "#/components/responses/FollowSuccess" + 400: + $ref: "#/components/responses/FollowBadReq" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + $ref: "#/components/responses/FollowInternalServerError" + post: + tags: + - users + - follow + description: 自分以外のユーザーのフォローを解除できます。 + operationId: users/unfollow + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/users/unfollow.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + userid: + $ref: "#/components/schemas/UserID" + required: + - userid + responses: + 200: + $ref: "#/components/responses/FollowSuccess" + 400: + $ref: "#/components/responses/FollowBadReq" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + $ref: "#/components/responses/FollowInternalServerError" + /ueuse/: + summary: /ueuse/ + get: + tags: + - ueuse + description: | + トークンのみ指定の場合直近25件のユーズを取得します。 + operationId: ueuse + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/index.php + security: + - bearerAuth: [] + parameters: + - page: + $ref: "#/components/parameters/page" + - limit: + $ref: "#/components/parameters/limit" + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + "0": + $ref: "#/components/schemas/ueuse" + "1": + $ref: "#/components/schemas/ueuse" + success: + $ref: "#/components/schemas/Success" + required: + - "0" + - "1" + - success + 400: + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/APIAuthFailed" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ueuse_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + post: + tags: + - ueuse + description: | + トークンのみ指定の場合直近25件のユーズを取得します。 + operationId: ueuse + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/index.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + page: + $ref: "#/components/schemas/Page" + limit: + $ref: "#/components/schemas/Limit" + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + "0": + $ref: "#/components/schemas/ueuse" + "1": + $ref: "#/components/schemas/ueuse" + success: + $ref: "#/components/schemas/Success" + required: + - "0" + - "1" + - success + 400: + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/APIAuthFailed" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ueuse_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + /ueuse/get: + summary: /ueuse/get + get: + tags: + - ueuse + description: 特定の投稿を一つだけ取得します。(単一の投稿を取得します。) + operationId: ueuse/get + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/get.php + security: + - bearerAuth: [] + parameters: + - uniqid: + $ref: "#/components/parameters/uniqidRequired" + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + "0": + $ref: "#/components/schemas/ueuse" + success: + $ref: "#/components/schemas/Success" + required: + - "0" + - success + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ueuse_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + post: + tags: + - ueuse + description: 特定の投稿を一つだけ取得します。(単一の投稿を取得します。) + operationId: ueuse/get + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/get.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + uniqid: + $ref: "#/components/schemas/UniqID" + required: + - uniqid + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + "0": + $ref: "#/components/schemas/ueuse" + success: + $ref: "#/components/schemas/Success" + required: + - "0" + - success + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ueuse_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + /ueuse/replies: + summary: /ueuse/replies + get: + tags: + - ueuse + description: | + 特定の投稿とそれにされた返信を取得します。 + 帰ってきたjsonの一番上の投稿がuniqidにて指定したものになります。 + operationId: ueuse/replies + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/replies.php + security: + - bearerAuth: [] + parameters: + - uniqid: + $ref: "#/components/parameters/uniqidRequired" + - limit: + $ref: "#/components/parameters/limit" + - page: + $ref: "#/components/parameters/page" + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + "0": + $ref: "#/components/schemas/ueuse" + "1": + $ref: "#/components/schemas/ueuse" + success: + $ref: "#/components/schemas/Success" + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ueuse_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + post: + tags: + - ueuse + description: | + 特定の投稿とそれにされた返信を取得します。 + 帰ってきたjsonの一番上の投稿がuniqidにて指定したものになります。 + operationId: ueuse/replies + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/replies.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + uniqid: + $ref: "#/components/schemas/UniqID" + limit: + $ref: "#/components/schemas/Limit" + page: + $ref: "#/components/schemas/Page" + required: + - uniqid + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + "0": + $ref: "#/components/schemas/ueuse" + "1": + $ref: "#/components/schemas/ueuse" + success: + $ref: "#/components/schemas/Success" + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ueuse_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + /ueuse/mentions: + summary: /ueuse/mentions + get: + tags: + - ueuse + description: | + > [!Note] + > v1.6.0以前と以後で仕様が異なっており、v1.6.0以前に行われたメンションは取得できません。 + > 使用方法は同じです。 + + 自分のメンションされた投稿を取得します。 + operationId: ueuse/mentions + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/mentions.php + security: + - bearerAuth: [] + parameters: + - limit: + $ref: "#/components/parameters/limit" + - page: + $ref: "#/components/parameters/page" + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + "0": + $ref: "#/components/schemas/ueuse" + "1": + $ref: "#/components/schemas/ueuse" + success: + $ref: "#/components/schemas/Success" + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ueuse_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + post: + tags: + - ueuse + description: | + > [!Note] + > v1.6.0以前と以後で仕様が異なっており、v1.6.0以前に行われたメンションは取得できません。 + > 使用方法は同じです。 + + 自分のメンションされた投稿を取得します。 + operationId: ueuse/mentions + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/mentions.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + limit: + $ref: "#/components/schemas/Limit" + page: + $ref: "#/components/schemas/Page" + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + "0": + $ref: "#/components/schemas/ueuse" + "1": + $ref: "#/components/schemas/ueuse" + success: + $ref: "#/components/schemas/Success" + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ueuse_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + /ueuse/search: + summary: /ueuse/search + get: + tags: + - ueuse + description: keywordに入れた言葉をすべての投稿の中から検索してマッチしたものを返します。 + operationId: ueuse/search + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/search.php + security: + - bearerAuth: [] + parameters: + - keyword: + name: keyword + in: query + schema: + title: キーワード + type: string + example: Test + required: true + - limit: + $ref: "#/components/parameters/limit" + - page: + $ref: "#/components/parameters/page" + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + "0": + $ref: "#/components/schemas/ueuse" + "1": + $ref: "#/components/schemas/ueuse" + success: + $ref: "#/components/schemas/Success" + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ueuse_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + post: + tags: + - ueuse + description: keywordに入れた言葉をすべての投稿の中から検索してマッチしたものを返します。 + operationId: ueuse/search + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/search.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + keyword: + title: キーワード + type: string + example: Test + limit: + $ref: "#/components/schemas/Limit" + page: + $ref: "#/components/schemas/Page" + required: + - keyword + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + "0": + $ref: "#/components/schemas/ueuse" + "1": + $ref: "#/components/schemas/ueuse" + success: + $ref: "#/components/schemas/Success" + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ueuse_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + /ueuse/create: + summary: /ueuse/create + get: + tags: + - ueuse + description: | + このAPIを使用すると新たに投稿をすることができます。 + 引用/リユーズと返信は同時に使用できません。 + operationId: ueuse/create + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/create.php + security: + - bearerAuth: [] + parameters: + - text: + name: text + in: query + schema: + title: 本文 + type: string + example: "Text\nText" + required: true + - nsfw: + name: nsfw + in: query + schema: + title: NSFWにするかどうか + type: boolean + enum: + - true + - false + default: false + example: true + - replyid: + name: replyid + in: query + schema: + title: 返信先ユーズ + type: string + example: 1vgsg0v3tzv + - reuseid: + name: reuseid + in: query + schema: + title: 引用/リユーズ先ユーズ + type: string + example: 1vgsg0v3tzv + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + uniqid: + $ref: "#/components/schemas/UniqID" + userid: + $ref: "#/components/schemas/UserID" + required: + - uniqid + - userid + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - this_account_has_been_frozen + - contains_prohibited_url + - could_not_complete + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 413: + description: Content Too Large + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - content_to__characters + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 429: + description: Too Many Requests + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - over_rate_limit + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - could_not_complete + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + post: + tags: + - ueuse + description: | + このAPIを使用すると新たに投稿をすることができます。 + 引用/リユーズと返信は同時に使用できません。 + operationId: ueuse/create + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/create.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + text: + title: 本文 + type: string + maximum: + example: "Text\nText" + nsfw: + title: NSFWにするかどうか + type: boolean + enum: + - true + - false + default: false + example: true + image1: + title: 画像1 + type: string + format: Base64 Encode Image + example: Base64 Data + image2: + title: 画像2 + type: string + format: Base64 Encode Image + example: Base64 Data + image3: + title: 画像3 + type: string + format: Base64 Encode Image + example: Base64 Data + image4: + title: 画像4 + type: string + format: Base64 Encode Image + example: Base64 Data + replyid: + title: 返信先ユーズ + type: string + example: 1vgsg0v3tzv + reuseid: + title: 引用/リユーズ先ユーズ + type: string + example: 1vgsg0v3tzv + required: + - text + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + uniqid: + $ref: "#/components/schemas/UniqID" + userid: + $ref: "#/components/schemas/UserID" + required: + - uniqid + - userid + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - this_account_has_been_frozen + - contains_prohibited_url + - upload_error + - could_not_complete + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 413: + description: Content Too Large + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - content_to__characters + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 429: + description: Too Many Requests + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - over_rate_limit + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - upload_error + - could_not_complete + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + /ueuse/delete: + summary: /ueuse/delete + get: + tags: + - ueuse + description: 投稿の削除が可能です。 + operationId: ueuse/delete + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/delete.php + security: + - bearerAuth: [] + parameters: + - uniqid: + $ref: "#/components/parameters/uniqidRequest" + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + uniqid: + $ref: "#/components/schemas/UniqID" + userid: + $ref: "#/components/schemas/UserID" + success: + $ref: "#/components/schemas/Success" + required: + - uniqid + - userid + - success + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + uniqid: + $ref: "#/components/schemas/UniqID" + userid: + $ref: "#/components/schemas/UserID" + success: + $ref: "#/components/schemas/Failed" + required: + - uniqid + - userid + - success + post: + tags: + - ueuse + description: 投稿の削除が可能です。 + operationId: ueuse/delete + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/delete.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + uniqid: + $ref: "#/components/schemas/UniqID" + required: + - uniqid + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + uniqid: + $ref: "#/components/schemas/UniqID" + userid: + $ref: "#/components/schemas/UserID" + success: + $ref: "#/components/schemas/Success" + required: + - uniqid + - userid + - success + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + uniqid: + $ref: "#/components/schemas/UniqID" + userid: + $ref: "#/components/schemas/UserID" + success: + $ref: "#/components/schemas/Failed" + required: + - uniqid + - userid + - success + /ueuse/bookmark/: + summary: /ueuse/bookmark/ + get: + tags: + - ueuse + description: ログインしているユーザーのブックマークを取得できます。 + operationId: ueuse/bookmark + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/bookmark/index.php + security: + - bearerAuth: [] + parameters: + - limit: + $ref: "#/components/parameters/limit" + - page: + $ref: "#/components/parameters/page" + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + "0": + $ref: "#/components/schemas/ueuse" + "1": + $ref: "#/components/schemas/ueuse" + success: + $ref: "#/components/schemas/Success" + required: + - success + 400: + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/APIAuthFailed" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ueuse_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + post: + tags: + - ueuse + description: ログインしているユーザーのブックマークを取得できます。 + operationId: ueuse/bookmark + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/ueuse/bookmark/index.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + limit: + $ref: "#/components/schemas/Limit" + page: + $ref: "#/components/schemas/Page" + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + "0": + $ref: "#/components/schemas/ueuse" + "1": + $ref: "#/components/schemas/ueuse" + success: + $ref: "#/components/schemas/Success" + required: + - success + 400: + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/APIAuthFailed" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ueuse_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + /favorite/change: + summary: /favorite/change + get: + tags: + - favorite + description: いいねを追加・削除できます。 + operationId: favorite/change + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/favorite/change.php + security: + - bearerAuth: [] + parameters: + - uniqid: + $ref: "#/components/parameters/uniqidRequired" + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + favorite_list: + title: いいねしたユーザー + type: string + description: 更新後が表示され、`,`区切りの`string`型です。 + example: ",admin" + success: + $ref: "#/components/schemas/Success" + required: + - favorite_list + - success + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + post: + tags: + - favorite + description: いいねを追加・削除できます。 + operationId: favorite/change + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/favorite/change.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + uniqid: + $ref: "#/components/schemas/UniqID" + required: + - uniqid + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + favorite_list: + title: いいねしたユーザー + type: string + description: 更新後が表示され、`,`区切りの`string`型です。 + example: ",admin" + success: + $ref: "#/components/schemas/Success" + required: + - favorite_list + - success + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + /favorite/get: + summary: /favorite/get + get: + tags: + - favorite + description: いいねの情報を取得できます。 + operationId: favorite/get + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/favorite/get.php + security: + - bearerAuth: [] + parameters: + - uniqid: + $ref: "#/components/parameters/uniqidRequired" + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + favorite_list: + title: いいねしたユーザー + type: string + description: "`,`区切りの`string`型です。" + example: ",admin" + success: + $ref: "#/components/schemas/Success" + required: + - favorite_list + - success + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + post: + tags: + - favorite + description: いいねの情報を取得できます。 + operationId: favorite/get + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/favorite/get.php + security: + - bearerAuth: [] + requestBody: + content: + application/json: + schema: + type: object + properties: + uniqid: + $ref: "#/components/schemas/UniqID" + required: + - uniqid + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + favorite_list: + title: いいねしたユーザー + type: string + description: "`,`区切りの`string`型です。" + example: ",admin" + success: + $ref: "#/components/schemas/Success" + required: + - favorite_list + - success + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/APIAuthFailed" + - $ref: "#/components/schemas/InputNotFound" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + /token/get: + summary: /token/get + get: + tags: + - token + description: APIアクセストークンを1回だけ取得できます。 + operationId: token/get + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/token/get.php + security: + - {} + parameters: + - session: + name: session + in: query + schema: + title: セッションID + type: string + example: eb774fe1-f826-9d2c-3296-de1db548b290 + format: uuid + required: true + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + success: + $ref: "#/components/schemas/Success" + username: + title: ユーザー名 + type: string + example: あどみん + userid: + $ref: "#/components/schemas/UserID" + token: + title: APIトークン + type: string + example: LLOC2lHPVoPqCqKWmvbdcdo9DmAHyySpBwqxseohtYilob85A8g9Ebd9m9UbERw9 + required: + - success + - username + - userid + - token + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - critical_error_userdata_not_found + - session_invalid + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + post: + tags: + - token + description: APIアクセストークンを1回だけ取得できます。 + operationId: token/get + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/token/get.php + security: + - {} + requestBody: + content: + application/json: + schema: + type: object + properties: + session: + title: セッションID + type: string + example: eb774fe1-f826-9d2c-3296-de1db548b290 + required: + - session + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + success: + $ref: "#/components/schemas/Success" + username: + title: ユーザー名 + type: string + example: あどみん + userid: + $ref: "#/components/schemas/UserID" + token: + title: APIトークン + type: string + example: LLOC2lHPVoPqCqKWmvbdcdo9DmAHyySpBwqxseohtYilob85A8g9Ebd9m9UbERw9 + required: + - success + - username + - userid + - token + 400: + description: Bad Request + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/InputNotFound" + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - critical_error_userdata_not_found + - session_invalid + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + /token/inquiry: + summary: /token/inquiry + get: + tags: + - token + description: APIアクセストークンの情報を照会できます。 + operationId: token/inquiry + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/token/inquiry.php + security: + - bearerAuth: [] + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + allow_scopes: + title: 付与された権限 + type: array + items: + title: 権限 + type: string + enum: + - read:me + - write:me + - read:users + - read:ueuse + - write:ueuse + - write:follow + - write:favorite + - read:notifications + - write:notifications + - write:bookmark + - read:bookmark + username: + title: ユーザー名 + type: string + example: あどみん + userid: + $ref: "#/components/schemas/UserID" + success: + $ref: "#/components/schemas/Success" + required: + - allow_scopes + - username + - userid + - success + 400: + description: Bad Request + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - this_account_has_been_frozen + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - could_not_complete + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + post: + tags: + - token + description: APIアクセストークンの情報を照会できます。 + operationId: token/inquiry + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/token/inquiry.php + security: + - bearerAuth: [] + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + allow_scopes: + title: 付与されている権限 + type: array + items: + title: 権限 + type: string + enum: + - read:me + - write:me + - read:users + - read:ueuse + - write:ueuse + - write:follow + - write:favorite + - read:notifications + - write:notifications + - write:bookmark + - read:bookmark + username: + title: ユーザー名 + type: string + example: あどみん + userid: + $ref: "#/components/schemas/UserID" + success: + $ref: "#/components/schemas/Success" + required: + - allow_scopes + - username + - userid + - success + 400: + description: Bad Request + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - this_account_has_been_frozen + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - could_not_complete + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + /auth: + summary: /auth + get: + tags: + - token + - auth + description: | + ユーザー認可によるAPIトークン取得方法の確認ページです。 + operationId: auth + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/auth.php + parameters: + - session: + name: session + description: | + UUIDなど、一意さの担保される方法でセッションIDを発行してください! + > [!CAUTION] + > 発行したセッションIDは絶対に使い回さないでください! + > また、絶対に第三者に公開しないでください! + in: query + schema: + title: セッションID + type: string + example: eb774fe1-f826-9d2c-3296-de1db548b290 + required: true + - client: + name: client + in: query + schema: + title: アプリケーション名 + type: string + example: uwuzuクライアント + required: true + - scope: + title: 要求する権限 + name: scope + description: | + `,`区切りで以下の表の権限を参考にしてください。 + > [!CAUTION] + > 権限を0にすることはできません。 + > 1つ以上の権限を含めてください。 + + | 権限名 | 権限の内容 | + | - | - | + | read:me | 重要な情報以外の自分のアカウントの情報を見る | + | write:me | 重要な情報以外の自分のアカウントの情報を変更する | + | read:ueuse | ユーズを見る | + | read:users | 自分以外のユーザーを見る | + | write:ueuse | ユーズの作成・削除をする | + | write:follow | フォロー・フォロー解除をする | + | write:favorite | いいねをする・解除をする | + | read:notifications | 通知を見る | + | write:notifications | 通知を既読にする | + | write:bookmark | ブックマークにユーズを追加・削除する | + | read:bookmark | ブックマークを見る | + in: query + schema: + type: string + example: read:account,read:ueuse + required: true + - icon: + name: icon + in: query + schema: + title: アプリケーションアイコン画像 + type: string + format: URL + example: https://example.com/application/icon.png + - about: + name: about + in: query + schema: + title: アプリケーションの説明 + type: string + example: uwuzuのクライアントです + - callback: + name: callback + in: query + schema: + title: コールバック先URL + type: string + example: https://example.com/application/callback + +components: + securitySchemes: + bearerAuth: + type: http + scheme: bearer + pathItems: + ServerInfoAPI: + tags: + - serverinfo-api + description: サーバー情報を取得できます。 + operationId: serverinfo-api + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/serverinfo-api.php + security: + - {} + responses: + 200: + description: OK + content: + application/json: + schema: + type: object + properties: + server_info: + $ref: "#/components/schemas/ServerInfo" + software: + title: サーバーソフトウェア + type: object + properties: + name: + title: 名称 + type: string + example: uwuzu + version: + title: バージョン + type: string + example: 1.6.5 + pattern: \d+\.\d+\.\d+ + repository: + title: リポジトリ + type: string + example: https://github.com/Daichimarukana/uwuzu + required: + - name + - version + - repository + server_notice: + $ref: "#/components/schemas/ServerNotice" + required: + - server_info + - software + - server_notice + MeAPI: + tags: + - me + description: | + 自分のユーザー情報を取得できます。 + メールアドレスなど一部の情報は取得できません。 + operationId: me + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/me/index.php + responses: + 200: + description: OK + content: + application/json: + schema: + $ref: "#/components/schemas/User" + 400: + $ref: "#/components/responses/APIAuthFailed" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - critical_error_userdata_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + NotificationRead: + tags: + - me + - notification + description: 自分宛の通知を一括既読できます。 + operationId: me/notification/read + externalDocs: + description: ソースコード + url: https://github.com/Daichimarukana/uwuzu/blob/main/api/me/notification/read.php + responses: + 200: + $ref: "#/components/responses/SuccessOnly" + 400: + $ref: "#/components/responses/APIAuthFailed" + 401: + $ref: "#/components/responses/Unauthorized" + 403: + $ref: "#/components/responses/Forbidden" + 500: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + $ref: "#/components/schemas/UpdateFailed" + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + responses: + SuccessOnly: + description: OK + content: + application/json: + schema: + type: object + properties: + success: + $ref: "#/components/schemas/Success" + required: + - success + InputNotFound: + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/InputNotFound" + Unauthorized: + description: Unauthorized + content: + application/json: + schema: + type: object + properties: + error_code: + $ref: "#/components/schemas/InputNotFound" + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + Forbidden: + description: Forbidden + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - token_invalid + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + APIAuthFailed: + description: Bad Request + content: + application/json: + schema: + $ref: "#/components/schemas/APIAuthFailed" + UserDataNotFound: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - critical_error_userdata_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + NotificationAPI: + description: OK + content: + application/json: + schema: + type: object + properties: + "0": + $ref: "#/components/schemas/Notification" + success: + $ref: "#/components/schemas/Success" + required: + - "0" + - success + SettingsCountOver: + description: Content Too Large + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - ユーザーネームは50文字以内で入力してください。(USERNAME_OVER_MAX_COUNT) + - プロフィールは1024文字以内で入力してください。(INPUT_OVER_MAX_COUNT) + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + FollowSuccess: + description: OK + content: + application/json: + schema: + type: object + properties: + userid: + $ref: "#/components/schemas/UserID" + success: + $ref: "#/components/schemas/Success" + required: + - userid + - success + FollowBadReq: + description: Bad Request + content: + application/json: + schema: + oneOf: + - type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - you_cant_it_to_yourself + - input_not_found + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + - $ref: "#/components/schemas/APIAuthFailed" + FollowInternalServerError: + description: Internal Server Error + content: + application/json: + schema: + type: object + properties: + error_code: + title: エラーコード + type: string + enum: + - critical_error_userdata_not_found + - could_not_complete + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + schemas: + InputNotFound: + title: パラメータ不足 + type: object + properties: + error_code: + $ref: "#/components/schemas/InputNotFound" + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + APIAuthFailed: + title: API認証失敗 + type: object + properties: + error_code: + type: string + description: エラーコード + enum: + - this_account_has_been_frozen + - token_invalid + - not_allow_scope + success: + $ref: "#/components/schemas/Failed" + required: + - error_code + - success + Notification: + title: 通知 + type: object + properties: + from: + type: object + description: 通知元ユーザー + properties: + username: + type: string + description: ユーザー名 + example: tester + userid: + $ref: "#/components/schemas/UserID" + user_icon: + type: string + description: アイコン画像 + format: URL + example: /usericons/XXXXXXXXXX-XXXXX.png + user_header: + type: string + description: ヘッダー画像 + format: URL + example: /usericons/XXXXXXXXXX-XXXXX.png + required: + - username + - userid + - user_icon + - user_header + category: + type: string + description: カテゴリ + enum: + - system + - favorite + - reply + - reuse + - ueuse + - follow + - mention + - other + - login + title: + type: string + description: タイトル + enum: + - testerさんが返信しました! + - testerさんがメンションしました! + - testerさんがリユーズしました! + - testerさんがいいねしました! + - testerさんが返信しました! + - testerさんにフォローされました!🎉 + - 🚪ログイン通知🚪 + text: + type: string + description: 本文 + example: test1 + datetime: + type: string + description: 通知時刻 + format: date + example: 2025-08-02 18:12:29 + is_checked: + type: boolean + description: 既読かどうか + enum: + - true + - false + required: + - from + - category + - title + - text + - datetime + - is_checked + ServerNotice: + title: お知らせ + type: array + items: + type: + - object + - string + properties: + title: + title: タイトル + type: string + example: お知らせ! + note: + title: 本文 + type: string + example: サービスを開始しました! + editor: + title: 配信者 + type: string + example: admin + datetime: + title: 配信時刻 + type: string + format: date + example: 2024-03-29 14:35:06 + required: + - title + - note + - editor + - datetime + required: + - server_info + - software + - server_notice + ServerInfo: + title: サーバー概要 + type: object + properties: + server_name: + title: 名称 + type: string + example: 新規さば + server_icon: + title: アイコン画像 + type: string + format: URL + example: /img/uwuzu_icon.png + server_description: + title: 説明文 + type: string + example: ようこそ新規さばへ!etc... + adminstor: + title: 運営者 + type: object + properties: + name: + title: 名前 + type: string + example: あどみん + email: + title: メールアドレス + type: string + example: admin@uwuzu.example.com + required: + - name + - email + terms_url: + title: 利用規約 + type: string + format: URL + example: /rule/terms + privacy_policy_url: + title: プライバシーポリシー + type: string + format: URL + example: /rule/privacypolicy + max_ueuse_length: + title: 文字数制限 + type: number + example: + invitation_code: + title: 招待制かどうか + type: boolean + enum: + - true + - false + account_migration: + title: アカウント移行が有効かどうか + type: boolean + enum: + - true + - false + usage: + title: カウント数 + type: object + properties: + users: + title: ユーザー数 + type: number + example: 120 + ueuse: + title: ユーズ数 + type: number + example: 5000 + required: + - users + - ueuse + required: + - server_name + - server_icon + - server_description + - adminstor + - terms_url + - privacy_policy_url + - max_ueuse_length + - invitation_code + - account_migration + - usage + User: + title: ユーザー + type: object + properties: + username: + title: ユーザー名 + type: string + maximum: 50 + example: あどみん + userid: + $ref: "#/components/schemas/UserID" + profile: + title: プロフィール + type: string + maximum: 1024 + example: あどみんです! + user_icon: + title: アイコン画像 + type: string + format: URL + example: /usericons/XXXXXXXXXX-XXXXX.png + user_header: + title: ヘッダー画像 + type: string + format: URL + example: /usericons/XXXXXXXXXX-XXXXX.png + registered_date: + title: 登録時刻 + type: string + example: 2024-03-09 02:19:04 + format: date + followee: + title: フォロー + type: array + items: + $ref: "#/components/schemas/UserID" + followee_cnt: + title: フォロー数 + type: number + example: 1 + follower: + title: フォロワー + type: array + items: + $ref: "#/components/schemas/UserID" + follower_cnt: + title: フォロワー数 + type: number + example: 1 + ueuse_cnt: + title: ユーズ数 + type: number + example: 38 + isBot: + title: BOTかどうか + type: boolean + description: + enum: + - true + - false + isAdmin: + title: 管理者かどうか + type: boolean + enum: + - true + - false + role: + title: ロール + type: array + items: + title: 詳細 + type: object + properties: + name: + title: 名称 + type: string + example: ゆーざー + color: + title: 色(16進数) + type: string + example: CCCCCC + effect: + title: エフェクト + type: string + enum: + - none + - shine + - rainbow + id: + title: ロールID + type: string + example: user + required: + - name + - color + - effect + - id + language: + title: 言語 + type: string + enum: + - ja-JP + required: + - username + - userid + - profile + - user_icon + - user_header + - registered_date + - followee + - followee_cnt + - follower + - follower_cnt + - ueuse_cnt + - isBot + - isAdmin + - role + - language + ueuse: + title: ユーズ + type: object + properties: + uniqid: + $ref: "#/components/schemas/UniqID" + replyid: + title: 返信先ユーズ(ユニークID) + type: string + description: 返信でない場合は`""`が返されます + example: 1vgsg0v3tzv + reuseid: + title: 引用/リユーズ元ユーズ(ユニークID) + type: string + description: 引用/リユーズでない場合は`""`が返されます + example: 1vgsg0v3tzv + text: + title: 本文 + type: string + maximum: + example: "Test\nTest" + account: + title: 投稿アカウント + type: object + properties: + username: + title: ユーザー名 + type: string + maximum: 50 + example: あどみん + userid: + $ref: "#/components/schemas/UserID" + user_icon: + title: アイコン画像 + type: string + format: URL + example: /usericons/XXXXXXXXXX-XXXXX.png + user_header: + title: ヘッダー画像 + type: string + format: URL + example: /userheads/XXXXXXXXXX-XXXXX.png + is_bot: + title: BOTかどうか + type: boolean + enum: + - true + - false + required: + - username + - userid + - user_icon + - user_header + - is_bot + photo1: + title: 画像1 + type: string + description: 添付されていない場合は`""`が返されます + format: URL + example: /ueuseimages/XXXXXXXXXX-XXXXX.png + photo2: + title: 画像2 + type: string + description: 添付されていない場合は`""`が返されます + format: URL + example: /ueuseimages/XXXXXXXXXX-XXXXX.png + photo3: + title: 画像3 + type: string + description: 添付されていない場合は`""`が返されます + format: URL + example: /ueuseimages/XXXXXXXXXX-XXXXX.png + photo4: + title: 画像4 + type: string + description: 添付されていない場合は`""`が返されます + format: URL + example: /ueuseimages/XXXXXXXXXX-XXXXX.png + video1: + title: 動画 + type: string + description: 添付されていない場合は`""`が返されます + format: URL + example: /ueusevideos/XXXXXXXXXX-XXXXX.mp4 + favorite: + title: いいね + type: array + items: + $ref: "#/components/schemas/UserID" + favorite_cnt: + title: いいね数 + type: number + example: 1 + reply_cnt: + title: 返信数 + type: number + example: 1 + reuse_cnt: + title: 引用/リユーズ数 + type: number + example: 1 + datetime: + title: 投稿時刻 + type: string + example: 2024-04-19 20:33:13 + format: date + abi: + title: 追記 + type: string + description: 追記がない場合は`""`が返されます + example: "" + abidatetime: + title: 追記時刻 + type: string + description: 追記がない場合は`0000-00-00 00:00:00`が返されます + example: 2024-04-19 20:33:13 + format: date + nsfw: + title: NSFWかどうか + type: boolean + enum: + - true + - false + required: + - uniqid + - replyid + - reuseid + - text + - account + - photo1 + - photo2 + - photo3 + - photo4 + - video1 + - favorite + - favorite_cnt + - reply_cnt + - reuse_cnt + - datetime + - abi + - abidatetime + - nsfw + Failed: + title: 成功かどうか + type: boolean + enum: + - false + Page: + title: ページ数 + type: number + default: 1 + example: 5 + Limit: + title: 制限数 + type: number + maximum: 100 + default: 25 + example: 60 + UpdateFailed: + title: エラーコード + type: string + enum: + - update_failed + UserID: + title: ユーザーID + type: string + maximum: 20 + example: admin + Success: + title: 成功かどうか + type: boolean + enum: + - true + UniqID: + title: ユニークID + type: string + example: 1vgsg0v3tzv + parameters: + page: + name: page + in: query + schema: + title: ページ数 + type: number + default: 1 + example: 5 + limit: + name: limit + in: query + schema: + title: 制限数 + type: number + maximum: 100 + default: 25 + example: 60 + pageRequired: + name: page + in: query + schema: + title: ページ数 + type: number + default: 1 + example: 5 + required: true + limitRequired: + name: limit + in: query + schema: + title: 制限数 + type: number + maximum: 100 + default: 25 + example: 60 + required: true + useridRequired: + name: userid + in: query + schema: + title: ユーザーID + type: string + maximum: 20 + example: admin + required: true + uniqidRequired: + name: uniqid + in: query + schema: + title: ユニークID + type: string + example: 1vgsg0v3tzv + required: true diff --git a/api-docs/uwuzu.png b/api-docs/uwuzu.png new file mode 100644 index 0000000..89794d5 Binary files /dev/null and b/api-docs/uwuzu.png differ diff --git a/api/.htaccess b/api/.htaccess index 68ad3cd..bc137cc 100644 --- a/api/.htaccess +++ b/api/.htaccess @@ -4,6 +4,7 @@ ErrorDocument 401 "" ErrorDocument 403 "" ErrorDocument 404 /errorpage/notfound.json ErrorDocument 413 "" +ErrorDocument 429 "" ErrorDocument 500 "" ErrorDocument 502 "" ErrorDocument 503 /errorpage/serverstop.json