How to Fix Outlook Calendar JSON Parsing Error When Publishing an Iframe
Question details
The user needs to resolve an 'Unexpected end of JSON input' error that occurs when trying to publish and embed an Outlook calendar on a website using an iframe.

- Product
- Microsoft Outlook
- Device & OS
- not provided
- Scenario
- Publishing an Outlook calendar to a webpage via an HTML iframe embed code.
- Observed behavior
- The embedded calendar fails to load, returning the error message 'GetAnonymousCalendarSessionData failed: Unexpected end of JSON input'. Creating a new mailbox or calendar does not resolve the issue.
Ensure you have access to the exact HTML link generated by Outlook on the web and verify that your website platform allows external iframes to be embedded without automatically stripping out parameters.
Verify Calendar URL and Recreate Embed Code
Rule out iframe syntax errors or website script conflicts by testing the raw calendar link and generating clean embed code.
Often, the JSON parsing error is triggered by custom scripts on your website interfering with the iframe, or an improperly formatted embed URL. Testing the link in an isolated environment helps determine if the issue is with the website or Microsoft's servers.
Go to Outlook on the web, navigate to Settings > Calendar > Shared calendars. Under 'Publish a calendar', select your calendar and permissions, then copy the generated HTML link.
Paste the copied HTML link directly into the address bar of a private or incognito browser window. If the calendar loads correctly here, the issue lies with your website's iframe implementation.
Write a clean HTML iframe tag: `<iframe src="YOUR_URL_HERE" width="100%" height="600" frameborder="0"></iframe>`. Do not add any custom JavaScript or redirect scripts to the page hosting this iframe.
Upload a plain HTML file containing only your newly created iframe code to your server. If it works, gradually add back your website's CSS and scripts to identify what is causing the JSON data to break.

Contact Microsoft Support for Server-Side Escaltion
If the error persists even with newly created mailboxes and calendars, it is a service-level issue that requires Microsoft's intervention.
Looking for a Lightweight, Bug-Free Office Suite?
If you are tired of dealing with server-side errors and complex troubleshooting in Microsoft Office services, consider switching to WPS Office. It provides a lightweight, highly compatible, and completely free alternative for your daily document, spreadsheet, and presentation tasks.
- 1. Download and Install: Visit the official WPS website to download the free installer and follow the simple on-screen instructions to set it up on your device.
- 2. Open Your Existing Files: Launch WPS Office and directly open any Microsoft Office files. They will display perfectly with complete formatting compatibility.
- 3. Enjoy Seamless Productivity: Use Writer, Spreadsheets, and Presentation to manage your daily workload in one single, lightweight application window.

Frequently Asked Questions
Why does the 'Unexpected end of JSON input' error happen in Outlook?
This error occurs when the browser receives incomplete or improperly formatted data from the Outlook server. It is often caused by a backend glitch in Microsoft's anonymous calendar publishing service, or interference from custom scripts on the webpage where the iframe is embedded.
Will creating a new Outlook mailbox fix the calendar publishing error?
Not necessarily. If the problem is caused by a tenant-wide server issue or an incompatible website iframe setup, creating a new mailbox or generating a new calendar will often result in the exact same error.
Can I use third-party calendar plugins instead of an iframe?
Yes. If direct HTML publishing via iframe continues to fail, you can use a calendar syncing tool or a third-party website plugin. These tools connect to your Outlook calendar via the Microsoft Graph API, which is typically much more stable than anonymous HTML publishing.




