Search code examples
exceloffice365office-jsexcel-addins

Consume external API from within OfficeJS


I'm currently working on creating my first ever Office 365 plugin specifically for Excel. I would like this plugin to be able to make REST API calls to an external service(either a micro service or a Lambda). I haven't written the REST service yet but want to know if this is even remotely possible from within Office JS. I found a similar question asked Use Office.js APIs from outside an Office Add in back in 2016 when Office-JS was brand new. Just wanted to know if there is better support for REST API from within Office-JS and if so where can i find specific documentation to accomplish this.


Solution

  • Yes. You can do this. Any REST API that can be called in a web app can be called from an Excel Add-in because the add-in essentially a web app embedded in Excel. E.g., the same ajax request that would work in a web app would work in the add-in.

    I think the question that you linked to is different. It seems to be about the Excel REST APIs which are not the same as the Office.js.