Videos Service
I. Architecture design
II. Public API
1. Search Videos
Method: GET
API endpoint:
/videos/search
Permission: All users
Query Params:
Field name | Data type | Mandatory | Description |
---|---|---|---|
| string | N | Filter by categories Id, separated by commas, for example: |
| string | N | Filter by tags key, separated by commas for example: |
| string | N | Filter by channel |
| Â | Â | Filter by performers Id, separated by commas, for example: |
2. Get video details
Method: GET
API endpoint:
/videos/:id/view
Permission: All users
Param:
Field name | Data type | Mandatory | Description |
---|---|---|---|
id | string | Y | Id of the video |
III. Admin API
1. Import by csv
Method: POST
API endpoint
/admin/videos/main/import-video-via-csv
Header
{ Authorization: accessToken }
Body
Field name | Data type | Mandatory | Description |
---|---|---|---|
csv | File | Y |
|
source | string | Y | Video source |
Response success sample
{ "status": 0, "data": { "success": true } }
2. Upload a video file
2.1 Sign upload video URL
Method: POST
API endpoint
/admin/videos/main/sign-upload-url
Header
{ Authorization: accessToken }
Body
Field name | Data type | Mandatory | Description |
---|---|---|---|
filename | string | N | Name of the file |
2.2 Upload file via upload URL (Check file service document)
2.3 Get uploaded file information
Method: GET
API endpoint
/admin/videos/files/:fileId/info
Params
Field name | Data type | Mandatory | Description |
---|---|---|---|
fileId | string | Y | Id of the file |
Header
Â
3. Search Videos
Method: GET
API endpoint:
/admin/videos
Header
Query Params:
Field name | Data type | Mandatory | Description |
---|---|---|---|
| string | N | Filter by status of the video |
| string | N | Filter by categories Id, separated by commas, for example: |
| string | N | Filter by tags key, separated by commas for example: |
| string | N | Filter by channel |
| Â | Â | Filter by performers Id, separated by commas, for example: |
4. Get video details
Method: GET
API endpoint:
/admin/videos/:id
Header
Param:
Field name | Data type | Mandatory | Description |
---|---|---|---|
id | string | Y | Id of the video |
5. Create a video with file ID
Method: POST
API endpoint:
/admin/videos
Header
Body
Field name | Data type | Mandatory | Description |
---|---|---|---|
title | string | Y | Title of the video |
| string | Y | Description of the video |
| string | N | Custom video Url |
| string | Y | SEO title |
| string | Y | SEO keywords |
| string | Y | SEO description |
| string | N | enum: |
| boolean | N | Featured videos? |
| string | N | Video file ID, Required if video is uploaded as a file |
| boolean | N | Video for sale |
| number | N | Price of the video for sale |
| string[] | N | Id the performer in the video |
| string[] | N | tags of the video |
| string | N | indicates which channel the video belongs to |
| string[] | N | Categories of the video |
6. Update a video
Method: PUT
API endpoint:
/admin/videos/:id
Header
Â
Param:
Field name | Data type | Mandatory | Description |
---|---|---|---|
id | string | Y | Id of the video |
Body
Field name | Data type | Mandatory | Description |
---|---|---|---|
title | string | Y | Title of the video |
| string | Y | Description of the video |
| string | N | Custom video Url |
| string | Y | SEO title |
| string | Y | SEO keywords |
| string | Y | SEO description |
| string | N | enum: |
| boolean | N | Featured videos? |
| string | N | Video file ID, Required if video is uploaded as a file |
| boolean | N | Video for sale |
| number | N | Price of the video for sale |
| string[] | N | Id the performer in the video |
| string[] | N | tags of the video |
| string | N | indicates which channel the video belongs to |
| string[] | N | Categories of the video |
7. Delete a video
Method: DELETE
API endpoint:
/admin/videos/:id
Header
Â
Param:
Field name | Data type | Mandatory | Description |
---|---|---|---|
id | string | Y | Id of the video |