Skip to main content

How do I get siblings topics?

For example, if you want to get/display the previous/next topic on the topic detail page, specify central_id and make a request.

central_id is available on the following endpoints:

  • Category: Content
  • Model: Topics
  • Operation: list

How to check the operation

Suppose that below contents are registered.
Image from Gyazo

We check the operation in Swagger UI when we want to get the previous and next topics of the content with the following conditions:

  • The subject of the content is Kuroco is updated
  • Content ID is 12

Click [Try it out].
Image from Gyazo

Enter 12 in the central_id field.
Image from Gyazo

Click [Execute].
Image from Gyazo

You get the response below:

{
"errors": [],
"messages": [],
"list": [
{
"topics_id": 11,
"ymd": "2022-12-28",
"contents_type": 18,
"contents": "<p>Our office will be closed from 12/29 ~ 1/5 due to the new year holiday.</p>",
"subject": "Holiday notice",
"topics_flg": 1,
"open_flg": 1,
"regular_flg": 0,
"inst_ymdhi": "2022-09-29T17:57:58+09:00",
"update_ymdhi": "2022-12-29T12:43:30+09:00",
"topics_group_id": 10,
"slug": "",
"order_no": 0,
"group_nm": "News",
"contents_type_cnt": 1,
"group_description": "",
"group_ext_data": null,
"contents_type_nm": "News",
"contents_type_parent_nm": null,
"category_parent_id": null,
"contents_type_ext_col_01": null,
"contents_type_ext_col_02": null,
"contents_type_ext_col_03": null,
"contents_type_ext_col_04": null,
"contents_type_ext_col_05": null,
"contents_type_list": [
18
]
},
{
"topics_id": 12,
"ymd": "2022-12-28",
"contents_type": 18,
"contents": "<p>Kuroco is updated</p>",
"subject": "kuroco is updated",
"topics_flg": 1,
"open_flg": 1,
"regular_flg": 0,
"inst_ymdhi": "2022-09-29T17:58:33+09:00",
"update_ymdhi": "2022-12-29T12:38:19+09:00",
"topics_group_id": 10,
"slug": "",
"order_no": 0,
"group_nm": "News",
"contents_type_cnt": 1,
"group_description": "",
"group_ext_data": null,
"contents_type_nm": "News",
"contents_type_parent_nm": null,
"category_parent_id": null,
"contents_type_ext_col_01": null,
"contents_type_ext_col_02": null,
"contents_type_ext_col_03": null,
"contents_type_ext_col_04": null,
"contents_type_ext_col_05": null,
"contents_type_list": [
18
]
},
{
"topics_id": 13,
"ymd": "2022-11-14",
"contents_type": 18,
"contents": "<p>test</p>",
"subject": "Test content 2",
"topics_flg": 1,
"open_flg": 1,
"regular_flg": 0,
"inst_ymdhi": "2022-11-14T19:30:24+09:00",
"update_ymdhi": "2022-12-29T12:38:41+09:00",
"topics_group_id": 10,
"slug": "",
"order_no": 0,
"group_nm": "News",
"contents_type_cnt": 1,
"group_description": "",
"group_ext_data": null,
"contents_type_nm": "News",
"contents_type_parent_nm": null,
"category_parent_id": null,
"contents_type_ext_col_01": null,
"contents_type_ext_col_02": null,
"contents_type_ext_col_03": null,
"contents_type_ext_col_04": null,
"contents_type_ext_col_05": null,
"contents_type_list": [
18
]
}
],
"pageInfo": ""
}

If you want to get the topics which are two before or two after, specify cnt=2 and make a request. If you specify cnt=n, you will get the content specified in central_id and n contents before and after it.


Support

If you have any other questions, please contact us or check out Our Slack Community.