In this guide, you will learn how to delete any message on any board. The message can be any of the following types:
- Forum
- Blog Article
- Knowledge Base Article
Requirements
You must have either of the permissions set to Grant by the Administrator.
- Delete own post – Deletes the logged-in user's messages.
- Delete any post – Deletes any message from any board.
Basic Steps
- Open any board where you want to delete a forum, blog article, or knowledge base (KB) article.
- Identify the ID of the forum, blog article, or KB article you want to delete.
- Make sure that you have the necessary permission to delete it.
- Make a GraphQL Request to delete a forum, blog article, or KB article.
Example
Delete any Message
In this example, we are going to delete a Sling Hockey forum from the Games Club board.
- Sign in to your community.
- Go to the Games Club board.
- Make a note of the ID of the Sling Hockey forum.
- Make sure that you have the Delete any post permission.
- Make a GraphQL DELETE request using the message ID.
The ID of the message is 16.
Here is an example of the GraphQL request.
mutation DeleteMessage($id: ID!) {
deleteMessage(id: $id) {
result
__typename
}
}
The mutation here initiates a DeleteMessage
function using information passed through GraphQL variables. Here is an example to delete a message.
{
"id": "message:16"
}
Here is the response to the GraphQL request.
{
"data": {
"deleteMessage": {
"result": true,
"__typename": "DeleteMessageResponse"
}
}
}
ATLAS
Comments