guideEvents

Each event corresponds with a certain action that can happen in CKEditor Cloud Services in a certain environment. Also, each event has a specific payload format with the relevant event information.

# Comments

The following events can be triggered for the Comments service.

# Comment added

Name: comment.added
Description: Triggered when a comment is created.

# Payload

  • document.id – The ID of the document in which the comment was added.
  • comment.id – The ID of the added comment.
  • comment.created_at – The creation date of the comment.
  • comment.content – The content of the added comment.
  • comment.thread_id – The thread ID that the comment was added to.
  • comment.user.id – The ID of the author of the comment.

# Example

The following example presents a webhook request sent after a comment is added.

{
    "event": "comment.added",
    "environment_id": "environment-1",
    "payload": {
        "document": {
            "id": "doc-1"
        },
        "comment": {
            "id": "comment-1",
            "created_at": "2019-05-29T08:17:53.450Z",
            "content": "Some comment content.",
            "thread_id": "thread-1",
            "user": {
                "id": "user-1"
            }
        }
    },
    "sent_at": "2019-05-29T08:17:53.457Z"
}

# Comment updated

Name: comment.updated
Description: Triggered when a comment is updated.

# Payload

  • document.id – The ID of the document in which the comment was updated.
  • comment.id – The ID of the updated comment.
  • comment.updated_at – The date of the comment update.
  • comment.content – The content of the updated comment.
  • comment.thread_id – The thread ID in which the comment was updatedś.
  • comment.user.id – The ID of the author of the updated comment.

# Example

The following example presents a webhook request sent after a comment is updated.

{
    "event": "comment.updated",
    "environment_id": "environment-1",
    "payload": {
        "document": {
            "id": "doc-1"
        },
        "comment": {
            "id": "comment-1",
            "updated_at": "2019-05-29T08:17:53.450Z",
            "content": "Some comment content.",
            "thread_id": "thread-1",
            "user": {
                "id": "user-1"
            }
        }
    },
    "sent_at": "2019-05-29T08:17:53.457Z"
}

# Comment removed

Name: comment.removed
Description: Triggered when a comment is removed.

# Payload

  • document.id – The ID of the document from which the comment was removed.
  • comment.id – The ID of the removed comment.
  • comment.removed_at – The date of the comment removal.
  • comment.user.id – The ID of the user who removed the comment.

# Example

The following example presents a webhook request sent after a comment is removed.

{
    "event": "comment.removed",
    "environment_id": "environment-1",
    "payload": {
        "document": {
            "id": "doc-1"
        },
        "comment": {
            "id": "comment-1",
            "removed_at": "2019-05-29T08:17:53.450Z",
            "user": {
                "id": "user-1"
            }
        }
    },
    "sent_at": "2019-05-29T08:17:53.457Z"
}

# Comment thread removed

Name: commentthread.removed
Description: Triggered when a comment thread is removed.

# Payload

  • document.id – The ID of the document from which the comment thread was removed.
  • comment_thread.id – The ID of the removed comment thread.
  • comment_thread.removed_at – The date of the comment thread removal.
  • comment_thread.comments – The list of comments from the removed comment thread.

# Example

The following example presents a webhook request sent after a comment thread is removed.

{
    "event": "commentthread.removed",
    "environment_id": "environment-1",
    "payload": {
        "document": {
            "id": "doc-1"
        },
        "comment_thread": {
            "id": "comment-thread-1",
            "removed_at": "2019-05-29T08:17:53.450Z",
            "comments": [
               {
                   "id": "comment-1"
               }
            ]
        }
    },
    "sent_at": "2019-05-29T08:17:53.457Z"
}

# Comment thread restored

Name: commentthread.restored
Description: Triggered when a comment thread is restored. A comment thread can be removed by removing the text in a document. The undo operation can restore the removed text but also restore the comment thread.

# Payload

  • document.id – The ID of the document where the comment thread was restored.
  • comment_thread.id – The ID of the restored comment thread.
  • comment_thread.restored_at – The date of the comment thread restoration.
  • comment_thread.comments – The list of comments from the restored comment thread.

# Example

The following example presents a webhook request sent after a comment thread is restored.

{
    "event": "commentthread.restored",
    "environment_id": "environment-1",
    "payload": {
        "document": {
            "id": "doc-1"
        },
        "comment_thread": {
            "id": "comment-thread-1",
            "restored_at": "2019-05-29T08:17:53.450Z",
            "comments": [
               {
                   "id": "comment-1"
               }
            ]
        }
    },
    "sent_at": "2019-05-29T08:17:53.457Z"
}

# Comment threads removed

Name: commentthread.all.removed
Description: Triggered when all comment threads in a document are removed.

# Payload

  • document.id – The ID of the document from which the comment threads were removed.
  • comment_threads – The list of removed comment threads.
  • comment_threads[].id – The ID of the removed comment thread.
  • comment_thread[].removed_at – The date of the comment thread removal.
  • comment_thread[].comments – The list of comments from the removed comment threads.

# Example

The following example presents a webhook request sent after all comment threads are removed from a document.

{
    "event": "commentthread.all.removed",
    "environment_id": "environment-1",
    "payload": {
        "document": {
            "id": "doc-1"
        },
        "comment_threads": [
            {
                "id": "comment-thread-1",
                "removed_at": "2019-05-29T08:17:53.450Z",
                "comments": [
                    {
                        "id": "comment-1"
                    }
                ]
            },
            {
                "id": "comment-thread-2",
                "removed_at": "2019-05-29T08:17:53.450Z",
                "comments": [
                    {
                        "id": "comment-2"
                    }
                ]
            },
        ]
    },
    "sent_at": "2019-05-29T08:17:53.457Z"
}

# Collaboration

The following events can be triggered for the Collaboration service.

# User connected

Name: document.user.connected
Description: Triggered when a user is connected to a document.

# Payload

  • document.id – The ID of the document that the user connected to.
  • user.id – The ID of the user.
  • connected_users – The list of currently connected users.

# Example

The following example presents a webhook request sent after a user connected to the document.

{
    "event": "document.user.connected",
    "environment_id": "environment-1",
    "payload": {
        "user": {
            "id": "user-1"
        },
        "document": {
            "id": "document-1"
        },
        "connected_users": [
            {
                "id": "user-2"
            }
        ]
    },
    "sent_at": "2019-05-29T08:17:56.761Z"
}

# User disconnected

Name: document.user.disconnected
Description: Triggered when a user is disconnected from a document.

# Payload

  • document.id – The ID of the document that the user disconnected from.
  • user.id – The ID of the user.
  • connected_users – The list of currently connected users.

# Example

The following example presents a webhook request sent after a user disconnected from the document.

{
    "event": "document.user.disconnected'",
    "environment_id": "environment-1",
    "payload": {
        "user": {
            "id": "user-1"
        },
        "document": {
            "id": "document-1"
        },
        "connected_users": [
            {
                "id": "user-2"
            }
        ]
    },
    "sent_at": "2019-05-29T08:17:56.761Z"
}