You can update your own blog article or any blog article in a blog board that you want.
Requirements
You must have either one of the below permissions set to Grant by the Administrator based on your preference.
- Edit own published posts - To update your own blog article
- Edit any published post - To update any blog article
Basic Steps
- Open the knowledge base board where you want to update a knowledge base article.
- Identify the ID of the KB article from the knowledge base board from the URL of the KB article.
- Ensure that you have the necessary permission to update the blog article granted by the Administrator based on your preference.
- Create a POST request to update a blog article.
Example
Update a Knowledge Base Article
In this example, we are going to update the body of the knowledge base article in the Water resources board using a GraphQL query.
- Sign in to your community.
- Go to the Water Resources Board.
- Make a note of the message ID from the board.
- Make a GraphQL POST request to the board.
The ID of the message is 404.
Here is the GraphQL POST request and response to create a blog article.
mutation updateTkbArticle($id:ID!, $updateInput:UpdateTkbArticleInput!) {
updateTkbArticle(id: $id, updateInput: $updateInput) {
result {
id
body
subject
contentWorkflow {
state
}
}
}
}
The mutation here initiates an updateBlogArticle
function using information passed through GraphQL variables. Here is an example to update a blog article.
{
"id": "message:404",
"updateInput":{
"subject":"Micro Crime City ",
"body": "If you're a fan of Where's Waldo and other hidden clues games, check out Micro Macro Crime City. You can play this mystery game solo or with others. This actually increases your analytical skills.",
"teaser": "Micro Crime City is a puzzle game",
"introduction": "This cooperative detective game is set in a whimsical city riddled with crime. The map is chock full of tiny details and awesome things to explore. Most cases start with a dead body and questions you need to answer in order to find the killer. Players work together to solve crimes on a massive map. The map is about 2.5' x 3.6'."
}
}
Here is the response to the above example.
{
"data": {
"updateTkbArticle": {
"result": {
"id": "message:404",
"body": "If you're a fan of Where's Waldo and other hidden clues games, check out Micro Macro Crime City. You can play this mystery game solo or with others. This actually increases your analytical skills.",
"subject":"Micro Crime City ",
"contentWorkflow": {
"state": "PUBLISH"
}
}
}
}
}
ATLAS
Comments