[关闭]
@KomeijiSatori 2017-04-05T13:10:26.000000Z 字数 10769 阅读 1376

OTOMADS Android端功能需求文档

UI风格:Material Design

0x01.需求列表

  1. 注册/登录
  2. 最近上传视频读取(GRID列表)
  3. 公告展示
  4. 云端消息推送
  5. Timeline展示(List列表)
  6. 用户空间
  7. 关注/取消关注用户
  8. 视频收藏
  9. APP更新推送
  10. 用户设置(更换头像/更换签名/重置密码)
  11. 找回密码
  12. 视频搜索
  13. 语言切换
  14. 视频管理
  15. 推荐视频展示
  16. 视频播放
  17. 视频缓存
  18. 后台播放
  19. 评论区
  20. 待补充....

0x02.接口文档

OTOMADS API Docs

API Version:1.0

API Router:https://otomads.com/api/?type={API Name}

API Name List


API Name: get_user_timeline

Effect:Return User focus video

Need:after Login
Method:GET
Inbound parameter: none

Return Samples

if success

  1. [
  2. {
  3. "id": "864",
  4. "title": "【音MAD】上海紅茶館 ~ Chinese Tea",
  5. "desc": "av2180410,sm25974910\npv和音mad都非常的好,就把它搬过来了。\n作者:青年萨玛\n已授权",
  6. "upload_uid": "671",
  7. "cover": "https://static.otomads.com/v/06cb735c9840feef83d74c4143483726.jpg",
  8. "upload_time": "1485770455",
  9. "zan": "8"
  10. },
  11. {
  12. "id": "569",
  13. "title": "郭洪山教你唱蒙古人",
  14. "desc": "[原创] 本视频为蒙古国宝-呼麦大师郭洪山的练习视频,一般人请勿模仿。",
  15. "upload_uid": "7",
  16. "cover": "https://static.otomads.com/v/d648573f149fec6ed4535e092106e26c.jpg",
  17. "upload_time": "1481070349",
  18. "zan": "16"
  19. }
  20. ]

if not login

  1. {
  2. "status":401,
  3. "message":"error.generic.notLoggedIn"
  4. }

API Name: get_global_msg

Effect:Return Global Notice

Need:none
Method:GET
Inbound parameter: none

Return Samples

  1. [
  2. {
  3. "zh": {
  4. "title": "hhhh",
  5. "content": "balabala",
  6. "href": "balabala",
  7. "time": "1479215924"
  8. },
  9. "en": {
  10. "title": "hhhh",
  11. "content": "balabala",
  12. "href": "balabala",
  13. "time": "1479215924"
  14. },
  15. "ja": {
  16. "title": "hhhh",
  17. "content": "balabala",
  18. "href": "balabala",
  19. "time": "1479215924"
  20. }
  21. },
  22. {
  23. "zh": {
  24. "title": "hhhh2",
  25. "content": "balabala",
  26. "href": "balabala",
  27. "time": "1479215924"
  28. },
  29. "en": {
  30. "title": "hhhh2",
  31. "content": "balabala",
  32. "href": "balabala",
  33. "time": "1479215924"
  34. },
  35. "ja": {
  36. "title": "hhhh2",
  37. "content": "balabala",
  38. "href": "balabala",
  39. "time": "1479215924"
  40. }
  41. }
  42. ]

API Name: follow_user

Effect:Follow Appoint User

Need:after login
Method:POST
Inbound parameter: id (User id)

Return Samples

if success:

  1. {
  2. "status":200,
  3. "message":"success"
  4. }

if not login

  1. {
  2. "status":401,
  3. "message":"error.generic.notLoggedIn"
  4. }

if follow self

  1. {
  2. "status":400,
  3. "message":"error.generic.notAllowFollowSelf"
  4. }

if user not found

  1. {
  2. "status":404,
  3. "message":"error.user.notFound"
  4. }

if following

  1. {
  2. "status":403,
  3. "message":"error.user.Following"
  4. }

API Name: unfollow_user

Effect:UnFollow Appoint User

Need:after login
Method:POST
Inbound parameter: id (User id)

Return Samples

if success

  1. {
  2. "status":200,
  3. "message":"success"
  4. }

if not login

  1. {
  2. "status":401,
  3. "message":"error.generic.notLoggedIn"
  4. }

if unfollow self

  1. {
  2. "status":400,
  3. "message":"error.generic.notAllowUnFollowSelf"
  4. }

if user not found

  1. {
  2. "status":404,
  3. "message":"error.user.notFound"
  4. }

if not following

  1. {
  2. "status":403,
  3. "message":"error.user.notFllowing"
  4. }

API Name: get_user_follow

Effect:Get Follower List

Need:none
Method:GET
Inbound parameter: id (User id)

Return Samples

if success

  1. {
  2. "count": 3,
  3. "result": [
  4. {
  5. "id": "9",
  6. "username": "琪露诺",
  7. "avatar_link": "https://static.otomads.com/ddc9bb8786f22da9a90f62c6fda7c0f3.jpg"
  8. },
  9. {
  10. "id": "7",
  11. "username": "玉米",
  12. "avatar_link": "https://static.otomads.com/5c597185ead2c13b8ddf99e83b90bd8c.jpg"
  13. },
  14. {
  15. "id": "100",
  16. "username": "BBleae",
  17. "avatar_link": "https://static.otomads.com/03910ee2ee43c0ed0f78f218c2dfe2ca.jpg"
  18. }
  19. ]
  20. }

if no any follower && user not found

  1. {
  2. "count": 0,
  3. "result": []
  4. }

API Name: get_self_video

Effect:Get all self video (Audited and Unaudited)

Need:after login
Method:GET
Inbound parameter: none

Return Samples

if success

  1. {
  2. "count": 2,
  3. "video": [
  4. {
  5. "id": "1",
  6. "title": "大新闻三十分",
  7. "desc": "全ての元凶",
  8. "url": "https://static.otomads.com/v/bignews.mp4",
  9. "upload_uid": "9",
  10. "cover": "https://static.otomads.com/v/67e5aa8c2ea8106767fdddda5c94c1ea.jpg",
  11. "errmsg": "user.video.VideoAuditSuccess",
  12. "status_code": "1",
  13. "upload_time": "1479164047",
  14. "zan": "27",
  15. "is_pass": "1"
  16. },
  17. {
  18. "id": "866",
  19. "title": "【龙女仆】康娜的变态国",
  20. "desc": "转自 sm30486020",
  21. "url": "https://static.otomads.com/1ab196bb253fe635fc5c3616297ba5ce.mp4",
  22. "upload_uid": "9",
  23. "cover": "https://static.otomads.com/v/4c5b592cafbaf28e28f0af176b8b1dab.jpg",
  24. "errmsg": "user.video.VideoAuditSuccess",
  25. "status_code": "1",
  26. "upload_time": "1485803752",
  27. "zan": "4",
  28. "is_pass": "1"
  29. }
  30. ]
  31. }

if not login

  1. {
  2. "status":401,
  3. "message":"error.generic.notLoggedIn"
  4. }

API Name: edit_video_info

Effect:Edit Video info

Need:after login
Method:POST
Inbound parameter: id,(Video id),content (json type)

content schema

  1. {
  2. "title":"啊啊后唱戏",
  3. "desc":"我们明年再见"
  4. }

Return Samples

if success

  1. {
  2. "status":200,
  3. "message":"ok"
  4. }

if not login

  1. {
  2. "status":401,
  3. "message":"error.generic.notLoggedIn"
  4. }

if empty video id

  1. {
  2. "status":403,
  3. "message":"error.video.nullId"
  4. }

if empty content

  1. {
  2. "status":403,
  3. "message":"error.video.invalidContent"
  4. }

if video not exists

  1. {
  2. "status":404,
  3. "message":"error.video.notFound"
  4. }

if it is not video uploader

  1. {
  2. "status":403,
  3. "message":"error.generic.premissionDenied"
  4. }

if title too long

  1. {
  2. "status":403,
  3. "message":"error.video.titleTooLong"
  4. }

if description too long

  1. {
  2. "status":403,
  3. "message":"error.video.descTooLong"
  4. }

API Name: set_user_profile

Effect:Set User Profile

Need:after login
Method:POST
Inbound parameter: content

content schema

  1. {
  2. "toolkit": [
  3. "拍大师",
  4. "begas"
  5. ],
  6. "contact": {
  7. "qq": 3077855320,
  8. "weibo": "",
  9. "twitter": "@satori_moe",
  10. "telegram": "@SaotriKomeiji",
  11. "email": "admin@touhou.cx"
  12. }
  13. }

Return Samples

if success

  1. {
  2. "status":200,
  3. "message":"success"
  4. }

if invaild content

  1. {
  2. "status":403,
  3. "message":"error.video.invalidContent"
  4. }

if not login

  1. {
  2. "status":401,
  3. "message":"error.generic.notLoggedIn"
  4. }

API Name: reset_password

Effect:Reset User Password

Need:none
Method:POST
Inbound parameter: email (user email)

Return Samples

if success

  1. {
  2. "status":200,
  3. "message":"success"
  4. }

if empty email address

  1. {
  2. "status":403,
  3. "message":"error.user.nullemailAddr"
  4. }

if email address not vaild

  1. {
  2. "status":403,
  3. "message":"error.user.mailNotVaild"
  4. }

API Name: suggest_video

Effect:Get suggest video

Need:none
Method:GET
Inbound parameter: none

Return Samples

  1. {
  2. "count": 1,
  3. "video": [
  4. {
  5. "id": "1",
  6. "title": "大新闻三十分",
  7. "desc": "全ての元凶",
  8. "url": "https://static.otomads.com/v/bignews.mp4",
  9. "upload_uid": "9",
  10. "cover": "https://static.otomads.com/v/67e5aa8c2ea8106767fdddda5c94c1ea.jpg",
  11. "errmsg": " ",
  12. "status_code": "1",
  13. "upload_time": "1479164047",
  14. "zan": "27",
  15. "is_pass": "1",
  16. "tags": "S触,合作",
  17. "upload_user": "琪露诺",
  18. "upload_avatar": "https://static.otomads.com/ddc9bb8786f22da9a90f62c6fda7c0f3.jpg"
  19. }
  20. ]
  21. }

API Name: change_signature

Effect:Change user signature

Need:none
Method:POST
Inbound parameter: content (user signature text)

Return Samples

if success

  1. {
  2. "status":200,
  3. "message":"success"
  4. }

if not login

  1. {
  2. "status":401,
  3. "message":"error.generic.notLoggedIn"
  4. }

API Name: reply

Effect:Reply Video

Need:after login
Method:POST
Inbound parameter: id (Video id),content(comment text)

Return Samples

if success

  1. {
  2. "status":200,
  3. "message":"success",
  4. "cid":1234
  5. }

API Name: get_reply

Effect:Get Reply List

Need:none
Method:Get
Inbound parameter: id (Video id)

Return Samples

if success

  1. {
  2. "count": 2,
  3. "comments": [
  4. {
  5. "id": "772",
  6. "uid": "311",
  7. "reply_uid": "0",
  8. "content": "太触力11",
  9. "send_time": "1485858626",
  10. "username": "东方的记者",
  11. "avatar": "https://static.otomads.com/a71b5fb51f75e67094969e41fb5996ee.jpg"
  12. },
  13. {
  14. "id": "762",
  15. "uid": "100",
  16. "reply_uid": "0",
  17. "content": "触,,太触了这个,,,",
  18. "send_time": "1485786276",
  19. "username": "BBleae",
  20. "avatar": "https://static.otomads.com/03910ee2ee43c0ed0f78f218c2dfe2ca.jpg"
  21. }
  22. ]
  23. }

API Name: remove_reply

Effect:Remove Reply

Need:after login
Method:POST
Inbound parameter: id (Comment id)

Return Samples

  1. {
  2. "status":200,
  3. "message":"error.video.removed",
  4. }

API Name: remove_self_video

Effect:Delete Self Video

Need:after login
Method:POST
Inbound parameter: id (Video id)

Return Samples

if success

  1. {
  2. "status":200,
  3. "message":"error.video.removed",
  4. }

API Name: video_collect

Effect: Collect Video

Need:after login
Method:POST
Inbound parameter: id (Video id)

Return Samples

if success

  1. {
  2. "status":200,
  3. "message":"success",
  4. }

if not login

  1. {
  2. "status":401,
  3. "message":"error.generic.notLoggedIn"
  4. }

API Name: video_uncollect

Effect: UnCollect Video

Need:after login
Method:POST
Inbound parameter: id (Video id)

Return Samples

if success

  1. {
  2. "status":200,
  3. "message":"success",
  4. }

if not login

  1. {
  2. "status":401,
  3. "message":"error.generic.notLoggedIn"
  4. }

API Name: get_collect_list

Effect: Get Collect List

Need:none
Method:Get
Inbound parameter: id (User id)

Return Samples

  1. {
  2. "count": 1,
  3. "video": [
  4. {
  5. "id": "864",
  6. "title": "【音MAD】上海紅茶館 ~ Chinese Tea",
  7. "desc": "av2180410,sm25974910\npv和音mad都非常的好,就把它搬过来了。\n作者:青年萨玛\n已授权",
  8. "upload_uid": "671",
  9. "cover": "https://static.otomads.com/v/06cb735c9840feef83d74c4143483726.jpg",
  10. "upload_time": "1485770455",
  11. "zan": "9",
  12. "is_pass": "1",
  13. "tags": "上海紅茶館",
  14. "upload_user": "寒秋奈琉璃",
  15. "upload_avatar": "https://static.otomads.com/27b9af4887d2163585644afc0d3c26ad.jpg"
  16. }
  17. ]
  18. }

Effect: Search Video

Need:none
Method:Get
Inbound parameter: content(search text&&Username&&tags)

Return Samples

  1. {
  2. "count": 1,
  3. "result": [
  4. {
  5. "id": "1",
  6. "title": "大新闻三十分",
  7. "desc": "全ての元凶",
  8. "url": "https://static.otomads.com/v/bignews.mp4",
  9. "upload_uid": "9",
  10. "cover": "https://static.otomads.com/v/67e5aa8c2ea8106767fdddda5c94c1ea.jpg",
  11. "errmsg": " ",
  12. "status_code": "1",
  13. "upload_time": "1479164047",
  14. "zan": "27",
  15. "is_pass": "1",
  16. "upload_user": "琪露诺"
  17. }
  18. ]
  19. }

API Name: get_login_status

Effect: Get Login Status

Need:none
Method:Get
Inbound parameter: none

Return Samples

success login

  1. {
  2. "status": 200,
  3. "uid": 5,
  4. "username": "KomeijiSatori",
  5. "avatar": "https://static.otomads.com/074fc85e12b1cf4ced728c4c7cdb1059.jpg"
  6. }

not login

  1. {
  2. "status": 401,
  3. "uid": 0,
  4. "username": "未登录",
  5. "avatar": "https://static.otomads.com/akarin.jpg"
  6. }

API Name: get_video_info

Effect: Get Video Info

Need:none
Method:Get
Inbound parameter: id(Video ID)

Return Samples

  1. {
  2. "id": "5",
  3. "title": "塑料曲奇冒险",
  4. "desc": "[转载] sm18319732 我做不到每次上某站都要翻墙",
  5. "url": "https://static.fruitline.net/c763a0cbd5008d62a27ddd9202ec9c1c.mp4",
  6. "upload_uid": "21",
  7. "cover": "https://static.otomads.com/v/2b9aecb12c2c863e67f3f71316f39dfb.jpg",
  8. "errmsg": " ",
  9. "status_code": "1",
  10. "upload_time": "1479185928",
  11. "zan": "22",
  12. "is_pass": "1",
  13. "tags": null,
  14. "upload_user": "HOMO馆馆主",
  15. "upload_avatar": "https://static.otomads.com/ae135cf7134f7efe29fa8f3bfae8368f.jpg"
  16. }

API Name: get_user_video

Effect: Get User All videos

Need:none
Method:Get
Inbound parameter: id(User ID)

Return Samples

  1. {
  2. "count": 1,
  3. "video": [
  4. {
  5. "id": "966",
  6. "title": "Pickles",
  7. "desc": "2017年是刚开头!",
  8. "url": "https://static.otomads.com/24e95d73493f2b2f41a6651adac43860.mp4",
  9. "upload_uid": "367",
  10. "cover": "https://static.otomads.com/v/1cb3406d5593b6ae9775945626bfe690.jpg",
  11. "errmsg": " ",
  12. "status_code": "1",
  13. "upload_time": "1487437540",
  14. "zan": "4",
  15. "is_pass": "1"
  16. }
  17. ]
  18. }

API Name: get_video_rank

Effect: Get Video Rank

Need:none
Method:Get
Inbound parameter: start,end

Return Samples

start:1 end:1

  1. {
  2. "count": "480",
  3. "video": [
  4. {
  5. "id": "996",
  6. "title": "Naked Fighter",
  7. "desc": "https://www.youtube.com/watch?v=55ZKUzVi7XY",
  8. "url": "https://static.otomads.com/d240333e40b9c87c6d16c43029446df9.mp4",
  9. "upload_uid": "115",
  10. "cover": "https://static.otomads.com/v/26a88ea16d5fc578358fd838ecbde128.jpg",
  11. "zan": "1",
  12. "upload_time": "1488407458",
  13. "upload_user": "Meta"
  14. }
  15. ]
  16. }

API Name: danmaku

Effect: Get Danmaku or Send danmaku

Need:after login
Method:Get/Post
Inbound parameter:

if type is Get: id(video id)
if type is Post: content(danmaku,json format)
danmaku schema

  1. {
  2. "token": "otomads",
  3. "player": "998", //video id
  4. "author": "nobody",
  5. "time": 0,
  6. "text": "好!",
  7. "color": "#fff",
  8. "type": "right"
  9. }

Return Samples

type Get:

  1. {
  2. "code": 1,
  3. "danmaku": [
  4. {
  5. "id": "321",
  6. "author": "琪露诺",
  7. "time": "0",
  8. "text": "厉害",
  9. "color": "#fff",
  10. "type": "right",
  11. "player": "864"
  12. }
  13. ]
  14. }

type Post:

  1. {
  2. "code": 1,
  3. "msg": "success"
  4. }

0x03.其他

如果接口文档缺失或接口不正确,请Telegram @SatoriKomeiji 或邮件至komeiji@satori.moe

添加新批注
在作者公开此批注前,只有你和作者可见。
回复批注