What WOPI API needs to be implemented in order to support body.insertOoxml OfficeJs API call

320 views Asked by At

I am developing a Word Online add-in that is supposed to operate in an environment with a custom WOPI host. We faced issues with a certain Office JS API which appears not to be supported on the WOPI host side. But we are struggling with identifying what exactly is missing.

Could anyone please help me to figure out what WOPI API needs to be implemented in order to support insertOoxml OfficeJs API call with insertLocation set to "Replace"?

What the sequence of calls to the WOPI host would be in this case?

The code is pretty simple and works as expected with SharePoint as a WOPI Host.

Word.run(function (context) {
   var body = context.document.body;
   body.insertOoxml(ooxmlDoc, "Replace");
   return context.sync().then(function () {
   q.resolve();
 });
})

RichApi.Error screenshot

Unfortunately, I have very limited access to the WOPI host codebase to understand the root cause.

Any ideas are highly appreciated!

1

There are 1 answers

0
rocky On

Can you fetch the CheckFileInfo of your WOPI host?

You need to make a GET request to /wopi/files/(file_id) with the right access_token. Then check the WOPI Capabilities, especially things like: