Import hotmail, outlook contacts with Javascript using Windows Live Contact API

In this tutorial I will show you a practical example of web development: how to import hotmail, outlook, live contacts to your web project, using a client-side method (javascript).

The response data will come in javascript, but you can easily pass it to php with an ajax function.

Note: If you don’t have a  live.com account (oulook, hotmail, live), you can create it here : https://www.live.com


Import contacts windows live api

View demoDemo importing contacts with Windows Live Contact API

Step 1

Create a Live.com application in “Microsoft account Developer Center” for obtaining your Client ID and Client Secret.

 

Create application Live API

 

 

  • Complete your basic information: application name, application logo, urls, etc

Live api complete basic info

 

 

  • Go to “API Settings” from the left menu.
  • – For “Mobile and desktop client app” select NO
    – “Target domain” – leave blank
    – “Restrict JWT issuing” select NO
    – for “Root domain” enter your application url: http://www.example.com
    – for “Redirect URLs” enter the url that live.com API will use to redirect your response data. For example, after a user will accept giving credentials to your application, he will receive an automatically a response to http://www.example.com

 

Live api settings

 

 

  • go to “App settings” from the left menu, to view your API credentials, Client ID and Client Secret

Live api app settings

 

Step 2

Code example

  • Reference the API, using a web-based version of the wl.js in your code

More details here: https://msdn.microsoft.com/en-us/library/hh826538.aspx

 

  • Initialize the Live SDK JavaScript library.

More details here: https://msdn.microsoft.com/en-us/library/office/hh550844.aspx

 

  • Create a button to fire the import contacts

 

  • Create a click function to the button, to import contacts using WL.Login

 

  •  when the user will click on that link he will be asked to allow permissions that you import outlook or hotmail contacts for your application

Live.com credentials request

Any question about Windows Live Contact API ?

If you still have problems importing your hotmail or outlook contact to your web application don’t hesitate to post your question below.

How to import Hotmail, Outlook contacts with Javascript using Windows Live Contact API http://bit.ly/1FvJeeg

Posted by Design19 on Thursday, June 4, 2015

Bogdan Rusu

Working in development for more then 10 years, Bogdan Rusu is the CTO of Design19 web agency. Highly skilled in PHP development and usage of CMS like Wordpress, Magento, Zend framework, but also custom built platforms based on PHP, Bogdan has driven the team to a higher level of proficiency in development.