1"use strict";(self.webpackChunkkurokuro=self.webpackChunkkurokuro||[]).push([["19324"],{94427:function(e,n,t){t.r(n),t.d(n,{metadata:()=>r,default:()=>g,frontMatter:()=>c,contentTitle:()=>a,toc:()=>d,assets:()=>l});var r=JSON.parse('{"id":"faq/filtering-api-responses-by-content-category","title":"Filtering API responses by content category","description":"Use the `contents_type` parameter to filter the results by content category. For considering parent-child relationships in content categories, use the `category_parent_id` or `exclude_category_parent_id` parameters.","source":"@site/docs/faq/filtering-api-responses-by-content-category.mdx","sourceDirName":"faq","slug":"/faq/filtering-api-responses-by-content-category","permalink":"/docs/faq/filtering-api-responses-by-content-category","draft":false,"unlisted":false,"editUrl":"https://github.com/diverta/kuroco-documents/tree/main/packages/create-docusaurus/templates/shared/docs/faq/filtering-api-responses-by-content-category.mdx","tags":[],"version":"current","frontMatter":{"title":"Filtering API responses by content category","description":"Use the `contents_type` parameter to filter the results by content category. For considering parent-child relationships in content categories, use the `category_parent_id` or `exclude_category_parent_id` parameters.","category":"howto","subcategory":"api"},"sidebar":"faqSidebar","previous":{"title":"E-mails sent from Kuroco are going to spam. What should I do?","permalink":"/docs/faq/emails-sent-from-kuroco-are-going-to-spam-what-should-i-do"},"next":{"title":"Filtering API responses by tag category","permalink":"/docs/faq/filtering-api-responses-by-tag-category"}}'),s=t(74848),i=t(28453),o=t(55466);let c={title:"Filtering API responses by content category",description:"Use the `contents_type` parameter to filter the results by content category. For considering parent-child relationships in content categories, use the `category_parent_id` or `exclude_category_parent_id` parameters.",category:"howto",subcategory:"api"},a,l={},d=[{value:"Example Content",id:"example-content",level:2},{value:"Narrowing down by <code>contents_type</code>",id:"narrowing-down-by-contents_type",level:3},{value:"Filtering by <code>contents_type=[17]</code>",id:"filtering-by-contents_type17",level:4},{value:"Filtering by <code>contents_type=[17,54]</code>",id:"filtering-by-contents_type1754",level:4},{value:"Narrowing down by <code>category_parent_id</code>",id:"narrowing-down-by-category_parent_id",level:3},{value:"Filtering by <code>category_parent_id=[17]</code>",id:"filtering-by-category_parent_id17",level:4},{value:"Filtering by <code>category_parent_id=[54]</code>",id:"filtering-by-category_parent_id54",level:4},{value:"Narrowing down by <code>exclude_category_parent_id</code>",id:"narrowing-down-by-exclude_category_parent_id",level:3},{value:"Filtering by <code>exclude_category_parent_id=[54]</code>",id:"filtering-by-exclude_category_parent_id54",level:4},{value:"Related Documentation",id:"related-documentation",level:2}];function p(e){let n={a:"a",br:"br",code:"code",h2:"h2",h3:"h3",h4:"h4",img:"img",li:"li",p:"p",pre:"pre",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,i.R)(),...e.components};return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(o.A,{faqs:[{question:"Filtering API responses by content category",answer:"Use the `contents_type` parameter to filter the results by content category. For considering parent-child relationships in content categories, use the `category_parent_id` or `exclude_category_parent_id` parameters."}]}),"\n",(0,s.jsxs)(n.p,{children:["Use the ",(0,s.jsx)(n.code,{children:"contents_type"})," parameter to filter the results by content category."]}),"\n",(0,s.jsx)(n.h2,{id:"example-content",children:"Example Content"}),"\n",(0,s.jsx)(n.p,{children:"Check the results when filtering the following content:"}),"\n",(0,s.jsxs)(n.table,{children:[(0,s.jsx)(n.thead,{children:(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.th,{style:{textAlign:"left"},children:"Topic ID"}),(0,s.jsx)(n.th,{style:{textAlign:"left"},children:"Title"}),(0,s.jsx)(n.th,{style:{textAlign:"left"},children:"Content Category ID"}),(0,s.jsx)(n.th,{style:{textAlign:"left"},children:"Category Name"})]})}),(0,s.jsxs)(n.tbody,{children:[(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{style:{textAlign:"left"},children:"1152"}),(0,s.jsx)(n.td,{style:{textAlign:"left"},children:"Article of parent category"}),(0,s.jsx)(n.td,{style:{textAlign:"left"},children:"17"}),(0,s.jsx)(n.td,{style:{textAlign:"left"},children:"Parent NEWS"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{style:{textAlign:"left"},children:"1153"}),(0,s.jsx)(n.td,{style:{textAlign:"left"},children:"Article of child category"}),(0,s.jsx)(n.td,{style:{textAlign:"left"},children:"54"}),(0,s.jsx)(n.td,{style:{textAlign:"left"},children:"Child NEWS"})]}),(0,s.jsxs)(n.tr,{children:[(0,s.jsx)(n.td,{style:{textAlign:"left"},children:"1154"}),(0,s.jsx)(n.td,{style:{textAlign:"left"},children:"Article of grandchild category"}),(0,s.jsx)(n.td,{style:{textAlign:"left"},children:"55"}),(0,s.jsx)(n.td,{style:{textAlign:"left"},children:"Grandchild NEWS"})]})]})]}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Content Category Settings:",(0,s.jsx)(n.br,{}),"\n",(0,s.jsx)(n.img,{src:"https://t.gyazo.com/teams/diverta/d236acc42dff4867a25d46544cc5a335.png?width=600","data-zoom-src":"https://t.gyazo.com/teams/diverta/d236acc42dff4867a25d46544cc5a335.png",alt:"Image from Gyazo"})]}),"\n"]}),"\n",(0,s.jsxs)(n.li,{children:["\n",(0,s.jsxs)(n.p,{children:["Content List:",(0,s.jsx)(n.br,{}),"\n",(0,s.jsx)(n.img,{src:"https://t.gyazo.com/teams/diverta/b39c74c6ce08419bfe94fad75b0534af.png?width=600","data-zoom-src":"https://t.gyazo.com/teams/diverta/b39c74c6ce08419bfe94fad75b0534af.png",alt:"Image from Gyazo"})]}),"\n"]}),"\n"]}),"\n",(0,s.jsxs)(n.h3,{id:"narrowing-down-by-contents_type",children:["Narrowing down by ",(0,s.jsx)(n.code,{children:"contents_type"})]}),"\n",(0,s.jsxs)(n.p,{children:["Filtering by ",(0,s.jsx)(n.code,{children:"contents_type"})," does not consider the parent-child relationships in content categories. Therefore, the list of content belonging to the specified content category is returned."]}),"\n",(0,s.jsxs)(n.h4,{id:"filtering-by-contents_type17",children:["Filtering by ",(0,s.jsx)(n.code,{children:"contents_type=[17]"})]}
1),"\n",(0,s.jsx)(n.p,{children:'Only "Article of parent category" is displayed.'}),"\n",(0,s.jsxs)(n.p,{children:["Request URL:",(0,s.jsx)(n.br,{}),"\n",(0,s.jsx)(n.code,{children:"https://example.g.kuroco.app/rcms-api/13/news?contents_type%5B%5D=17"})]}),"\n",(0,s.jsx)(n.p,{children:"Response body:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'{\n "errors": [],\n "messages": [],\n "list": [\n {\n "topics_id": 1152,\n "ymd": "2023-02-16",\n "contents_type": 17,\n "contents": "",\n "subject": "Article of parent category",\n \u30FB\n \u30FB\n \u30FB\n }\n ],\n "pageInfo": {\n "totalCnt": 1,\n \u30FB\n \u30FB\n \u30FB\n }\n}\n'})}),"\n",(0,s.jsxs)(n.h4,{id:"filtering-by-contents_type1754",children:["Filtering by ",(0,s.jsx)(n.code,{children:"contents_type=[17,54]"})]}),"\n",(0,s.jsx)(n.p,{children:'"Article of parent category" and "Article of child category" are displayed.'}),"\n",(0,s.jsxs)(n.p,{children:["Request URL:",(0,s.jsx)(n.br,{}),"\n",(0,s.jsx)(n.code,{children:"https://example.g.kuroco.app/rcms-api/13/news?contents_type%5B%5D=17&contents_type%5B%5D=54"})]}),"\n",(0,s.jsx)(n.p,{children:"Response body:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'{\n "errors": [],\n "messages": [],\n "list": [\n {\n "topics_id": 1152,\n "ymd": "2023-02-16",\n "contents_type": 17,\n "contents": "",\n "subject": "Article of parent category",\n \u30FB\n \u30FB\n \u30FB\n },\n {\n "topics_id": 1153,\n "ymd": "2023-02-16",\n "contents_type": 54,\n "contents": "",\n "subject": "Article of child category",\n \u30FB\n \u30FB\n \u30FB\n }\n ],\n "pageInfo": {\n "totalCnt": 2,\n \u30FB\n \u30FB\n \u30FB\n }\n}\n'})}),"\n",(0,s.jsxs)(n.h3,{id:"narrowing-down-by-category_parent_id",children:["Narrowing down by ",(0,s.jsx)(n.code,{children:"category_parent_id"})]}),"\n",(0,s.jsxs)(n.p,{children:["Filtering by ",(0,s.jsx)(n.code,{children:"category_parent_id"})," considers the parent-child relationships in content categories. Therefore, the list of content belonging to the specified content category and its subcategories is returned."]}),"\n",(0,s.jsxs)(n.h4,{id:"filtering-by-category_parent_id17",children:["Filtering by ",(0,s.jsx)(n.code,{children:"category_parent_id=[17]"})]}),"\n",(0,s.jsx)(n.p,{children:'"Article of parent category", "Article of child category", and "Article of grandchild category" are displayed.'}),"\n",(0,s.jsxs)(n.p,{children:["Request URL:",(0,s.jsx)(n.br,{}),"\n",(0,s.jsx)(n.code,{children:"https://example.g.kuroco.app/rcms-api/13/news?category_parent_id%5B%5D=17"})]}),"\n",(0,s.jsx)(n.p,{children:"Response body:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'{\n "errors": [],\n "messages": [],\n "list": [\n {\n "topics_id": 1152,\n "ymd": "2023-02-16",\n "contents_type": 17,\n "contents": "",\n "subject": "Article of parent category",\n \u30FB\n \u30FB\n \u30FB\n },\n {\n "topics_id": 1153,\n "ymd": "2023-02-16",\n "contents_type": 54,\n "contents": "",\n "subject": "Article of child category",\n \u30FB\n \u30FB\n \u30FB\n },\n {\n "topics_id": 1154,\n "ymd": null,\n "contents_type": 55,\n "contents": "",\n "subject": "Article of grandchild category",\n \u30FB\n \u30FB\n \u30FB\n }\n ],\n "pageInfo": {\n "totalCnt": 3,\n \u30FB\n \u30FB\n \u30FB\n }\n}\n'})}),"\n",(0,s.jsxs)(n.h4,{id:"filtering-by-category_parent_id54",children:["Filtering by ",(0,s.jsx)(n.code,{children:"category_parent_id=[54]"})]}),"\n",(0,s.jsx)(n.p,{children:'"Article of child category" and "Article of grandchild category" are displayed.'}),"\n",(0,s.jsxs)(n.p,{children:["Request URL:",(0,s.jsx)(n.br,{}),"\n",(0,s.jsx)(n.code,{children:"https://example.g.kuroco.app/rcms-api/13/news?category_parent_id%5B%5D=54"})]}),"\n",(0,s.jsx)(n.p,{children:"Response body:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'{\n "errors": [],\n "messages": [],\n "list": [\n {\n "topics_id": 1153,\n "ymd": "2023-02-16",\n "contents_type": 54,\n "contents": "",\n "subject": "Article of child category",\n \u30FB\n \u30FB\n \u30FB\n },\n {\n "topics_id": 1154,\n "ymd": null,\n "contents_type": 55,\n "contents": "",\n "subject": "Article of grandchild category",\n \u30FB\n \u30FB\n \u30FB\n }\n ],\n "pageInfo": {\n "totalCnt": 2,\n \u30FB\n \u30FB\n \u30FB\n }\n}\n'})}),"\n",(0,s.jsxs)(n.h3,{id:"narrowing-down-by-exclude_category_parent_id",children:["Narrowing down by ",(0,s.jsx)(n.code,{children:"exclude_category_parent_id"})]}),"\n",(0,s.jsxs)(n.p,{children:["Using ",(0,s.jsx)(n.code,{children:"exclude_category_parent_id"})," allows you to exclude the list of content belonging to the specified content category and its subcategories from the response."]}),"\n",(0,s.jsxs)(n.h4,{id:"filtering-by-exclude_category_parent_id54",children:["Filtering by ",(0,s.jsx)(n.code,{children:"exclude_category_parent_id=[54]"})]}
1),"\n",(0,s.jsx)(n.p,{children:'Only "Article of parent category" is displayed.'}),"\n",(0,s.jsxs)(n.p,{children:["Request URL:",(0,s.jsx)(n.br,{}),"\n",(0,s.jsx)(n.code,{children:"https://example.g.kuroco.app/rcms-api/13/news?exclude_category_parent_id%5B%5D=54"})]}),"\n",(0,s.jsx)(n.p,{children:"Response body:"}),"\n",(0,s.jsx)(n.pre,{children:(0,s.jsx)(n.code,{className:"language-json",children:'{\n "errors": [],\n "messages": [],\n "list": [\n {\n "topics_id": 1152,\n "ymd": "2023-02-16",\n "contents_type": 17,\n "contents": "",\n "subject": "Article of parent category",\n \u30FB\n \u30FB\n \u30FB\n }\n ],\n "pageInfo": {\n "totalCnt": 1,\n \u30FB\n \u30FB\n \u30FB\n }\n}\n'})}),"\n",(0,s.jsx)(n.h2,{id:"related-documentation",children:"Related Documentation"}),"\n",(0,s.jsxs)(n.ul,{children:["\n",(0,s.jsx)(n.li,{children:(0,s.jsx)(n.a,{href:"/docs/faq/filtering-api-responses-by-tag-category",children:"Narrowing down API responses by tag category"})}),"\n"]})]})}function g(e={}){let{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,s.jsx)(n,{...e,children:(0,s.jsx)(p,{...e})}):p(e)}},55466:function(e,n,t){t.d(n,{A:()=>s});var r=t(74848);function s({faqs:e=[]}){if(0===(Array.isArray(e)?e.filter(e=>e.question&&e.answer):[]).length)return null;let n=JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:e.map(e=>({"@type":"Question",name:e.question,acceptedAnswer:{"@type":"Answer",text:e.answer}}))},null,2);return(0,r.jsx)("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:n}})}t(96540)},28453:function(e,n,t){t.d(n,{R:()=>o,x:()=>c});var r=t(96540);let s={},i=r.createContext(s);function o(e){let n=r.useContext(i);return r.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function c(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(s):e.components||s:o(e.components),r.createElement(i.Provider,{value:n},e.children)}}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.