Share via

Download calendar from public ICS fails ! ?

Peter Bannister 16 Reputation points
2022-06-13T16:01:42.377+00:00

Has anyone else found that the public URL for shared calendars has started to fail from Last Monday?

Does anyone know why this fails?
Gmail - Works
O365 - fails with 400 error (bad request)

using System;  
using System.IO;  
using System.Net;  
  
namespace ICS_Test  
{  
    internal class Program  
    {  
        static void Main(string[] args)  
        {  
            ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;  
  
            string myGmail = "https://calendar.google.com/calendar/ical/smilecrmtesting1%40gmail.com/public/basic.ics";  
            string myOutlookRaw = "https://outlook.office365.com/owa/calendar/******@1stconsulting.com/fa89bfda91684ed28ed3cb6708c6fb1a13982551512168918431/calendar.ics";  
            string fileName = "calendar.ics";  
  
            Uri myUriGmail = new Uri(myGmail);  
            using (var client = new WebClient())  
            {  
                client.DownloadFile(myUriGmail, "C:/Temp/" + fileName);  
            }  
  
            Uri myUriO365 = new Uri(myOutlookRaw);  
            using (var client = new WebClient())  
            {  
                client.DownloadFile(myUriO365, "C:/Temp/" + fileName);  
            }  
  
        }  
    }  
}  
Outlook | Windows | Classic Outlook for Windows | For business
Developer technologies | Visual Basic for Applications
0 comments No comments

4 answers

Sort by: Most helpful
  1. Peter Bannister 16 Reputation points
    2022-06-16T11:32:28.497+00:00

    David,
    ALL SORTED !

    Bottom line was that the following lines needed to be added into the request.

    myHttpWebRequestOutlook.UserAgent = "SmileCRM";
    myHttpWebRequestOutlook.AuthenticationLevel =System.Net.Security.AuthenticationLevel.None;

    This is not how its been for the last 3 years nor could I find any documentation

    If you ask your developer to add this to the request or its equivalent - you should be OK

    What a pain !

    Was this answer helpful?

    1 person found this answer helpful.

  2. David Bushell 1 Reputation point
    2022-06-16T14:09:27.71+00:00

    What is peculiar is that our web developers have not implemented the change, yet today strangely it is working!

    Seems whatever the issue might have been has been fixed at Microsoft's end.

    Was this answer helpful?


  3. David Bushell 1 Reputation point
    2022-06-14T15:54:48.817+00:00

    @Peter Bannister thanks to your other thread and post at Stack Exchange we've fixed our regular published 'user' type calendar, but still having the same error 400 with 'room' type calendars.

    Something must've changed in Office 365 on 7th June as thats the last time it worked successfully for us.

    I see there's a calendar issue in Office 365 Health which appeared yesterday - I wonder if that has anything to do with the underlying issue?

    Was this answer helpful?


  4. ChristyZhang-MSFT 26,226 Reputation points Microsoft External Staff
    2022-06-14T02:00:02.637+00:00

    Hi @Peter Bannister ,

    Welcome to our forum!

    Based on my test on the ICS file link obtained in the following figure, other users can download the ICS file from this link of O365 account successfully.
    211044-7.png

    To check if the issue is related to the link itself, it's suggested that you could send the link to other user to check if they can open the link successfully.

    If all users cannot open it, please contact the owner of the shared calendar and recreate a link for you to check if there're any differences.

    If the issue only occurs in your computer, please try to clean the browser cache and try again. Or it's also suggested that you could switch to other browser to check if the issue still exists.

    In addition, considering the impact of some third-party programs on your computer, please try to perform a clean boot for windows and check if the issue still occur.


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


    Was this answer helpful?


Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.