Giter VIP home page Giter VIP logo

javascript-tutorial's Introduction

Sample JavaScript SPA app that uses the Outlook REST APIs

This sample app is the result of following the JavaScript tutorial on the Outlook Dev Center. If you follow that tutorial, you should come up with something fairly close to the code in this repository.

NOTE: Looking for the version of this tutorial that used the Outlook API directly instead of Microsoft Graph? Check out the outlook-api branch. Note that Microsoft recommends using the Microsoft Graph to access mail, calendar, and contacts. You should use the Outlook APIs directly (via https://outlook.office.com/api) only if you require a feature that is not available on the Graph endpoints.

Running the sample

If you didn't follow the tutorial and just want to download this repo and try it out, you need to do a few things first.

Set up a web server

You can host these files on any web server you like. If you don't have a web server handy, the tutorial has steps to install http-server to quickly create a development web server on the command line.

Register the app

Note: These steps tell you to use http://localhost:8080 as your redirect URI. This is assuming that you are using http-server as specified in the tutorial. If you're using a different web server, be sure to change the redirect URI to the acutal URI used to access your app.

Head over to the Application Registration Portal to quickly get a client ID and secret. If you're not asked to sign in, click the Go to app list button and sign in with either your Microsoft account (Outlook.com), or your work or school account (Office 365). Once you're signed in, click the Add an app button. Enter 'javascript-tutorial` for the name and click Create application.

Locate the Platforms section, and click Add Platform. Choose Web, then enter http://localhost:8080 under Redirect URIs. Click Save to complete the registration. Copy the Application Id and save it. We'll need those values soon.

Here's what the details of your app registration should look like when you are done.

The completed app registration

Replace the YOUR APP ID HERE value in outlook-demo.js with the application ID you generated as part of the app registration process.

javascript-tutorial's People

Contributors

jasonjoh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

javascript-tutorial's Issues

"We're unable to complete your request" error

Doesn't work in IE11

I trans-piled the ES6 (Arrow functions and the likes) so i could attempt to make this example work with IE 11. No dice. It does allow me to get to Microsoft, but once i click on my account and it redirects. it returns an error:

Invalid State:
"The state in the authorization response did not match the expected value. Please try signing in again."

I would love to trouble shoot this deeper, however i can't seem to get IE to not clear my console on navigation, even after unchecking the button to do so. It just opens the page with it checked.

Token expiry time

Hey Jason,

Is it possible to extend the life of a token to a day or week?

I am trying to continuously keep users calendars up to date, while trying to minimize the number of times they have to login to their accounts.

Can you use the Javascript API to write as well? In particular, I haven't found any information about adding attendee's to calendar events using the Graph API.

Thanks in advance

Logic of function getUserEmailAddress

In the function, it checks whether the userEmail already exists in the sessionStorage or not.

However, the userEmail is never stored.

So, maybe we can move "if (sessionStorage.userEmail){ ..." into "getAccessToken(function(accessToken) { ..."
and then add "sessionStorage.userEmail = res.mail" inside "else {callback(res.mail); }"?

How to send a mail ? and filter sent items using specific email address ?

Sir i need to integrate outlook email client to one of my project. i was looking for a solution and i found this tutorial. I have listed the inbox messages based on the filter (by an email address). I need to compose mail and sent via this api and also i need to show sent items for a specific email address. Can you please help me for this ?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.