none
Outlook Web Add-In: Retrieve contacts RRS feed

  • Question

  • I'm working on developing outlook web addin which runs on both outlook365 and outlook.com. I have a requirement to create, read and update contacts using that web addin. Below is the sample which add current user to To field of an email.

    function addToRecipients() {
        var item = Office.context.mailbox.item;
        var addressToAdd = {
            displayName: Office.context.mailbox.userProfile.displayName,
            emailAddress: Office.context.mailbox.userProfile.emailAddress
        };
    
        if (item.itemType === Office.MailboxEnums.ItemType.Message) {
            Office.cast.item.toMessageCompose(item).to.addAsync([addressToAdd]);
        } else if (item.itemType === Office.MailboxEnums.ItemType.Appointment) {
            Office.cast.item.toAppointmentCompose(item).requiredAttendees.addAsync([addressToAdd]);
        }
    }
    

    Can anyone point out me how i can retrieve the outlook contacts using outlook web addin ?

    Thanks

    Friday, October 21, 2016 6:45 AM

All replies

  • Hi umarniaz,

    >> Can anyone point out me how i can retrieve the outlook contacts using outlook web addin ?

    As far as I know, there is no such API in Office add-ins. I also checked the makeEwsRequestAsync method, it is not supported to get contacts.

    It seems the only way is Outlook contacts rest api, you could refer the link below:

    # Outlook Contacts REST API reference

    https://msdn.microsoft.com/en-us/office/office365/api/contacts-rest-operations

    If this is a new feature you want to include in the future version of Office add-ins, I suggest you submit a feedback in the link below:

    http://officespdev.uservoice.com

    Best Regards,

    Edward


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, October 24, 2016 6:50 AM