Workplace from Meta is going away. You will be able to continue using Workplace until 31 August 2025. Visit our Help Center to find out more.
/{category-id}Represents a Knowledge Library category. The /{category-id} node returns a single category.
You can read information about a category by making a Graph API GET request to /{category-id}.
Reading Category node require Read Knowledge Library content permission.
| Field Name | Description | Data Type |
|---|---|---|
| The category ID |
|
| The title of the category |
|
| The text content of the category's document |
|
| Indicates the status of the category |
|
| The last member to edit the content. |
|
| Users/Groups/Conditional access based on profile fields to read the content in the category. |
|
| The color of the category. |
|
| The icon representing the category. |
|
| The time when the category was last updated. |
|
| The formatted content of category in JSON. |
|
| ID of parent category. Null/empty if category is a root category. |
|
| Sequence number of the category in the parent's hierarchy. |
|
You can't publish using this node. To make a new category in a community, use the /community/knowledge_library_categories edge as described here.
A category can be deleted by making a DELETE request to /{category_id}. You will need Manage Knowledge Library content permission.
A category can be updated by making a POST request on the /{category_id}. You will need Manage Knowledge Library content permission.
| Edge Name | Description |
|---|---|
| All subcategories associated with a category. Use this edge to get the list of subcategories or to create a new subcategory. |
| Add a new photo to a category. It supports the following format:
File Size:
|
| Add a new video to a category. It supports the following format: MP4 |
| Add a new file to a category |
| The comments on a category.Supports a |
| The
|
| The
Note that this is subject to the same limitations as described here |
title, icon, color, json_content of a categoryGET /{category_id}?fields=title,icon,color,json_content HTTP/1.1
Host: graph.facebook.comPOST /{category_id}/subcategories?
title={...} &
json_content={...}
icon ={...}
HTTP/1.1
Host: graph.facebook.comaudience of a category, including details on whether it was shared with groups, specific users or based on profile set conditionsGET /{category_id}?
fields=read_audience
{audience_type,
groups,
static_users,
profile_set_conditions}
HTTP/1.1
Host: graph.facebook.comaudience of a categoryPOST /{category_id} HTTP/1.1
Host: graph.facebook.com Payload:
//Example 1:
{
"read_audience": {
"audience_type": "PROFILE_FIELDS",
"profile_set_conditions": [
{
"field": "LOCATION",
"operator": "CONTAINS",
"values": [
"London",
"San Francisco"
]
},
{
"field": "TITLE",
"operator": "CONTAINS",
"values": [
"Engineer"
]
}
]
}
}
//Example 2:
{
"read_audience": {
"audience_type": "GROUPS",
"groups": [{group_id_1},{group_id_2}]
}
}
//Example 3:
//Only for subcategories to inherit the parent category's audience
{
"read_audience": {
"audience_type": "INHERIT"
}
}
POST graph.facebook.com
/{category-id}/photos?url={image-url}POST graph.facebook.com
/{category-id}/videos?url={video-url}POST graph.facebook.com
/{category-id}/files?url={file-url}&name={file_name}The response payload after uploading photo/video/file will return an id that can be used in json_content for the root type image/video/resource_section respectively as described in the next section.
Get /{category_id}/comments?
summary=true
HTTP/1.1
Host: graph.facebook.comGet /{category_id}/reactions?
summary=true&
since={unix_timestamp}&
until={unix_timestamp}
HTTP/1.1
Host: graph.facebook.comDELETE /{category_id} HTTP/1.1
Host: graph.facebook.comThis would remove the category from Knowledge Library.
json_content {
"json_content": [
{
"type": {root_type},
}
],
}
json_content[]| Property | Type | Description |
|---|---|---|
| String | The root type should be either |
| Object[] | Array of nodes Only applicable for |
| Object | Details of the image such as Only applicable for |
| ENUM {left,right,center} | Horizontal alignment of the image. Only applicable for |
| Integer | Width of the image. Only applicable for |
| Object | Details of the video such as Only applicable for |
| Boolean | Flag indicating if the video is a gif Only applicable for |
| String | Name of the section Only applicable for |
| URL | Video url from supported websites, including: Workplace, Facebook, Vimeo and Youtube. Only applicable for |
{
"type": "text_block",
"children": [
{
"type": "h1",
"children": [
{
"type": "text",
"text": "Header 1"
}
]
},
{
"type": "p",
"children": [
{
"type": "text",
"text": "This is a paragraph"
}
]
},
]
}
{
"type": "image",
"image_data": {
"id": {image_id}
},
"image_width": 440,
"halign": "center"
}
{
"type": "video",
"video_data": {
"id": {video_id}
},
"is_gif": false
}
{
"type": "resource_section",
"name": {section_name},
"children": [{
"type": "resource_file",
"file_data": {
"id": {file_id}
},
"name": {file_name},
"description": {file_description}
},
{
"type": "resource_link",
"href": {file_url},
"name": {file_name},
"description": {file_description}
}
]
}}
{
"type": "embedded_media",
"url": {url}
}
json_content[].children[]| Property | Type | Description |
|---|---|---|
| String | Possible child type for:
|
| Object[] | Array of child nodes as described in the next table |
| Type | Description |
|---|---|
| Heading 1Possible children: |
| Heading 2Possible children: |
|
Possible children: li |
| Defines a paragraph Possible children: |
|
Possible children: |
|
Possible children: li |
| Mention a Member Along with this type the other fields present are Possible children: |
| Bold Possible children: |
| Underline Possible children: |
| Possible children: |
| Italics Possible children: |
| Hyperlink Possible children: |
| Text This is the ultimate child of all child types when the root type is text_block and is of type |
| Object Details of the resource file within a resource_section such as |
| Object Details of the resource link within resource_section such as |
{
"type": "mention",
"children": [{
"type": "text",
"text": "Mentioned Member"
}],
"created_by": {
"id":{creator_member_id},
"name": "Creator Member"
},
"entity": {
"id": {mentioned_member_id},
"name": "Mentioned Member"
}
}
{
"type": "p",
"children": [{
"type": "b",
"children": [{
"type": "i",
"children": [{
"type": "u",
"children": [{
"type": "text",
"text": "Example Content which is Bold, Italics & Underlined"
}]
}]
}]
}]
}
{
"type": "ol",
"children": [{
"type": "li",
"children": [{
"type": "text",
"text": "Item 1"
}]
},
{
"type": "li",
"children": [{
"type": "text",
"text": "Item 2"
}]
}
]
}
{
"type": "code",
"children": [{
"type": "b",
"children": [{
"type": "text",
"text": "console.log(\"Bold\")"
}]
}]
}
{
"type": "a",
"children": [{
"type": "text",
"text": {link_text}
}],
"href": {url}
}