Office 365 Contacts REST API not woking from SharePoint using jQuery

Dear All,

I have tried to get user contact using Jquery but it throws error function.

Please help to fix it. below is my code

$(document).ready(function() {
    $.ajax({
   url: "https://outlook.office365.com/api/v1.0/users/xxx.xxxx@xyz.com",
  type: "GET",
     headers: { "ACCEPT": "application/json;odata=verbose" },
     success: function(data){
    },
    error:  function(){
      alert("Failed to get data");
    }
  });


 });

May 27th, 2015 12:06am

Hi,

Please check this

http://blog.karstein-consulting.com/2014/03/18/cross-site-scripting-with-sharepoint-2013-rest-calls/

Free Windows Admin Tool Kit Click here and download it now
May 27th, 2015 12:30am

Hi,

I have tried the blog but still not working.

May 27th, 2015 9:20am

Hi,

Please check the blog below:

How to Send Cross Domain AJAX Request with jQuery

http://hayageek.com/cross-domain-ajax-request-jquery/

If you want to get user informaiton from SharePoint, we can use REST API and JSOM to achieve it.

SharePoint 2013: Get UserProfile Properties with REST API

http://www.vrdmn.com/2013/07/sharepoint-2013-get-userprofile.html

SharePoint 2013: Working with User Profiles & JavaScript CSOM

http://www.vrdmn.com/2013/02/sharepoint-2013-working-with-user.html

Best Regards

Free Windows Admin Tool Kit Click here and download it now
May 28th, 2015 2:46am

Thanks for your reply.

SP object not having a property to get alias name from Get UserProfile Properties rest api's

After analyse the issue and understand that it will not work if the target sites and the local browser does not support cors

Office 365 Outlook REST APIs (Mail, Calendar, Contacts) are still not supported CORS.

Microsoft not yet enabled CROS for office 365 outlook. (bad luck - we don't know the road map date for this feature)

May 29th, 2015 9:30am

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics