Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Get contact's phone numbers and emails using the Windows Live/OneDrive REST API

Has anyone successfully used the Live SDK (also called OneDrive SDK) to retrieve the email addresses and/or phone numbers of an user's contacts ?

The best I have been able to do is the get profiles for a users contacts but it only includes hashed email addresses and no phone numbers, like this for example :

{
  "id": "contact.1e680c06000000000000000000000006",
  "first_name": "James",
  "last_name": "Cameron",
  "name": "James Cameron", 
  "gender": null,
  "is_friend": false, 
  "is_favorite": false,
  "user_id": null, 
  "email_hashes": [ "3972d8781911deba416ecf8e44dcc5f4dae92ab9aac58520bcfa480c31ea38f5", "301e45d554a7978c2a8ef1e662876411dfbca4b89535d2362dff3f6d786366b7" ],
  "updated_time": "2011-07-21T20:31:11+0000"
}
like image 478
user857276 Avatar asked Feb 02 '23 15:02

user857276


2 Answers

All you need to do is add the following scope to your list of scopes you're requesting:

"wl.contacts_emails"

e.g.

WL.login({scopes: ["wl.contacts_emails"]});
like image 141
brendanb Avatar answered Apr 09 '23 14:04

brendanb


Use hidden scopes, not officially supported but I can confirm they currently work at version 5.6 despite the MSDN forums telling you they don't.

For emails use wl.contacts_emails, for phone numbers use wl.contacts_phone_numbers.

like image 35
Robert Avatar answered Apr 09 '23 13:04

Robert