Skip to main content

Category

Definition

category.json
{
"id": 0,
"ref": 0,
"categoryName": "",
"status": 0,
"createdAt": "",
"updatedAt": "",
}

Get Categories

curl -X GET "${baseUrl}/category/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Get Category

curl -X GET "${baseUrl}/category/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Apply Category.ID

curl -X POST "${baseUrl}/apply/category/id/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"

Create Category

curl -X POST "${baseUrl}/category/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @category.json
info
category.json
{
"ref": 0,
"categoryName": "",
"status": 0,
}
tip

success status: 201

Update Category

#!/bin/bash
curl -X PUT "${baseUrl}/category/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @category.json
info
category.json
{
"ref": 0,
"categoryName": "",
"status": 0,
}

Patch Category

curl -X PATCH "${baseUrl}/category/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Attrs: ref,categoryName,status" \
-d @category.json
info
category.json
{
"ref": 0,
"categoryName": "",
"status": 0,
}

Update Category Status

curl -X PATCH "${baseUrl}/category/${id}/status/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @category.json
info
category.json
{
"status": 0
}

Destroy Category

curl -X DELETE "${baseUrl}/category/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"