Skip to main content

App Article API

The App Article API allows App User to manage the articles in the App.

Endpoints

# Endpoints

Get article districts

This endpoint gets the districts of the articles. It is only needed for category = 1.

Request

GET /app/articles/districts

Response (ArticleDistrictDTO)

{
"success": true,
"message": "",
"data": [
[
{
"type": 3,
"desc": "葵涌安泰軒"
},
{
"type": 4,
"desc": "深水埗安泰軒"
},
{
"type": 5,
"desc": "屯門安泰軒"
},
{
"type": 6,
"desc": "天水圍安泰軒"
},
{
"type": 7,
"desc": "油尖旺安泰軒"
}
]
]
}

Get article subcategory

This endpoint gets the subcategories of the articles. It is only needed for category = 2.

Request

GET /app/articles/subcategories

Response (ArticleSubCategorySummaryDTO)

{
"success": true,
"message": "",
"data": [
{
"subcategoryId": 1,
"type": 1,
"desc": "精神分裂症",
"url": "https://jcci-test-media.aritaone.com/share/default/article/subcategory/1"
}
]
}

Filter articles

This endpoint filters out mental information.

Request (FilterArticleReqDTO)

POST /app/articles/page
{
"pagination": {
"page": 1,
"size": 10
},
"categoryId": 1,
"subcategoryId": 2,
"districts": [
{
"type": 3,
"desc": "葵涌安泰軒"
}
]
}

Response (ArticleSummaryDTO)

{
"success": true,
"message": "",
"data": {
"pagination": {
"page": 1,
"size": 10,
"totalItems": 1,
"totalPages": 1
},
"sortings": [],
"items": [
{
"id": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"title": "Article 3",
"thumbnail": [
{
"fileKey": "temp/1234",
"url": "https://jcci-test.app-domain.com/temp/1234"
}
],
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"type": 0,
"statistics": [
{
"likeNo": 1,
"like": false,
"bookmark": false,
"read": false
}
],
"publishedAt": "2024-06-25T14:30:04.46335"
}
]
}
}

Get article

This endpoint gets an article.

Request

GET /app/articles/{article_id}

Response (ArticleDTO)

{
"success": true,
"message": "",
"data": {
"id": "52e8306d-301b-4985-b9fd-b7b3dd4c43c8",
"title": "Article 2",
"content": "Content 2",
"thumbnail": {
"fileKey": "nlpra/article/activity/A001/thumbnail/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/thumbnail/1"
},
"registrationLink": "https://www.google.com",
"type": 1,
"category": 1,
"subcategory": 0,
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"images": [
{
"fileKey": "nlpra/article/activity/A001/image/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/1"
},
{
"fileKey": "nlpra/article/activity/A001/image/2",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/2"
}
],
"pdf": {
"fileKey": "nlpra/article/activity/A001/image/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/1"
},
"videoLink": "https://www.youtube.com",
"audio": {
"fileKey": "nlpra/article/activity/A001/image/1",
"url": "https://jcci-test-media.aritaone.com/nlpra/article/activity/A001/image/1"
},
"tags": [
{
"id": "5ba69f4c-1ff8-4c8d-a2df-5abc4470c188",
"name": "test 1"
},
{
"id": "9d202391-f041-4971-9b77-cc3a38c2819f",
"name": "test 2"
}
],
"statistics": [
{
"likeNo": 1,
"like": false,
"bookmark": false,
"read": false
}
],
"publishedAt": "2024-06-25T14:30:04.46335"
}
}

Add like

This endpoint adds like.

Request

POST /app/articles/{article_id}/like

Response

{
"success": true,
"message": "",
"data": null
}

Delete like

This endpoint deletes like.

Request

DELETE /app/articles/{article_id}/like

Response

{
"success": true,
"message": "",
"data": null
}

Add bookmark

This endpoint adds bookmark.

Request

POST /app/articles/{article_id}/bookmark

Response

{
"success": true,
"message": "",
"data": null
}

Delete bookmark

This endpoint deletes bookmark.

Request

DELETE /app/articles/{article_id}/bookmark

Response

{
"success": true,
"message": "",
"data": null
}

Add read

This endpoint adds read.

Request

POST /app/articles/{article_id}/read

Response

{
"success": true,
"message": "",
"data": null
}

Delete read

This endpoint deletes read. Please note that this function is not needed to be implemented in the App.

Request

DELETE /app/articles/{article_id}/read

Response

{
"success": true,
"message": "",
"data": null
}

Filter bookmarks

This endpoint filters out the bookmarks.

Request (FilterArticleBookmarkReqDTO)

POST /app/articles/bookmarks/page
{
"pagination": {
"page": 1,
"size": 10
}
}

Response (ArticleSummaryDTO)

{
"success": true,
"message": "",
"data": {
"pagination": {
"page": 1,
"size": 10,
"totalItems": 1,
"totalPages": 1
},
"sortings": [],
"items": [
{
"id": "b618fcfb-404e-408e-90fb-e4d663fde7ba",
"title": "Article 3",
"thumbnail": [
{
"fileKey": "temp/1234",
"url": "https://jcci-test.app-domain.com/temp/1234"
}
],
"district": {
"type": 3,
"desc": "葵涌安泰軒"
},
"type": 0,
"statistics": [
{
"likeNo": 1,
"like": false,
"bookmark": false,
"read": false
}
],
"publishedAt": "2024-06-25T14:30:04.46335"
}
]
}
}


Resources

ArticleDistrictDTO

properties
  • type
    ActivityDistrictEnum
    The identifier of the article district.
  • desc
    string
    The name of the article district.

ArticleSubCategorySummaryDTO

properties
  • subcategoryId
    number
    The identifier of the subcategory.
  • type
    number
    The type of the subcategory.
  • desc
    string
    The description of the subcategory.
  • url
    string
    The url of the thumbnail.

FilterArticleReqDTO

properties
  • pagination
    Pagination
    required
    index-1
    Indicates the page information of the resource.
  • sortings
    A list of sorting elements, the order of the list matters.
  • searchKey
    string
    The search key should be about title.
  • The category of the article.
  • The subcategory of the article.
  • A list of article districts. It is only needed for 「最新消息」

ArticleSummaryDTO

properties
  • pagination
    Pagination
    required
    index-1
    Indicates the page information of the resource.
  • sortings
    A list of sorting elements, the order of the list matters.
  • A list of filtered elements.

ArticleSummaryItemDTO

properties
  • id
    string
    The identifier of the article.
  • title
    string
    The title of the article.
  • thumbnail
    MediaDTO
    The article thumbnail.
  • The district of the article. Its type must be 0 when category is not 1.
  • The type of the article.
  • statistics
    The statistical information of the article.
  • publishedAt
    datetime
    上架時間

ArticleDTO

properties
  • id
    string
    The identifier of the article.
  • title
    string
    The title of the article.
  • content
    string
    The content of the article.
  • thumbnail
    MediaDTO
    The thumbnail of the article.
  • registrationLink
    string
    The registration link of the article, if needed.
  • The article category.
  • The district of the article. Its type must be 0 when category is not 1.
  • subcategory
    default:  0
    The article subcategory. It must be 0 when category is not 2.
  • The type of the article.
  • A list of images. It must be an empty array when type is not 1.
  • The pdf of the article. It must be null when type is not 2.
  • videoLink
    string
    The video link of the article. It must be null when type is not 3.
  • The audio of the article. It must be null when type is not 4.
  • 「自定义标签」
  • statistics
    The statistical information of the article.
  • publishedAt
    datetime
    上架時間

MediaDTO

properties
  • fileKey
    string
    required
    The S3 key for the file or folder.
  • url
    string
    The url path of the uploaded files.

StatisticDTO

properties
  • likeNo
    number
    The number of likes.
  • like
    boolean
    It indicates if the item is liked by the current login user.
  • bookmark
    boolean
    It indicates if the item is bookmarked by the current login user.
  • read
    boolean
    It indicates if the item is read by the current login user.

ArticleTagDTO

properties
  • id
    string
    The id of the article tag.
  • name
    string
    The name of the article tag.

FilterArticleBookmarkReqDTO

properties
  • pagination
    Pagination
    required
    index-1
    Indicates the page information of the resource.


ArticleCategoryEnum

NameValue
活動推廣1
認識精神健康2
生命故事分享3
專欄分享4

ArticleSubCategoryEnum

NameValue
精神分裂症1
思覺失調2
抑鬱症3
焦慮症4
躁鬱症5
妄想症6
強迫症7
人格障礙8
其他9

ArticleType

NameValue
純文字0
多圖片1
PDF文件2
影片3
音頻4

ActivityDistrictEnum

NameValue
-0
九龍1
新界2
葵涌安泰軒3
深水埗安泰軒4
屯門安泰軒5
天水圍安泰軒6
油尖旺安泰軒7
離島安泰軒8
復元有晴天(九龍西)9
復元有晴天(新界西)10