forked from oawu/OA-apiDoc-Template
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_data.json
More file actions
1373 lines (1373 loc) · 34.6 KB
/
api_data.json
File metadata and controls
1373 lines (1373 loc) · 34.6 KB
1
[ { "name": "CreateArticle", "type": "post", "url": "articles/", "title": "新增文章", "group": "Article", "description": "<p>新增一篇文章</p>", "permission": [ { "name": "login", "title": "需先登入", "description": "<p>此 API 必需先登入後取得 <code>Access Token</code>,在藉由 Header 夾帶 Access Token 驗證身份</p>" } ], "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "<p>文章標題</p>" }, { "group": "Parameter", "type": "String", "optional": false, "field": "content", "description": "<p>文章內容</p>" } ] } }, "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "Article", "header": { "fields": { "Header": [ { "group": "Header", "type": "string", "optional": false, "field": "token", "description": "<p>登入後的 Access Token</p>" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n{\n \"message\": \"成功訊息..\",\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }, { "name": "DeleteArticle", "type": "delete", "url": "articles/:id/", "title": "刪除文章", "group": "Article", "description": "<p>刪除指定的文章</p>", "permission": [ { "name": "login", "title": "需先登入", "description": "<p>此 API 必需先登入後取得 <code>Access Token</code>,在藉由 Header 夾帶 Access Token 驗證身份</p>" } ], "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "<p>文章 ID</p>" } ] } }, "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "Article", "header": { "fields": { "Header": [ { "group": "Header", "type": "string", "optional": false, "field": "token", "description": "<p>登入後的 Access Token</p>" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n{\n \"message\": \"成功訊息..\",\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }, { "name": "GetArticle", "type": "get", "url": "users/:user_id/articles/:id/", "title": "取得指定文章內容", "group": "Article", "description": "<p>取得該位使用者下的某文章內容</p>", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": false, "field": "user_id", "description": "<p>使用者 ID</p>" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "<p>文章 ID</p>" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Number", "optional": false, "field": "id", "description": "<p>文章 ID</p>" }, { "group": "Success 200", "type": "Array", "optional": false, "field": "user", "description": "<p>作者</p>" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "user.id", "description": "<p>作者 ID</p>" }, { "group": "Success 200", "type": "String", "optional": false, "field": "user.name", "description": "<p>作者名稱</p>" }, { "group": "Success 200", "type": "String", "optional": false, "field": "title", "description": "<p>文章標題</p>" }, { "group": "Success 200", "type": "String", "optional": false, "field": "content", "description": "<p>文章內容,格式為 HTML</p>" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "pv", "description": "<p>累計瀏覽數</p>" }, { "group": "Success 200", "type": "Datetime", "optional": false, "field": "created_at", "description": "<p>建立時間</p>" }, { "group": "Success 200", "type": "Datetime", "optional": false, "field": "updated_at", "description": "<p>修改時間</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n{\n \"id\": 1,\n \"user\": {\n \"id\": 1,\n \"name\": \"OA Wu\"\n },\n \"title\": \"標題\",\n \"content\": \"<p>內文..</p>\",\n \"pv\": 20,\n \"created_at\": \"2017-04-01 12:13:14\",\n \"updated_at\": \"2017-04-01 13:14:15\"\n}", "type": "json" } ] }, "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "Article", "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }, { "name": "GetArticles", "type": "get", "url": "users/:user_id/articles/", "title": "取得文章列表", "group": "Article", "description": "<p>取得該位使用者下的文章列表</p>", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": true, "field": "offset", "defaultValue": "0", "description": "<p>位移</p>" }, { "group": "Parameter", "type": "String", "optional": true, "field": "limit", "defaultValue": "20", "description": "<p>長度</p>" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "user_id", "description": "<p>使用者 ID</p>" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "Number", "optional": false, "field": "id", "description": "<p>文章 ID</p>" }, { "group": "Success 200", "type": "Array", "optional": false, "field": "user", "description": "<p>作者</p>" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "user.id", "description": "<p>作者 ID</p>" }, { "group": "Success 200", "type": "String", "optional": false, "field": "user.name", "description": "<p>作者名稱</p>" }, { "group": "Success 200", "type": "String", "optional": false, "field": "title", "description": "<p>文章標題</p>" }, { "group": "Success 200", "type": "String", "optional": false, "field": "content", "description": "<p>文章內容,格式為 HTML</p>" }, { "group": "Success 200", "type": "Number", "optional": false, "field": "pv", "description": "<p>累計瀏覽數</p>" }, { "group": "Success 200", "type": "Datetime", "optional": false, "field": "created_at", "description": "<p>建立時間</p>" }, { "group": "Success 200", "type": "Datetime", "optional": false, "field": "updated_at", "description": "<p>修改時間</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n[\n {\n \"id\": 1,\n \"user\": {\n \"id\": 1,\n \"name\": \"OA Wu\"\n },\n \"title\": \"標題\",\n \"content\": \"<p>內文..</p>\",\n \"pv\": 20,\n \"created_at\": \"2017-04-01 12:13:14\",\n \"updated_at\": \"2017-04-01 13:14:15\"\n }\n]", "type": "json" } ] }, "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "Article", "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }, { "name": "UpdateArticle", "type": "put", "url": "articles/:id/", "title": "修改文章", "group": "Article", "description": "<p>修改指定的文章</p>", "permission": [ { "name": "login", "title": "需先登入", "description": "<p>此 API 必需先登入後取得 <code>Access Token</code>,在藉由 Header 夾帶 Access Token 驗證身份</p>" } ], "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "<p>文章 ID</p>" }, { "group": "Parameter", "type": "String", "optional": false, "field": "title", "description": "<p>文章標題</p>" }, { "group": "Parameter", "type": "String", "optional": false, "field": "content", "description": "<p>文章內容</p>" } ] } }, "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "Article", "header": { "fields": { "Header": [ { "group": "Header", "type": "string", "optional": false, "field": "token", "description": "<p>登入後的 Access Token</p>" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n{\n \"message\": \"成功訊息..\",\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }, { "name": "CreateArticleMessage", "type": "post", "url": "users/:user_id/articles/:article_id/messages/", "title": "新增留言", "group": "Message", "description": "<p>新增指定的該位使用者下的某文章內的留言</p>", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": false, "field": "user_id", "description": "<p>使用者 ID</p>" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "article_id", "description": "<p>文章 ID</p>" }, { "group": "Parameter", "type": "String", "optional": false, "field": "content", "description": "<p>留言內容</p>" } ] } }, "permission": [ { "name": "loginMaybe", "title": "須不須登入皆可", "description": "<p>此 API 若有帶 <code>Access Token</code> 則代表登入</p>" } ], "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "Message", "header": { "fields": { "Header": [ { "group": "Header", "type": "string", "optional": true, "field": "token", "description": "<p>登入後的 Access Token</p>" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n{\n \"message\": \"成功訊息..\",\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }, { "name": "DeleteArticleMessage", "type": "delete", "url": "users/:user_id/articles/:article_id/messages/:id", "title": "刪除留言", "group": "Message", "description": "<p>刪除指定的該位使用者下的某文章內的特定留言</p>", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": false, "field": "user_id", "description": "<p>使用者 ID</p>" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "article_id", "description": "<p>文章 ID</p>" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "<p>留言 ID</p>" }, { "group": "Parameter", "type": "String", "optional": false, "field": "content", "description": "<p>留言內容</p>" } ] } }, "permission": [ { "name": "loginMaybe", "title": "須不須登入皆可", "description": "<p>此 API 若有帶 <code>Access Token</code> 則代表登入</p>" } ], "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "Message", "header": { "fields": { "Header": [ { "group": "Header", "type": "string", "optional": true, "field": "token", "description": "<p>登入後的 Access Token</p>" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n{\n \"message\": \"成功訊息..\",\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }, { "name": "GetArticleMessages", "type": "get", "url": "users/:user_id/articles/:article_id/messages/", "title": "文章內的留言列", "group": "Message", "description": "<p>取得該位使用者下的某文章內的留言內容列表</p>", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": false, "field": "user_id", "description": "<p>使用者 ID</p>" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "article_id", "description": "<p>文章 ID</p>" } ] } }, "success": { "fields": { "會員": [ { "group": "會員", "type": "Number", "optional": true, "field": "id", "description": "<p>留言 ID</p>" }, { "group": "會員", "type": "Array", "optional": true, "field": "user", "description": "<p>留言者</p>" }, { "group": "會員", "type": "Number", "optional": true, "field": "user.id", "description": "<p>留言者 ID</p>" } ], "訪客": [ { "group": "訪客", "type": "String", "optional": true, "field": "user", "description": "<p>留言者</p>" } ], "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "user.name", "description": "<p>留言者名稱</p>" }, { "group": "Success 200", "type": "String", "optional": false, "field": "content", "description": "<p>內容</p>" }, { "group": "Success 200", "type": "Datetime", "optional": false, "field": "created_at", "description": "<p>建立時間</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n[\n {\n \"id\": 1,\n \"user\": {\n \"id\": 1,\n \"name\": \"OA Wu\"\n },\n \"content\": \"留言內容\",\n \"created_at\": \"2017-04-01 12:13:14\"\n },\n {\n \"id\": 2,\n \"user\": \"訪客\",\n \"content\": \"留言內容\",\n \"created_at\": \"2017-04-01 12:13:14\"\n }\n]", "type": "json" } ] }, "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "Message", "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }, { "name": "UpdateArticleMessage", "type": "put", "url": "users/:user_id/articles/:article_id/messages/:id", "title": "修改留言", "group": "Message", "description": "<p>修改指定的該位使用者下的某文章內的特定留言</p>", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": false, "field": "user_id", "description": "<p>使用者 ID</p>" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "article_id", "description": "<p>文章 ID</p>" }, { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "<p>留言 ID</p>" }, { "group": "Parameter", "type": "String", "optional": false, "field": "content", "description": "<p>留言內容</p>" } ] } }, "permission": [ { "name": "loginMaybe", "title": "須不須登入皆可", "description": "<p>此 API 若有帶 <code>Access Token</code> 則代表登入</p>" } ], "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "Message", "header": { "fields": { "Header": [ { "group": "Header", "type": "string", "optional": true, "field": "token", "description": "<p>登入後的 Access Token</p>" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n{\n \"message\": \"成功訊息..\",\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }, { "name": "GetCurrentUser", "type": "get", "url": "/users/current/", "title": "自己的資訊", "group": "User", "description": "<p>取得自己的資訊</p>", "permission": [ { "name": "login", "title": "需先登入", "description": "<p>此 API 必需先登入後取得 <code>Access Token</code>,在藉由 Header 夾帶 Access Token 驗證身份</p>" } ], "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "account", "description": "<p>我的帳號</p>" }, { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "<p>我的名稱</p>" }, { "group": "Success 200", "type": "Date", "optional": false, "field": "Birthday", "description": "<p>我的生日</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n{\n \"account\": \"oawu\",\n \"name\": \"OA Wu\",\n \"Birthday\": null\n}", "type": "json" } ] }, "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "User", "header": { "fields": { "Header": [ { "group": "Header", "type": "string", "optional": false, "field": "token", "description": "<p>登入後的 Access Token</p>" } ] } }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }, { "name": "GetUser", "type": "get", "url": "/users/:id/", "title": "使用者資訊", "group": "User", "description": "<p>取得使用者相關資訊</p>", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "Number", "optional": false, "field": "id", "description": "<p>使用者的 ID</p>" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "name", "description": "<p>使用者名稱</p>" }, { "group": "Success 200", "type": "Date", "optional": false, "field": "Birthday", "description": "<p>使用者生日</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n{\n \"name\": \"OA Wu\",\n \"Birthday\": null\n}", "type": "json" } ] }, "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "User", "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }, { "name": "PutUser", "type": "put", "url": "/users/", "title": "修改使用者資訊", "group": "User", "description": "<p>修改使用者相關資訊</p>", "permission": [ { "name": "login", "title": "需先登入", "description": "<p>此 API 必需先登入後取得 <code>Access Token</code>,在藉由 Header 夾帶 Access Token 驗證身份</p>" } ], "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": true, "field": "password", "description": "<p>密碼</p>" }, { "group": "Parameter", "type": "String", "optional": true, "field": "name", "description": "<p>名稱</p>" }, { "group": "Parameter", "type": "date", "optional": true, "field": "birthday", "description": "<p>生日</p>" } ] } }, "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "User", "header": { "fields": { "Header": [ { "group": "Header", "type": "string", "optional": false, "field": "token", "description": "<p>登入後的 Access Token</p>" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n{\n \"message\": \"成功訊息..\",\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }, { "name": "Login", "type": "post", "url": "/login/", "title": "登入", "group": "Platform", "description": "<p>登入系統</p>", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "account", "description": "<p>帳號</p>" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "<p>密碼</p>" } ] } }, "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "token", "description": "<p>Access Token</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n{\n \"token\": \"a0b1c2d3e4f5g6h7i8j9k\",\n}", "type": "json" } ] }, "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "__", "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }, { "name": "Register", "type": "post", "url": "/register/", "title": "註冊", "group": "Platform", "description": "<p>註冊會員</p>", "parameter": { "fields": { "Parameter": [ { "group": "Parameter", "type": "String", "optional": false, "field": "account", "description": "<p>帳號</p>" }, { "group": "Parameter", "type": "String", "optional": false, "field": "password", "description": "<p>密碼</p>" }, { "group": "Parameter", "type": "String", "optional": false, "field": "name", "description": "<p>名稱</p>" }, { "group": "Parameter", "type": "date", "optional": true, "field": "birthday", "description": "<p>生日</p>" } ] } }, "version": "0.0.0", "filename": "app/controller/api/Users.php", "groupTitle": "__", "success": { "fields": { "Success 200": [ { "group": "Success 200", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "成功:", "content": "HTTP/1.1 200 OK\n{\n \"message\": \"成功訊息..\",\n}", "type": "json" } ] }, "error": { "fields": { "Error 4xx": [ { "group": "Error 4xx", "type": "String", "optional": false, "field": "message", "description": "<p>訊息</p>" } ] }, "examples": [ { "title": "錯誤:", "content": "HTTP/1.1 400 Error\n{\n \"message\": \"錯誤訊息..\",\n}", "type": "json" } ] } }]