none
Need help with Office 365 discovery service RRS feed

  • Question

  • Hi,

    We are working on developing an integration for office 365 and having some problem while calling the Discovery service. We are getting unauthorized exception in response.

    Please let us know if we need to do any specific setting to enable the discovery service. Also let us know the common issues that may come up if we dont call the discovery service in our integration.

    Thanks,

    BrajMohan

    Tuesday, November 18, 2014 1:05 PM

All replies

  • Hi BrajMohan,

    I'm going to escalate this question too. Any way, this article could be helpful for you, please take a look at it if you like:

    Setting up Directory Synchronization with the NEW Office 365

    Thanks for your understanding.


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Wednesday, November 19, 2014 8:44 AM
    Moderator
  • Hi,

    >> We are working on developing an integration for office 365 and having some problem while calling the Discovery service. We are getting unauthorized exception in response.

    I failed to reproduce your issue by using the code as following, would please provide a code sample to help us reproduce this issue so that we could troubleshoot at our side.

            private async void callO365ServiceDiscovery()
            {
                var client = new HttpClient();
    
                var authenticationContext = new AuthenticationContext("https://login.windows.net/Common");
    
                var discoveryResourceId  = "https://api.office.com/discovery/";
    
                var token = await AcquireTokenAsync(authenticationContext, discoveryResourceId);
    
                var headers = client.DefaultRequestHeaders;
    
                headers.Add("OData-Version", "4.0;NetFx");
    
                headers.Add("OData-MaxVersion", "4.0;NetFx");
    
                headers.Add("Accept", "application/json;odata.metadata=minimal");
    
                headers.Add("Accept-Charset", "UTF-8");
    
                headers.Add("Authorization", string.Format("Bearer {0}", token));
    
                headers.Add("User-Agent", "Microsoft ADO.NET Data Services");
    
                headers.Add("X-ClientService-ClientTag", "Office 365 API Tools 1.1.0612");
    
                HttpResponseMessage response = await client.GetAsync("https://api.office.com/discovery/me/services");
                
                response.EnsureSuccessStatusCode();
    
                string responseBody = await response.Content.ReadAsStringAsync();    
            }

    Regards,

    Jeffrey


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, November 21, 2014 3:21 AM
    Moderator