Artikel Controller Docs
This service is used for .....
Get Article Discovery
::: highlight green đź’ˇ
Rule :
The endpoint will be used to etrieving article recommendation data according to the mode baby or pregnancy
:::
Endpoint Name : Get Article Discovery
Method : GET
URL :{base_url}/article/article-discovery
1. Requet Params
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | mode | STRING | M | Value “baby” or “pregnancy” |
Sample Request Params :
- Mode = baby
2. Response Body
{
"code": 0,
"data": [
{
"articles": [
{
"author": {
"avatar": "string",
"name": "string",
"title": "string"
},
"content": "string",
"favorited": true,
"id": 0,
"likeTotal": 0,
"publishedDate": "2023-01-19T07:36:27.590Z",
"shareTotal": 0,
"slug": "string",
"tag": "string",
"tagColor": "string",
"tagId": 0,
"thumbnail": "string",
"title": "string",
"viewTotal": 0
}
],
"id": 0,
"name": "string",
"page": {
"currentPage": 0,
"nextPage": 0,
"prevPage": 0,
"totalElement": 0,
"totalPage": 0
},
"userArticleActivity": {
"likeTotal": 0,
"shareTotal": 0,
"viewTotal": 0
}
}
],
"message": "string"
}
Get Article History
::: highlight green đź’ˇ
Rule :
The endpoint will be used to get user list of viewed / liked articles
:::
Endpoint Name : Get Article History
Method : GET
URL :{base_url}/article/article-history
1. Query Params
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | activity | STRING | M | Value “view” or “like” |
2 | page | NUM | M | The page number which need to be displayed The page number which need to be displayed |
Sample Query Params :
- activity = view
- page = 1
2. Response Body
{
"code": 0,
"data": {
"content": [
{
"author": {
"avatar": "string",
"name": "string",
"title": "string"
},
"content": "string",
"favorited": true,
"id": 0,
"likeTotal": 0,
"publishedDate": "2023-01-19T08:02:53.285Z",
"shareTotal": 0,
"slug": "string",
"tag": "string",
"tagColor": "string",
"tagId": 0,
"thumbnail": "string",
"title": "string",
"viewTotal": 0
}
],
"page": {
"currentPage": 0,
"nextPage": 0,
"prevPage": 0,
"totalElement": 0,
"totalPage": 0
}
},
"message": "string"
}
Get Article Overview
::: highlight green đź’ˇ
Rule :
The endpoint will be used to get taxonomies
:::
Endpoint Name : Get Article Overview
Method : GET
URL :{base_url} /article/article-overview
1. Request Params
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | mode | STRING | M | Value “baby” or “pregnancy” |
2 | page | NUM | M | The page number which need to be displayed The page number which need to be displayed |
Sample Request Params :
- mode = baby
- page = 1
2. Response Body
{
"code": 0,
"data": [
{
"category": {
"id": 0,
"name": "string"
},
"subCategory": [
{
"articles": [
{
"author": {
"avatar": "string",
"name": "string",
"title": "string"
},
"content": "string",
"favorited": true,
"id": 0,
"likeTotal": 0,
"publishedDate": "2023-01-19T08:28:23.693Z",
"shareTotal": 0,
"slug": "string",
"tag": "string",
"tagColor": "string",
"tagId": 0,
"thumbnail": "string",
"title": "string",
"viewTotal": 0
}
],
"id": 0,
"name": "string",
"page": {
"currentPage": 0,
"nextPage": 0,
"prevPage": 0,
"totalElement": 0,
"totalPage": 0
},
"userArticleActivity": {
"likeTotal": 0,
"shareTotal": 0,
"viewTotal": 0
}
}
]
}
],
"message": "string"
}
Get Article Overview Feature
::: highlight green đź’ˇ
Rule :
The endpoint will be used to get list of featured articles by mode
:::
Endpoint Name : Get Article Overview Featured
Method : GET
URL :{base_url} /article/article-overview/featured
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | mode | STRING | M | Value “baby” or “pregnancy” |
2 | page | NUM | M | The page number which need to be displayed The page number which need to be displayed |
1. Request Params
Sample Request Params :
- mode = baby
- page = 1
2. Response Body
{
"code": 0,
"data": {
"articles": [
{
"author": {
"avatar": "string",
"name": "string",
"title": "string"
},
"content": "string",
"favorited": true,
"id": 0,
"likeTotal": 0,
"publishedDate": "2023-01-19T08:37:24.495Z",
"shareTotal": 0,
"slug": "string",
"tag": "string",
"tagColor": "string",
"tagId": 0,
"thumbnail": "string",
"title": "string",
"viewTotal": 0
}
],
"id": 0,
"name": "string",
"page": {
"currentPage": 0,
"nextPage": 0,
"prevPage": 0,
"totalElement": 0,
"totalPage": 0
},
"userArticleActivity": {
"likeTotal": 0,
"shareTotal": 0,
"viewTotal": 0
}
},
"message": "string"
}
Get Category
::: highlight green đź’ˇ
Rule :
The endpoint will be used to get list sub category
:::
Endpoint Name : Get Category
Method : GET
URL :{base_url} /article/category/{categoryId}
1. Path
categoryId
sample path :
{base_url} /article/category/1
2. Query Params
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | page | NUM | M | The page number which need to be displayed The page number which need to be displayed |
Sample Request Params :
page = 1
3. Response Body
{
"code": 0,
"data": {
"articles": [
{
"author": {
"avatar": "string",
"name": "string",
"title": "string"
},
"content": "string",
"favorited": true,
"id": 0,
"likeTotal": 0,
"publishedDate": "2023-01-19T10:25:16.285Z",
"shareTotal": 0,
"slug": "string",
"tag": "string",
"tagColor": "string",
"tagId": 0,
"thumbnail": "string",
"title": "string",
"viewTotal": 0
}
],
"id": 0,
"name": "string",
"page": {
"currentPage": 0,
"nextPage": 0,
"prevPage": 0,
"totalElement": 0,
"totalPage": 0
},
"userArticleActivity": {
"likeTotal": 0,
"shareTotal": 0,
"viewTotal": 0
}
},
"message": "string"
}
Get Curated article
::: highlight green đź’ˇ
Rule :
The endpoint will be used to get list article of curated by week
:::
Endpoint Name : Get Curated article
Method : GET
URL :{base_url} /article/curated-article
1. Query Params
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | week | NUM | M | pregnancy's age in week |
Sample Request Params :
Week = 4
2. Response Body
{
"code": 0,
"data": [
{
"author": {
"avatar": "string",
"name": "string",
"title": "string"
},
"breadcrumbs": [
{
"name": "string",
"query": "string",
"route": "string"
}
],
"content": "string",
"favorited": true,
"id": 0,
"likeTotal": 0,
"publishedDate": "2023-01-20T02:30:59.175Z",
"read": true,
"shareTotal": 0,
"slug": "string",
"tag": "string",
"tagColor": "string",
"tagId": 0,
"thumbnail": "string",
"title": "string",
"viewTotal": 0
}
],
"message": "string"
}
Index
::: highlight green đź’ˇ
Rule :
The endpoint will be used to bulk index all published article to elastic search
:::
Endpoint Name : Index
Method : GET
URL :{base_url} /article/index
1. Response Body
{
"code": 0,
"data": "string",
"message": "string"
}
Delete Index
::: highlight green đź’ˇ
Rule :
The endpoint will be used to delete indexed article in elastic search
:::
Endpoint Name : Delete Index
Method : DELETE
URL :{base_url} /article/index
1. Response Body
{
"code": 0,
"data": "string",
"message": "string"
}
Like / Unlike Article
::: highlight green đź’ˇ
Rule :
The endpoint will be used to like or unlike article
:::
Endpoint Name : Like Article
Method : POST
URL :{base_url} /article/like
1. Request Body
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | like | BOOLEAN | M | True if like or false if unlike |
2 | postId | NUM | M | Id of article |
Example Request Body :
{
"like": true,
"postId": 4
}
2. Response Body
{
"code": 0,
"data": "string",
"message": "string"
}
Read Article
::: highlight green đź’ˇ
Rule :
The endpoint will be used to triger read article , to save counter read
:::
Endpoint Name : Read Article
Method : GET
URL :{base_url} / article/read/{postId}
1. Path
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | postId | NUM | M | Id of article |
Example Path:
{base_url} / article/read/4
2. Response Body
{
"code": 0,
"data": {
"author": {
"avatar": "string",
"name": "string",
"title": "string"
},
"content": "string",
"favorited": true,
"id": 0,
"likeTotal": 0,
"publishedDate": "2023-01-20T02:46:21.863Z",
"shareTotal": 0,
"slug": "string",
"tag": "string",
"tagColor": "string",
"tagId": 0,
"thumbnail": "string",
"title": "string",
"viewTotal": 0
},
"message": "string"
}
Read by slug
::: highlight green đź’ˇ
Rule :
The endpoint will be used to triger read article by slug , to save counter read
:::
Endpoint Name : Read article by slug
Method : GET
URL :{base_url} /article/read/slug/{slug}
1. Path
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | slug | STRING | M | slug of article |
Example path :
{base_url} /article/read/slug/tips-untuk-ibu-di-minggu-ke-1
2. Response Body
{
"code": 0,
"data": {
"author": {
"avatar": "string",
"name": "string",
"title": "string"
},
"content": "string",
"favorited": true,
"id": 0,
"likeTotal": 0,
"publishedDate": "2023-01-20T02:51:41.969Z",
"shareTotal": 0,
"slug": "string",
"tag": "string",
"tagColor": "string",
"tagId": 0,
"thumbnail": "string",
"title": "string",
"viewTotal": 0
},
"message": "string"
}
Read Article v2
::: highlight green đź’ˇ
Rule :
The endpoint will be used to triger read article , to save counter read (api version 2)
:::
Endpoint Name : Read Article
Method : GET
URL :{base_url} / article/read/v2/{postId}
1. Path
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | postId | NUM | M | Id of article |
Example Path:
{base_url} / article/read/v2/4
2. Response Body
{
"code": 0,
"data": {
"author": {
"avatar": "string",
"name": "string",
"title": "string"
},
"content": "string",
"favorited": true,
"id": 0,
"likeTotal": 0,
"publishedDate": "2023-01-20T02:52:18.276Z",
"shareTotal": 0,
"slug": "string",
"tag": "string",
"tagColor": "string",
"tagId": 0,
"thumbnail": "string",
"title": "string",
"viewTotal": 0
},
"message": "string"
}
Get Recomended Article
::: highlight green đź’ˇ
Rule :
The endpoint will be used to get recomended article by week and mode
:::
Endpoint Name : Get Recomended article
Method : GET
URL :{base_url}/article/recomended-article
1. Query Params
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | week | NUM | M | pregnancy's age in week |
2 | mode | STRING | M | Value “baby” or “pregnancy” |
Example Query Params :
{base_url}/article/recomended-article?week=1&mode=baby"
2. Response Body
{
"code": 0,
"data": [
{
"author": {
"avatar": "string",
"name": "string",
"title": "string"
},
"content": "string",
"favorited": true,
"id": 0,
"likeTotal": 0,
"publishedDate": "2023-01-26T07:24:18.558Z",
"shareTotal": 0,
"slug": "string",
"tag": "string",
"tagColor": "string",
"tagId": 0,
"thumbnail": "string",
"title": "string",
"viewTotal": 0
}
],
"message": "string"
}
Get Related Article
::: highlight green đź’ˇ
Rule :
The endpoint will be used to get list of articles related to specific article by id
:::
Endpoint Name : Get Related article
Method : GET
URL :{base_url}/article/related-article/{postId}
1. Path
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | postId | NUM | M | Id of article |
Example Path:
{base_url}/article/related-article/4
2. Response Body
{
"code": 0,
"data": [
{
"author": {
"avatar": "string",
"name": "string",
"title": "string"
},
"content": "string",
"favorited": true,
"id": 0,
"likeTotal": 0,
"publishedDate": "2023-01-26T07:37:42.128Z",
"shareTotal": 0,
"slug": "string",
"tag": "string",
"tagColor": "string",
"tagId": 0,
"thumbnail": "string",
"title": "string",
"viewTotal": 0
}
],
"message": "string"
}
Get Related Article By Slug
::: highlight green đź’ˇ
Rule :
The endpoint will be used to get list of articles related to specific article by slug
:::
Endpoint Name : Get Related article by slug
Method : GET
URL :{base_url}/article/related-article/slug/{slug}
1. Path
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | slug | STRING | M | slug of article |
Example path :
{base_url}/article/related-article/slug/tips-untuk-ibu-di-minggu-ke-1
2. Response Body
{
"code": 0,
"data": [
{
"author": {
"avatar": "string",
"name": "string",
"title": "string"
},
"content": "string",
"favorited": true,
"id": 0,
"likeTotal": 0,
"publishedDate": "2023-01-26T07:41:23.775Z",
"shareTotal": 0,
"slug": "string",
"tag": "string",
"tagColor": "string",
"tagId": 0,
"thumbnail": "string",
"title": "string",
"viewTotal": 0
}
],
"message": "string"
}
Search By Term
::: highlight green đź’ˇ
Rule :
The endpoint will be used to search (return list of articles related to) in all articles by term
:::
Endpoint Name : Search by Term
Method : GET
URL :/article/search/{term}
1. Path
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | term | STRING | M | term for searching purpose |
Example Path : | ||||
/article/search/hamil |
2. Query Params
No | Field Name | Data Type | Field Status | Description |
---|---|---|---|---|
1 | page | NUM | M | The page number which need to be displayed The page number which need to be displayed |
Sample Request Params :
page = 1
2. Response Body
{
"code": 0,
"data": [
{
"category": {
"id": 0,
"name": "string"
},
"subCategory": [
{
"articles": [
{
"author": {
"avatar": "string",
"name": "string",
"title": "string"
},
"content": "string",
"favorited": true,
"id": 0,
"likeTotal": 0,
"publishedDate": "2023-01-26T09:22:46.663Z",
"shareTotal": 0,
"slug": "string",
"tag": "string",
"tagColor": "string",
"tagId": 0,
"thumbnail": "string",
"title": "string",
"viewTotal": 0
}
],
"id": 0,
"name": "string",
"page": {
"currentPage": 0,
"nextPage": 0,
"prevPage": 0,
"totalElement": 0,
"totalPage": 0
},
"userArticleActivity": {
"likeTotal": 0,
"shareTotal": 0,
"viewTotal": 0
}
}
]
}
],
"message": "string"
}