/
Videos Service

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

Field name

Data type

Mandatory

Description

categoryIds

string

N

Filter by categories Id, separated by commas,

for example: 659284cca8c15372adfd1d1c, 659286005f2915686fcb02b4

tags

string

N

Filter by tags key, separated by commas

for example: trending, featured

channelId

string

N

Filter by channel

performerIds

 

 

Filter by performers Id, separated by commas,

for example: 659284cca8c15372adfd1d1c, 659286005f2915686fcb02b4

2. Get video details

  • Method: GET

  • API endpoint: /videos/:id/view

  • Permission: All users

  • Param:

Field name

Data type

Mandatory

Description

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

Field name

Data type

Mandatory

Description

csv

File

Y

File binary data from multipart/form-data form

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

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

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

Field name

Data type

Mandatory

Description

status

string

N

Filter by status of the video

categoryIds

string

N

Filter by categories Id, separated by commas,

for example: 659284cca8c15372adfd1d1c, 659286005f2915686fcb02b4

tags

string

N

Filter by tags key, separated by commas

for example: trending, featured

channelId

string

N

Filter by channel

performerIds

 

 

Filter by performers Id, separated by commas,

for example: 659284cca8c15372adfd1d1c, 659286005f2915686fcb02b4

4. Get video details

  • Method: GET

  • API endpoint: /admin/videos/:id

  • Header

  • Param:

Field name

Data type

Mandatory

Description

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

Field name

Data type

Mandatory

Description

title

string

Y

Title of the video

description

string

Y

Description of the video

slug

string

N

Custom video Url

seoTitle

string

Y

SEO title

seoKeywords

string

Y

SEO keywords

seoDesc

string

Y

SEO description

status

string

N

enum: active, inactive

featured

boolean

N

Featured videos?

fileId

string

N

Video file ID, Required if video is uploaded as a file

isSale

boolean

N

Video for sale

price

number

N

Price of the video for sale

performerIds

string[]

N

Id the performer in the video

tags

string[]

N

tags of the video

channelId

string

N

indicates which channel the video belongs to

categoryIds

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

Field name

Data type

Mandatory

Description

id

string

Y

Id of the video

  • Body

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

title

string

Y

Title of the video

description

string

Y

Description of the video

slug

string

N

Custom video Url

seoTitle

string

Y

SEO title

seoKeywords

string

Y

SEO keywords

seoDesc

string

Y

SEO description

status

string

N

enum: active, inactive

featured

boolean

N

Featured videos?

fileId

string

N

Video file ID, Required if video is uploaded as a file

isSale

boolean

N

Video for sale

price

number

N

Price of the video for sale

performerIds

string[]

N

Id the performer in the video

tags

string[]

N

tags of the video

channelId

string

N

indicates which channel the video belongs to

categoryIds

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

Field name

Data type

Mandatory

Description

id

string

Y

Id of the video

Related content

Channel Service
Channel Service
More like this
Category Service
Category Service
More like this
Setting Service
Setting Service
More like this
Profiles
Profiles
More like this
Code Snippets for xCams
Code Snippets for xCams
More like this
Auth Service
Auth Service
More like this