Office 365 Developer – Get the Personal Contacts with Microsoft Graph API


As you aware Outlook contacts lets you store personal contacts' data, and is part of the Outlook messaging hub in Office 365. Through Outlook, you can manage emails, schedule meetings, find information about users in an organization, initiate online conversations, share files, and collaborate in groups. So now with Microsoft Graph API you can get/pull the Personal contacts.

Request:
GET https://graph.microsoft.com/v1.0/me/contacts

Response:
{
"@odata.context": "https://graph.microsoft.com/v1.0/$metadata#users('48d31887-5fad-4d73-a9f5-3c356e68a038')/contacts",
"@odata.nextLink": "https://graph.microsoft.com/v1.0/me/contacts?$skip=10",
"value": [
{
"@odata.etag": "W/\"EQAAABYAAAAiIsqMbYjsT5e/T7KzowPTAAAYc8Bf\"",
"id": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEOAAAiIsqMbYjsT5e-T7KzowPTAAAYbuK-AAA=",
"createdDateTime": "2017-09-04T15:54:01Z",
"lastModifiedDateTime": "2017-09-04T15:54:02Z",
"changeKey": "EQAAABYAAAAiIsqMbYjsT5e/T7KzowPTAAAYc8Bf",
"categories": [],
"parentFolderId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OAAuAAAAAAAiQ8W967B7TKBjgx9rVEURAQAiIsqMbYjsT5e-T7KzowPTAAAAAAEOAAA=",
"birthday": null,
"fileAs": "",
"displayName": "Alex Wilber",
"givenName": "Alex",
"initials": null,
"middleName": null,
"nickName": null,
"surname": "Wilber",
"title": null,
"yomiGivenName": null,
"yomiSurname": null,
"yomiCompanyName": null,
"generation": null,
"imAddresses": [],
"jobTitle": null,
"companyName": null,
"department": null,
"officeLocation": null,
"profession": null,
"businessHomePage": null,
"assistantName": null,
"manager": null,
"homePhones": [],
"mobilePhone": null,
"businessPhones": [],
"spouseName": null,
"personalNotes": "",
"children": [],
"emailAddresses": [
{
"name": "Alex@FineArtSchool.net",
"address": "Alex@FineArtSchool.net"
}
],
"homeAddress": {},
"businessAddress": {},
"otherAddress": {}
},
{
"@odata.etag": "W/\"EQAAABYAAAAiIsqMbYjsT5e/T7KzowPTAAAYc8Be\"",
"id": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OABGAAAAAAAiQ8W967B7TKBjgx9rVEURBwAiIsqMbYjsT5e-T7KzowPTAAAAAAEOAAAiIsqMbYjsT5e-T7KzowPTAAAYbuK_AAA=",
"createdDateTime": "2017-09-04T15:54:01Z",
"lastModifiedDateTime": "2017-09-04T15:54:01Z",
"changeKey": "EQAAABYAAAAiIsqMbYjsT5e/T7KzowPTAAAYc8Be",
"categories": [],
"parentFolderId": "AAMkAGVmMDEzMTM4LTZmYWUtNDdkNC1hMDZiLTU1OGY5OTZhYmY4OAAuAAAAAAAiQ8W967B7TKBjgx9rVEURAQAiIsqMbYjsT5e-T7KzowPTAAAAAAEOAAA=",
"birthday": null,
"fileAs": "",
"displayName": "Angel Garcia",
"givenName": "Angel",
"initials": null,
"middleName": null,
"nickName": null,
"surname": "Garcia",
"title": null,
"yomiGivenName": null,
"yomiSurname": null,
"yomiCompanyName": null,
"generation": null,
"imAddresses": [],
"jobTitle": null,
"companyName": null,
"department": null,
"officeLocation": null,
"profession": null,
"businessHomePage": null,
"assistantName": null,
"manager": null,
"homePhones": [],
"mobilePhone": "(302) 555-0104",
"businessPhones": [],
"spouseName": null,
"personalNotes": "",
"children": [],
"emailAddresses": [],
"homeAddress": {},
"businessAddress": {},
"otherAddress": {}
},
},
]
}

So now with Graph API you can get the personal contacts and for developers, it will help you to tap into the rich functionality of mail or calendar means opening up richer scenarios with the user's contacts data. In addition, i would suggest you to go through the related documentation which talks about Why integrate with Outlook personal contacts.

Happy Programming!!

Comments (0)

Skip to main content