title: iCloud Calendar Requests
body: <p>I'm trying to access the my iCloud calendars through <code>curl</code> (using this as a test before I write any code), but am getting <em>unauthorised access</em> errors. Has anyone had any luck in getting this to work? I've used <a href="http://ict4g.net/adolfo/notes/2015/07/04/determing-url-of-caldav.html" rel="nofollow noreferrer">this</a> to extract my <em>user ID</em> and have determined by server ID by emailing myself an event invite.</p>
  
  <p>Command run</p>
  
  <pre><code>curl -u &lt;apple email ID&gt; https://&lt;server id&gt;-caldav.icloud.com/&lt;user id&gt;/calendars
  </code></pre>
  
  <p>Response</p>
  
  <pre><code>&lt;html&gt;&lt;head&gt;&lt;title&gt;Unauthorized&lt;/title&gt;&lt;/head&gt;&lt;body&gt;&lt;h1&gt;Unauthorized&lt;/h1&gt;&lt;p&gt;You are not authorized to access this resource.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;
  </code></pre>
  
  <p><em>Edit</em></p>
  
  <p>I've tried to replicate <a href="https://stackoverflow.com/questions/38413296/icloud-calendar-getting-unauthorized-error-from-caldav-server?rq=1">this</a> query using fiddler but keep getting a 502 response - connection failed with <code>SecurityException</code>.</p>