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 |
---|---|---|---|
| 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 |
---|---|---|---|
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 |
---|---|---|---|
| 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 |
---|---|---|---|
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 |
---|---|---|---|
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 |
---|---|---|---|
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 |
---|---|---|---|
| string | Y | name of channel |
| string | N | Custom channel URL |
| string | N | Description of channel |
| string | Y | enum: |
| string | N | fileId uploaded via file service |
| boolean | N | Allow users to subscribe to channels |
| number | N | monthly subscription price, required if |
| number | N | yearly subscription price, required if |
6. Update a channel
Method: PUT
API endpoint:
/admin/channels/:id
Permission: Admin
Header
Â
Param:
Field name | Data type | Mandatory | Description |
---|---|---|---|
id | string | Y | Id of the channel |
Body
Field name | Data type | Mandatory | Description |
---|---|---|---|
| string | Y | name of channel |
| string | N | Custom channel URL |
| string | N | Description of channel |
| string | Y | enum: |
| string | N | fileId uploaded via file service |
| boolean | N | Allow users to subscribe to channels |
| number | N | monthly subscription price, required if |
| number | N | yearly subscription price, required if |
7. Delete a channel
Method: DELETE
API endpoint:
/admin/channels/:id
Header
Â
Param:
Field name | Data type | Mandatory | Description |
---|---|---|---|
id | string | Y | Id of the channel |
Â