Category Service

I. Public API

1. Search Categories

  • Method: GET

  • API endpoint: /categories/search

  • Permission: All users

  • Query Params:

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

title

string

N

Filter by title

slug

string

N

Filter by slug

2. Get category details

  • Method: GET

  • API endpoint: /categories/:id/view

  • Permission: All users

  • Param:

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

id

string

Y

Id / slug of the category

II. Admin API

1. Search Categories

  • Method: GET

  • API endpoint: /admin/categories

  • Permission: Admin

  • Header:

    { Authorization: accessToken }
  • Query Params:

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

title

string

N

Filter by name

slug

string

N

Filter by slug

status

string

N

Filter by status

2. Get category details

  • Method: GET

  • API endpoint: /categories/:id

  • Permission: Admin

  • Header:

    { Authorization: accessToken }
  • Params:

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

id

string

Y

Id / slug of the category

3. Upload a poster file

3.1 Sign upload poster URL

  • Method: POST

  • API endpoint /admin/categories/main/sign-upload-poster-url

  • Permission: Admin

  • 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/categories/files/:fileId/info

  • Permission: Admin

  • Params

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

fileId

string

Y

Id of the file

  • Header

4. Create a category

  • Method: POST

  • API endpoint: /admin/categories

  • Permission: Admin

  • Header

  • Body

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

title

string

Y

title of category

slug

string

N

slug of category

description

string

N

description of category

seoTitle

string

Y

SEO title

seoKeywords

string

Y

SEO keyword

seoDesc

string

Y

SEO description

status

string

N

Default: active

enum: [active, inactive]

ordering

number

N

order is displayed

group

string

N

Default: video

enum: [video, post]

posterId

string

N

Poster file ID, Uploaded via file service (check section 3)

5. Update a category

  • Method: PUT

  • API endpoint: /admin/categories/:id

  • Permission: Admin

  • Header

     

  • Param:

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

id

string

Y

Id of the category

  • Body

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

title

string

Y

title of category

slug

string

N

slug of category

description

string

N

description of category

seoTitle

string

Y

SEO title

seoKeywords

string

Y

SEO keyword

seoDesc

string

Y

SEO description

status

string

N

Default: active

enum: [active, inactive]

ordering

number

N

order is displayed

group

string

N

Default: video

enum: [video, post]

posterId

string

N

Poster file ID, Uploaded via file service

6. Delete a category

  • Method: DELETE

  • API endpoint: /admin/categories/:id

  • Permission: Admin

  • Header

     

  • Param:

Field name

Data type

Mandatory

Description

Field name

Data type

Mandatory

Description

id

string

Y

Id of the category