none
EWS Managed API started giving 401 unauthorized error RRS feed

  • Question

  • I have developed  office 365 outlook mail application which parses selected email message data (i.e. recipients details, subject, email body & attachments) using EWS API calls and saving these parsed information into our custom database. It is being working fine without any problems but EWS API calls started giving "401 unauthorized" exception since yesterday. I am able to login to my outlook web without any problems and i can access my mail app but i am frequently getting "401 unauthorized" exception when i try to parse email message details since yesterday.

    Can anyone let me what could be the problem here?

    I am using the below code snippet to parse email message information.

    ****************************************************************

    ExchangeService service = new ExchangeService();
    service.Credentials = new OAuthCredentials(CallBackAuthenticationToken);
    service.Url = new Uri(request.EwsUrl);
    service.CookieContainer = new CookieContainer();

    PropertySet propSet = new PropertySet(BasePropertySet.IdOnly, ItemSchema.Subject);
    Item item = Item.Bind(service, request.MessageId);

    ****************************************************************

    Thanks & Regards,

    Niranjan Rao Ch

    Saturday, July 11, 2015 5:52 AM

All replies

  • I have developed  outlook mail application which parses selected email message data (i.e. recipients details, subject, email body & attachments) using EWS API calls and saving these parsed information into our custom database. It is being working fine without any problems but EWS API calls started giving "401 unauthorized" exception since yesterday. I am able to login to my outlook web without any problems and i can access my mail app but i am frequently getting "401 unauthorized" exception when i try to parse email message details since yesterday.

    Can anyone let me what could be the problem here?

    I am using the below code snippet to parse email message information.

    ****************************************************************

    ExchangeService service = new ExchangeService();
    service.Credentials = new OAuthCredentials(CallBackAuthenticationToken);
    service.Url = new Uri(request.EwsUrl);
    service.CookieContainer = new CookieContainer();

    PropertySet propSet = new PropertySet(BasePropertySet.IdOnly, ItemSchema.Subject);
    Item item = Item.Bind(service, request.MessageId);

    ****************************************************************


    Thanks & Regards,

    Niranjan Rao Ch


    • Edited by Niranjan Chalikonda Friday, July 10, 2015 2:57 PM
    • Merged by L.Hl Monday, July 13, 2015 9:13 AM repeat thread
    Friday, July 10, 2015 2:56 PM
  • Hello Niranjan,

    The forum is for Office Apps related questions. I'd suggest asking EWS specific questions on the Exchange Server Development  forum instead.

    Friday, July 10, 2015 4:53 PM
  • Thanks for your reply. I posted this questiong on Exchange server development forum.
    Saturday, July 11, 2015 6:23 AM