Skip to content
This repository has been archived by the owner on Feb 17, 2023. It is now read-only.

Latest commit

 

History

History
98 lines (68 loc) · 5.26 KB

README.md

File metadata and controls

98 lines (68 loc) · 5.26 KB

Microsoft Graph Search API Sample for Excel (Node.js)

Table of contents

Introduction

This sample includes a NodeJS/Express application that demonstrates how to add an AddIn to Outlook and trade and IdentityAPI token for a Graph token to make a call to Microsoft Graph Search API endpoint.

Prerequisites

This sample requires the following:

Getting started with sample

  1. Download or clone this repo.

Create an Azure AD Application

Follow the steps in Configuring Azure.

Configure the project

  1. Open Visual Studio code to the ./Sample2.2a/SearchBetaApi folder
  2. Open the server.ts file
  3. Replace the values for the following:
  • {client TenantID} - your Azure AD Tenant ID
  • {client GUID}- the client id from the Configuring Azure steps
  • {client secret} - the client secret from the Configuring Azure steps

NOTE: If you did the Visual Studio sample in Sample 2.0, you can skip to Test the AddIn as all the settings are the same.

Update the AddIn manifest xml

  1. Open the GraphSearchApiOutlook.xml file
  2. Scroll to the bottom of the file, in the WebApplicationInfo section, ensure that the clientid matches the client id from the Configuring Azure steps
  3. Save the file

Test the AddIn

  1. Switch back to Visual Studio Code
  2. Click the debug tab, then select Launch Program configuration
  3. Switch back to Excel, click Retry to refresh the application task pane.
  4. Run a search, review the results that are exported to the workbook sheet as a filterable and searchable table

Code of note

  • Remember if you make changes, you must run npm run-script build to rebuild the TypeScript files into their corresponding javascript.
  • The server.ts file contains the endpoint that will trade the identity token for the graph token.

Questions and comments

We'd love to get your feedback about this sample! Please send us your questions and suggestions in the Issues section of this repository.

Your feedback is important to us. Connect with us on Stack Overflow. Tag your questions with [MicrosoftGraph].

Contributing

If you'd like to contribute to this sample, see CONTRIBUTING.md.

This project has adopted the Microsoft Open Source Code of Conduct. For more information, see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

Additional resources

Copyright

Copyright (c) 2019 Microsoft. All rights reserved.