Knowing the user who gets out of the document

When the documet is set autosave, I realized the callback handler is called in two cases: when the user get in the document and when the user get out of the document.

Is it possible to know the user who is getting out of the document? Through the callback handler?

I can see there are parameters called userdata and user. However, when I debbug the callbackandler when the user get out of the document, those props are null.

Hello @diego.cruz

In co-editing when user connects or disconnects from editing session status 1 is sent to callback handler. This status also specifies the action type for made action:

0 - the user disconnects from the document co-editing
1 - the new user connects to the document co-editing

However, if there is no co-editing session inbound, i.e. there is only one user in the document, then status 2 is used instead.

Can you provide more detailed usage scenario when you want to check disconnected user and under which conditions for better understanding?

Hello Constantine.

Thank you for your answering.

The scenario I want to know, if it is possible to know the specific user who are exiting the document. If there is any information in the callback handler that provides any id, or somenthing else that I can identify the user.

The task is: The screen that lists the files, I need to show the users who are editing a document or not. I just asked in another topic if it is possible to know, asking the callback hander, somehow, if we have this information, according to this topic:

If it is not really possible, I was thinking to control who get in the document and exiting the document, saving in our data base. That the reason for my question: If its possible to know, via callback handler, the user who are exiting the document, when the user exist the document and callback handler is called automatticaly.

I hope my doubt was clear this time, and if not, you can ask anything.

Thank you

As I mentioned, actions parameter shows which action was performed and with value 0 it means that user has disconnected from the document. Message containing actions parameter is automatically sent by Document Server to callbackUrl. Statuses may vary according to performed actions but this parameter should always show who disconnects from editing session.

Here is an example of actions block:

"actions":[{"type":0,"userid":"uid-1"}]