Skip to main content

Article

Definition

article.json
{
"id": 0,
"categoryID": 0,
"userID": 0,
"key": "",
"articleTitle": "",
"articleContent": "",
"status": 0,
"createdAt": "",
"updatedAt": "",
}

Get Articles

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

Get Article

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

Apply Article.ID

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

Create Article

curl -X POST "${baseUrl}/article/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @article.json
info
article.json
{
"categoryID": 0,
"userID": 0,
"key": "",
"articleTitle": "",
"articleContent": "",
"status": 0,
}
tip

success status: 201

Update Article

#!/bin/bash
curl -X PUT "${baseUrl}/article/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d @article.json
info
article.json
{
"categoryID": 0,
"userID": 0,
"key": "",
"articleTitle": "",
"articleContent": "",
"status": 0,
}

Patch Article

curl -X PATCH "${baseUrl}/article/${id}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-H "Attrs: categoryID,userID,key,articleTitle,articleContent,status" \
-d @article.json
info
article.json
{
"categoryID": 0,
"userID": 0,
"key": "",
"articleTitle": "",
"articleContent": "",
"status": 0,
}

Update Article Status

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

Destroy Article

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

Get Tags

curl -X GET "${baseUrl}/article/${id}/tag/?filter=${filter}&orderBy=${orderBy}&page=${page}&pageSize=${pageSize}" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json"
curl -X POST "${baseUrl}/article/${id}/tag/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"
curl -X DELETE "${baseUrl}/article/${id}/tag/" \
-H "Authorization: Bearer ${accessToken}" \
-H "Content-Type: application/json" \
-H "Accept: application/json" \
-d "[1,2,3,4]"