{"swagger":"2.0","info":{"description":"This is a 2PM server API document.  ","version":"1.0.0","title":"2PM Swagger API","contact":{"email":"liqun.zhang@monstar-lab.com"}},"externalDocs":{"description":"Screen specifications in Google Drive","url":"https://drive.google.com/drive/u/1/folders/15i2pcnOg_6wlsXkSd9EwjAVQoKOQ_0yz"},"tags":[{"name":"user","description":"","externalDocs":{"description":"Find out more about user","url":"https://easter.backlog.jp/view/CD_SMM_2PM-3"}},{"name":"myPage","description":"","externalDocs":{"description":"UI design","url":"https://projects.invisionapp.com/share/E6NLV6MFBXN#/screens/315266261"}},{"name":"top","description":"","externalDocs":{"description":"UI design","url":"https://projects.invisionapp.com/share/E6NLV6MFBXN#/screens/315266258"}},{"name":"profile","description":"","externalDocs":{"description":"UI design","url":"https://projects.invisionapp.com/share/E6NLV6MFBXN#/screens/315266261"}},{"name":"member","description":"","externalDocs":{"description":"UI design","url":"https://projects.invisionapp.com/share/E6NLV6MFBXN#/screens/315266262"}},{"name":"video","description":"","externalDocs":{"description":"UI design","url":"https://projects.invisionapp.com/share/E6NLV6MFBXN#/screens/315266255"}}],"schemes":["https","http"],"paths":{"/user/login":{"post":{"tags":["user"],"summary":"Logs user into the system (50%)","description":"","operationId":"loginUser","produces":["application/xml","application/json"],"parameters":[{"name":"username","in":"query","description":"The user name for login","required":true,"type":"string"},{"name":"password","in":"query","description":"The password for login in clear text","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"type":"string"},"headers":{"X-Rate-Limit":{"type":"integer","format":"int32","description":"calls per hour allowed by the user"},"X-Expires-After":{"type":"string","format":"date-time","description":"date in UTC when token expires"}}},"400":{"description":"Invalid username/password supplied"}}}},"/user/logout":{"post":{"tags":["user"],"summary":"Logs out current logged in user session (50%)","description":"","operationId":"logoutUser","produces":["application/xml","application/json"],"parameters":[],"responses":{"default":{"description":"successful operation"}}}},"/myPage/favoriteVideo":{"post":{"tags":["myPage"],"summary":"create user's favorite videos (90%)","description":"","operationId":"createFavoriteVideo","produces":["application/xml","application/json"],"parameters":[{"in":"body","name":"videoId","description":"add user fatorite video by its id","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation"},"400":{"description":"Invalid access key supplied"},"404":{"description":"Video not found"}}},"get":{"tags":["myPage"],"summary":"Get user favorite video list (80%)","description":"","operationId":"getFavoriteVideoByID","produces":["application/xml","application/json"],"parameters":[{"name":"keyword","in":"form","description":"video key word for search","required":false,"type":"string"},{"name":"orderby","in":"form","description":"video order by string('public_date_time', 'favorite_number', 'comment_number')","required":false,"type":"string"},{"name":"accessKey","in":"header","required":true,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"integer","format":"int64"}}},"400":{"description":"Invalid access key supplied"},"404":{"description":"User not found"}}},"delete":{"tags":["myPage"],"summary":"Delete user favorite video  (90%)","description":"This can only be done by the logged in user.","operationId":"deleteFavoriteVideo","produces":["application/xml","application/json"],"parameters":[{"name":"userid","in":"path","description":"The user that needs to delete his favorite video","required":true,"type":"string"},{"name":"videoId","in":"query","description":"The video that the user needs to delete","required":true,"type":"string"},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"400":{"description":"Invalid access key supplied"},"404":{"description":"User / video not found"}}}},"/myPage/playedVideo":{"post":{"tags":["myPage"],"summary":"create user's played videos (90%)","description":"","operationId":"playedVideo","produces":["application/xml","application/json"],"parameters":[{"in":"body","name":"body","description":"add user fatorite video by its id","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation"},"400":{"description":"Invalid access key supplied"},"404":{"description":"Invalid video id supplied"}}},"get":{"tags":["myPage"],"summary":"Get user favorite video list by user id (80%)","description":"","operationId":"getPlayedVideoByID","produces":["application/xml","application/json"],"parameters":[{"name":"keyword","in":"form","description":"video key word for search","required":false,"type":"string"},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"integer","format":"int64"}}},"400":{"description":"Invalid access key supplied"},"404":{"description":"User not found"}}},"delete":{"tags":["myPage"],"summary":"Delete user favorite video (90%)","description":"This can only be done by the logged in user.","operationId":"deletePlayedVideo","produces":["application/xml","application/json"],"parameters":[{"name":"videoId","in":"query","description":"The video that the user needs to delete","required":true,"type":"string"},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"400":{"description":"Invalid user / video supplied"},"404":{"description":"User / video not found"}}}},"/myPage/downloadingVideo":{"post":{"tags":["myPage"],"summary":"create user's played videos (90%)","description":"","operationId":"downloadingVideo","produces":["application/xml","application/json"],"parameters":[{"in":"body","name":"body","description":"add user fatorite video by its id","required":true,"schema":{"type":"integer","format":"int64"}},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation"},"400":{"description":"Invalid access key supplied"},"404":{"description":"video not found"}}},"get":{"tags":["myPage"],"summary":"Get user downloading video list by user id. If the video is in local, then it is downloaded. (90%)","description":"","operationId":"getDownloadingVideoByID","produces":["application/xml","application/json"],"parameters":[{"name":"keyword","in":"form","description":"video key word for search","required":false,"type":"string"},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"integer","format":"int64"}}},"400":{"description":"Invalid access key supplied"},"404":{"description":"User not found"}}},"delete":{"tags":["myPage"],"summary":"Delete user downloading video (90%)","description":"This can only be done by the logged in user.","operationId":"deleteDownloadingVideo","produces":["application/xml","application/json"],"parameters":[{"name":"videoId","in":"query","description":"The downloading video that the user needs to delete","required":false,"type":"string"},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"400":{"description":"Invalid access key supplied"},"404":{"description":"User / video not found"}}}},"/top/recomendedVideo":{"get":{"tags":["top"],"summary":"Get user recomended video list by user id. (50%)","description":"","operationId":"getRecomendedVideoByID","produces":["application/xml","application/json"],"parameters":[{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"type":"integer","format":"int64"}}},"400":{"description":"Invalid access key supplied"},"404":{"description":"User not found"}}}},"/profile":{"post":{"tags":["profile"],"summary":"Create profile (80%)","description":"This can only be done by the logged in user.","operationId":"createProfile","produces":["application/xml","application/json"],"parameters":[{"in":"body","name":"body","description":"Created my page object","required":true,"schema":{"$ref":"#/definitions/Profile"}},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation"},"400":{"description":"Invalid access key supplied"},"404":{"description":"User not found"}}},"get":{"tags":["profile"],"summary":"Get user profile by user id (90%)","description":"","operationId":"getUserProfileByID","produces":["application/xml","application/json"],"parameters":[{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Profile"}},"400":{"description":"Invalid access key supplied"},"404":{"description":"User not found"}}},"put":{"tags":["profile"],"summary":"Updated user profile (90%)","description":"This can only be done by the logged in user.","operationId":"updateUserProfile","produces":["application/xml","application/json"],"parameters":[{"in":"body","name":"body","description":"Updated user profile object","required":true,"schema":{"$ref":"#/definitions/Profile"}},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"400":{"description":"Invalid access key supplied"},"404":{"description":"User not found"}}},"delete":{"tags":["profile"],"summary":"Delete user profile (90%)","description":"This can only be done by the logged in user.","operationId":"deleteUserProfile","produces":["application/xml","application/json"],"parameters":[{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"400":{"description":"Invalid access key supplied"},"404":{"description":"User not found"}}}},"/profile/favoriteMember":{"post":{"tags":["profile"],"summary":"Create favorite member for a specific user (90%)","description":"","operationId":"favoriteMember","produces":["application/xml","application/json"],"parameters":[{"in":"body","name":"body","description":"The user id for fororite member creation","required":true,"schema":{"$ref":"#/definitions/UserMember"}},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation"},"400":{"description":"Invalid access key supplied"},"404":{"description":"User not found"}}},"get":{"tags":["profile"],"summary":"Get user favorite member by user id (90%)","description":"","operationId":"getFavoriteMemberByID","produces":["application/xml","application/json"],"parameters":[{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"type":"object","additionalProperties":{"type":"integer","format":"int64"}}},"400":{"description":"Invalid access key supplied"},"404":{"description":"User not found"}}},"put":{"tags":["profile"],"summary":"Update an existing favorite memeber (90%)","description":"","operationId":"updateFavoriteMember","consumes":["application/json","application/xml"],"produces":["application/xml","application/json"],"parameters":[{"in":"body","name":"body","description":"Updated user member object","required":true,"schema":{"$ref":"#/definitions/UserMember"}},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"400":{"description":"Invalid access key supplied"},"404":{"description":"Member / User ID not found"},"405":{"description":"Validation exception"}},"security":[{"petstore_auth":["write:pets","read:pets"]}]}},"/member/{memberid}":{"get":{"tags":["member"],"summary":"Get user by member id (90%)","description":"","operationId":"getMemberByID","produces":["application/xml","application/json"],"parameters":[{"name":"memberid","in":"path","description":"The id that needs to be fetched. ","required":true,"type":"string"},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Member"}},"400":{"description":"Invalid access key supplied"},"404":{"description":"Memnber not found"}}}},"/member/all":{"get":{"tags":["member"],"summary":"Get all available members (90%)","description":"","operationId":"getAllMembers","produces":["application/xml","application/json"],"parameters":[{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"$ref":"#/definitions/Member"}}},"400":{"description":"Invalid access key supplied"},"404":{"description":"No member"}}}},"/video/{videoid}":{"get":{"tags":["video"],"summary":"Get video by video id (50%)","description":"","operationId":"getVideoByID","produces":["application/xml","application/json"],"parameters":[{"name":"videoid","in":"path","description":"The id that needs to be fetched. ","required":true,"type":"string"},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"$ref":"#/definitions/Video"}},"400":{"description":"Invalid access key supplied"},"404":{"description":"video not found"}}}},"/Video/search":{"get":{"tags":["video"],"summary":"Get all available videos (90%)","description":"","operationId":"searchVideos","produces":["application/xml","application/json"],"parameters":[{"name":"keyword","in":"query","description":"The search keyword of video, if empty, then return all","required":false,"type":"string"},{"name":"accessKey","in":"header","required":false,"type":"string"}],"responses":{"200":{"description":"successful operation","schema":{"type":"array","items":{"$ref":"#/definitions/Video"}}},"400":{"description":"Invalid access key supplied"},"404":{"description":"No video"}}}}},"securityDefinitions":{"petstore_auth":{"type":"oauth2","authorizationUrl":"http://petstore.swagger.io/oauth/dialog","flow":"implicit","scopes":{"write:pets":"modify pets in your account","read:pets":"read your pets"}},"api_key":{"type":"apiKey","name":"api_key","in":"header"}},"definitions":{"User":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"username":{"type":"string"},"password":{"type":"string"}},"xml":{"name":"User"}},"ApiResponse":{"type":"object","properties":{"status":{"type":"integer","format":"int32"},"data":{"type":"string"},"message":{"type":"string"}}},"Profile":{"type":"object","properties":{"userId":{"type":"integer","format":"int64"},"coverPicture":{"type":"string"},"icon":{"type":"string"},"userName":{"type":"string"},"description":{"type":"string"}},"xml":{"name":"Profile"}},"UserMember":{"type":"object","properties":{"userId":{"type":"integer","format":"int64"},"member":{"$ref":"#/definitions/Member"}},"xml":{"name":"UserMember"}},"Member":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"coverPicture":{"type":"string"},"icon":{"type":"string"},"backgroundColor":{"type":"integer","format":"int64"},"EnglishMemberName":{"type":"string"},"HangulMemberName":{"type":"string"},"JapaneseMemberName":{"type":"string"},"fanNumber":{"type":"integer","format":"int64"},"videos":{"type":"array","items":{"$ref":"#/definitions/Video"}},"fans":{"type":"array","items":{"$ref":"#/definitions/Profile"}}},"xml":{"name":"Member"}},"Video":{"type":"object","properties":{"id":{"type":"integer","format":"int64"},"videoPicture":{"type":"string"},"commentNumber":{"type":"integer","format":"int64"},"favoriteNumber":{"type":"integer","format":"int64"},"videoTime":{"type":"integer","format":"int64"},"publicDatetime":{"type":"string","format":"date-time"},"caption":{"type":"string"},"source":{"type":"string"},"fans":{"type":"array","items":{"$ref":"#/definitions/Profile"}}},"xml":{"name":"Video"}}},"host":"virtserver.swaggerhub.com","basePath":"/xwolf47/2pm/1.0.0"}