Channel Service

I. Public API

1. Search Channels

  • Method: GET

  • API endpoint: /channels/search

  • Permission: All users

  • Query Params:

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

name

string

N

Filter by name

2. Get channel details

  • Method: GET

  • API endpoint: /channels/:id/view

  • Permission: All users

  • Param:

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

id

string

Y

Id of the channel

II. Admin API

1. Search Channels

  • Method: GET

  • API endpoint: /admin/channels

  • Permission: Admin

  • Header:

    { Authorization: accessToken }
  • Query Params:

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

name

string

N

Filter by name

status

string

N

Filtyer by status

2. Get channel details

  • Method: GET

  • API endpoint: /channels/:id

  • Permission: Admin

  • Header:

    { Authorization: accessToken }
  • Params:

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

id

string

Y

Id of the channel

3. Upload channel image

3.1 Sign upload channel image URL

  • Method: POST

  • API endpoint /admin/channels/sign-upload-image-url

  • Header

    { Authorization: accessToken }
  • Body

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

filename

string

N

Name of the file

3.2 Upload file via upload URL (Check file service document)

3.3 Get uploaded file information

  • Method: GET

  • API endpoint /admin/channels/files/:fileId/info

  • Params

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

fileId

string

Y

Id of the file

  • Header

     

4. Create a channel

  • Method: POST

  • API endpoint: /admin/channels

  • Permission: Admin

  • Header

  • Body

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

name

string

Y

name of channel

slug

string

N

Custom channel URL

description

string

N

Description of channel

status

string

Y

enum: active, inactive

imageId

string

N

fileId uploaded via file service

allowSubscription

boolean

N

Allow users to subscribe to channels

monthlySubscriptionPrice

number

N

monthly subscription price, required if allowSubscription = true

yearlySubscriptionPrice

number

N

yearly subscription price, required if allowSubscription = true

6. Update a channel

  • Method: PUT

  • API endpoint: /admin/channels/:id

  • Permission: Admin

  • Header

     

  • Param:

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

id

string

Y

Id of the channel

  • Body

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

name

string

Y

name of channel

slug

string

N

Custom channel URL

description

string

N

Description of channel

status

string

Y

enum: active, inactive

imageId

string

N

fileId uploaded via file service

allowSubscription

boolean

N

Allow users to subscribe to channels

monthlySubscriptionPrice

number

N

monthly subscription price, required if allowSubscription = true

yearlySubscriptionPrice

number

N

yearly subscription price, required if allowSubscription = true

7. Delete a channel

  • Method: DELETE

  • API endpoint: /admin/channels/:id

  • Header

     

  • Param:

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

id

string

Y

Id of the channel

Â