If you are finding way of integrating “Office Web Apps(OWA)” with your custom solution which built with SharePoint CSOM/ JSOM or with integration of any client site development. Specially in a scenario where you develop your own “SharePoint display template” following integration points will be useful;
View in office web apps
Following link will work; if your requirement is to open your document in OWA. This can be done with simply appending parameter as below;
<uri to your document>?Web=0
Edit SharePoint documents in OWA
Following way of integration with the Office Web apps which let you to pick your action is; means that whether your action may be read, edit or your default setting.
<Web absolute URi>_layouts/15/WopiFrame.aspx?sourcedoc=<Relative URi to document>&action=<Your action>
Summary of actions as below;
&action=default -> Gets default setting of the documents &action=view -> Open office app as a read only &action=edit -> Open office app as editable
You can be changed the default behavior with following approach
Building URL to the Office Web Apps
If you thinking about how to build your URL; following illustration may be useful.
var owauri="_spPageContextInfo.webAbsoluteUrl" //absolute URL of the SharePoint site +"/_layouts/15/WopiFrame.aspx?sourcedoc=" //static phrase +"/sites/OWASite/Documents/TechCentro.docx" //Relative URL to the document +"&action=edit //Action parameter