To create a guide under a KB board, use the createGuide mutation.
Note
- If you want to create a guide with an icon, you must pass the request as form-data. See Updating a Guide.
- You can add up to 500 guides, chapters, and articles. Contact Support to update the limit.
Fields
Use the below fields information to create a guide under a KB board.
| Field | Description | Required |
|---|---|---|
| nodeId | ID of the KB board | Required |
| title | Title of the guide | Required |
| description | Description of the guide | Optional |
| hidden | To hide a guide from members, set this field as false. By default, the guides are hidden.To finalize your KB Guide structure and all the articles in it, you can hide the KB guide from the members by setting this field as true. |
Optional |
| avatar | Avatar of the guide. This includes file and cropProps sub-fields. |
Optional |
| file | This is a sub-field of avatar. The guide image you want to add. | Optional |
| cropProps | This is a sub-field of avatar. The crop properties of the avatar include positionX, positionY, relativeWidth, relativeHeight, scale, relativeX, and relativeY fields for the image. |
Optional |
Example
To create an “Artificial Intelligence” guide under a KB board and add chapters and articles to it, use the createGuide mutation.
Create guide without an avatar
mutation {
createGuide(guideInput: {nodeId: "board:AIBoard", title: "Artificial Intelligence", description: "About AI and its impact.", hidden: false}) {
errors {
__typename
... on PermissionDeniedError {
fields
message
}
... on InvalidGuideError {
fields
message
}
... on MaximumEntriesAdded {
fields
limit
}
... on GuideNotEnabledError {
fields
message
}
... on ParentNodeError {
fields
message
}
... on InvalidGuideTitle {
fields
message
}
... on UploadLimitReached {
fields
message
}
... on TooManyUploadedImages {
fields
message
}
... on DisallowedImageFormat {
fields
message
}
... on UploadTooLarge {
fields
message
}
... on UploadFailed {
fields
message
}
... on InvalidCropProps {
fields
message
}
... on UnsupportedConversationStyleError {
fields
message
}
... on GreaterThanMaxValueError {
fields
message
}
... on UploadLimitReached {
fields
message
}
}
}
}
Create guide with an avatar
curl -L 'https://[COMMUNITY DOMAIN]/t5/s/api/2.1/graphql' \
-H 'li-api-session-key: 6666777778888899999999FFFFFFGGGG' \
-H 'Content-Type: multipart/form-data' \
-F 'operations="{\"operationName\":\"CreateGuide\",\"variables\":{\"file\":{\"avatar\":{\"file\":null,\"cropProps\":{\"positionX\":0.5,\"positionY\":0.5,\"relativeWidth\":0.5,\"relativeHeight\":1,\"scale\":1,\"relativeX\":0,\"relativeY\":0}},\"nodeId\":\"board:tr-books\",\"title\":\"About T-bact\",\"description\":\"This guide is about T- bact3 medicine.\",\"hidden\":true}},\"query\":\"mutation CreateGuide(\$file: GuideInput\!) {\\n createGuide(guideInput: \$file) {\\n errors {\\n __typename\\n ... on MaximumEntriesAdded {\\n limit\\n __typename\\n }\\n }\\n __typename\\n }\\n}\\n\"}"' \
-F 'map="{\"1\":[\"variables.file.avatar.file\"]}"' \
-F '1=@"/Users/[USERNAME]/Downloads/Icon.png"' \
GraphQL response:
{
"data": {
"createGuide": {
"errors": null
}
}
}
ATLAS
Comments