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 |
---|---|---|---|
| string | N | Filter by title |
| 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 |
---|---|---|---|
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 |
---|---|---|---|
| string | N | Filter by name |
| string | N | Filter by slug |
| 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 |
---|---|---|---|
| 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 |
---|---|---|---|
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 |
---|---|---|---|
| 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 |
---|---|---|---|
| string | Y | title of category |
| string | N | slug of category |
| string | N | description of category |
| string | Y | SEO title |
| string | Y | SEO keyword |
| string | Y | SEO description |
| string | N | Default: enum: |
| number | N | order is displayed |
| string | N | Default: enum: |
| string | N | Poster file ID, Uploaded via file service ( |
5. Update a category
Method: PUT
API endpoint:
/admin/categories/:id
Permission: Admin
Header
Â
Param:
Field name | Data type | Mandatory | Description |
---|---|---|---|
| string | Y | Id of the category |
Body
Field name | Data type | Mandatory | Description |
---|---|---|---|
| string | Y | title of category |
| string | N | slug of category |
| string | N | description of category |
| string | Y | SEO title |
| string | Y | SEO keyword |
| string | Y | SEO description |
| string | N | Default: enum: |
| number | N | order is displayed |
| string | N | Default: enum: |
| 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 |
---|---|---|---|
| string | Y | Id of the category |