Skip to content

Latest commit

 

History

History
109 lines (69 loc) · 2.36 KB

video.md

File metadata and controls

109 lines (69 loc) · 2.36 KB

Video Backend Service Endpoints

All videos

GET localhost/api/admin/video

Single video

GET localhost/api/admin/video/1

Video thumbnail image

GET localhost/api/admin/video/image/1

Add video

POST localhost/api/admin/video

 {
    "id": 0,
    "name": "posted2",
    "source": "YT gen",
    "link": "some link",
    "description": "Enjoyed no sooner but despised straight",
    "hidden": false,
    "noOfViews": 1100,
    "noOfUpvotes": 30,
    "noOfDownvotes": 12
  }

returns the new record

Update video

PUT localhost/api/admin/video

{
    "id": 619,
    "name": "updated",
    "source": "YT gen",
    "link": "some link update",
    "description": "Enjoyed no sooner but despised straight, update",
    "hidden": false,
    "noOfViews": 1101,
    "noOfUpvotes": 31,
    "noOfDownvotes": 13
}

returns the updated record

Update the thumbnail

PUT localhost/api/admin/video/image/1?url=https://www.guidingeyes.org/wp-content/uploads/2020/01/1-1.jpg

Delete video

DELETE localhost/api/admin/video/1

returns 1 if deleted, 0 if no record with this id

Delete Multiple Videos (Batch Delete)

NOTE: Deletes video/tag + video/category "links" internally

DELETE localhost/api/admin/videos?ids=1,2,3

returns 1 if deleted, 0 if the delete failed

NOTE: Deletes video/tag + video/category "links" internally

Populate videos with up to 100 random videos (demo/testing endpoint)

GET localhost/api/admin/video/populate

Populate videos with up to n random videos (demo/testing endpoint)

GET localhost/api/admin/video/populate/3

Tags for a video

GET localhost/api/admin/video/tags/1 => array of tag Ids and naames

Categories for a video

GET localhost/api/admin/video/categories/1 => array of category Ids and naames

Set Tags for a video

POST localhost/api/admin/video/tags/1?tags=1,2,3 => array of tag Ids

Set Categories for a video

POST localhost/api/admin/video/categories/1?categories=1,2,3 => array of category Ids

Most recent videos (optional params page (default 1) and pagesize (default 10)

GET localhost/api/admin/video/orderBy/upload

Most popular videos (optional params page (default 1) and pagesize (default 10)

GET localhost/api/admin/video/orderBy/upvotes