Q:

iCalendar subscription not working

I seem to be having issues making iCalendar subscriptions work. My url looks something like https://somehost.com/calendar/list_events?calendar_id=500, and when visiting this URL in the browser I'm able to download the .ics file which imports properly into a few calendar applications. My problem is that attempting to subscribe to this same URL, I'm never able to import the events.
Here is what my PHP headers are set to:
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: attachment; filename=calendar.ics');

And here is a sample of the attachment (but as I already mentioned, saving the file locally and then importing it works just fine):
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//AUTHOR//COMPANY//NONSGML 1.0//EN
CALSCALE:GREGORIAN
METHOD:PUBLISH
BEGIN:VEVENT
SUMMARY:A new event
DESCRIPTION:
DTSTAMP:20140508T162355Z
DTSTART:20140512T162355Z
DTEND:20140512T162355Z
END:VEVENT
END:VCALENDAR

I can only assume that I'm missing a piece of information, can anybody point out where I've gone wrong?

A:

The UID property is required.
Check our https://sabre.io/vobject for a iCalendar parser and generator. There's also a command-line utility that validates iCalendar objects for you.
(note: shameless self-promotion).

