0
<d:propfind xmlns:d='DAV:' xmlns:cs='{0}' xmlns:c='urn:ietf:params:xml:ns:caldav'>
                                              <d:prop>
                                                 <d:resourcetype />
                                                 <d:displayname />
                                                 <cs:getctag />
                                                 <c:supported-calendar-component-set />
                                                 <d:current-user-privilege-set/>
                                                <d:calendar-access />
                                                <c:schedule-default-calendar-URL />
                                              </d:prop>
                                        </d:propfind>

Above is my request to fetch all calendars. How to distinguish between default calendar and other calendars after reading response. For every calendar following is common in response-:

<propstat><prop><calendar-access /><schedule-default-calendar-URL xmlns="urn:ietf:params:xml:ns:caldav" /></prop><status>HTTP/1.1 404 Not Found</status></propstat>
rianjs
  • 7,767
  • 5
  • 24
  • 40
Priyank Kotiyal
  • 241
  • 2
  • 13

1 Answers1

1

According to RFC6638 4.3 you should get a value for the

schedule-default-calendar-URL

property on the Inbox collection. And, well, that is the default calendar ;-)

Community
  • 1
  • 1
hnh
  • 13,957
  • 6
  • 30
  • 40
  • Yes, but I am not getting it for any calendar. – Priyank Kotiyal Jul 17 '17 at 04:12
  • Following is what I am getting for every calendar -: HTTP/1.1 404 Not Found – Priyank Kotiyal Jul 17 '17 at 04:13
  • Am I missing something? Above posted question is my sample request. Thanks! – Priyank Kotiyal Jul 17 '17 at 04:16
  • Well, your request has `xmlns:cs='{0}'`, which is not what you want. Wrt the URL property, this is not defined on calendars, it is defined on the Inbox collection. So it is perfectly normal that you get a property-404 on calendars. Maybe show us the full response you are receiving from the server (add that to your question). – hnh Jul 17 '17 at 11:10
  • I forget to mention that I replace {0} to "http://calendarserver.org/ns/" in code using string.Format(). Its a typo mistake. – Priyank Kotiyal Jul 18 '17 at 07:48
  • There is strange situation for some calendar account I am getting href inside tag 'schedule-default-calendar-URL' but for some calendar account I am not getting href for any calendar inside 'schedule-default-calendar-URL'. – Priyank Kotiyal Aug 02 '17 at 12:29