Callback handler actions

Hi team,
I’m editing the document using docEditor. It’s been confirmed in the Callback Handler API document that a number of actions can come to the list, and I wonder when more than one action will come.

https://api.onlyoffice.com/docs/docs-api/usage-api/callback-handler/#actions

All of the Callback Body I saw while using had only one action, so it is difficult to test multiple actions when developing the Callback Handler.

If you tell me how to reproduce it, I will test it.

Thank you.

Hello,
Please clarify in more detail this use-case scenario. Why do you need it?
Callback should be able to handle 3 different actions received from 3 different users simultaneously without a problem, it should just be configured according to the guide mentioned above

I asked because I have never received a request with more than one action and wanna know possible cases of callback actions and status pair.

Is it possible to get the request case as below?

example 1. status 1 with action types 0(disconnect) and 1(connect)
A case that I think will happen

{
  "actions": [
    {
      "type": 0,
      "userid": "78e1e841"
    },
    {
      "type": 1,
      "userid": "78e1e842"
    }
  ],
  "status": 1,
  "url": "https://documentserver/url-to-edited-document.docx",
   ...
}

example 2. status 1 with three different action types
A case that I don’t think will happen

{
  "actions": [
    {
      "type": 0,
      "userid": "78e1e841"
    },
    {
      "type": 1,
      "userid": "78e1e842"
    },
    {
      "type": 2,
      "userid": "78e1e843"
    }
  ],
  "status": 1,
  "url": "https://documentserver/url-to-edited-document.docx",
   ...
}

example 3. status 2 with action types 0(disconnect)
A case that I think will happen

{
  "actions": [
    {
      "type": 0,
      "userid": "78e1e841"
    },
    {
      "type": 0,
      "userid": "78e1e842"
    },
    {
      "type": 0,
      "userid": "78e1e843"
    }
  ],
  "status": 2,
  "url": "https://documentserver/url-to-edited-document.docx",
   ...
}

example 4. status 2 with three different actions
A case that I don’t think will happen

{
  "actions": [
    {
      "type": 0,
      "userid": "78e1e841"
    },
    {
      "type": 1,
      "userid": "78e1e842"
    }, 
   {
      "type": 2,
      "userid": "78e1e843"
    }
  ],
  "status": 2,
  "url": "https://documentserver/url-to-edited-document.docx",
   ...
}

example 5. status 6 with three same actions type(2)
A case that I don’t think will happen

{
  "actions": [
    {
      "type": 2,
      "userid": "78e1e841"
    },
    {
      "type": 2,
      "userid": "78e1e842"
    },
    {
      "type": 2,
      "userid": "78e1e843"
    }
  ],
  "status": 6,
  "url": "https://documentserver/url-to-edited-document.docx",
   ...
}

The first case may theoretically occur if one user connects and another one disconnects simultaneously (without any delay).
The second example represents a case that is basically very rare and should not happen. Anyway, you should simply implement callback according to the following guide: Callback handler
The third case is theoretically possible.
As for the fourth example, very low probability of it happening.
Example 5 - Possible, but rare

It is very difficult to test manually, you’d have to perform actions simultaneously without any delay in different Editor tabs.

1 Like