0
URL -: https://pxx-caldav.icloud.com/token/calendars/calendarId

@"<C:calendar-query xmlns:D='DAV:'
                 xmlns:C='urn:ietf:params:xml:ns:caldav'>
                                     <D:prop>
                                       <D:getetag/>
                                <C:calendar-timezone xmlns:D='DAV:' xmlns:C='urn:ietf:params:xml:ns:caldav'></C:calendar-timezone>
                                       <C:calendar-data>
                                        <C:expand start='{0}'
                                                end='{1}'/>
                                         <C:comp name='VCALENDAR'>
                                           <C:prop name='VERSION'/>
                                           <C:comp name='VEVENT'>
                                             <C:prop name='SUMMARY'/>
                                             <C:prop name='DESCRIPTION'/>
                                             <C:prop name='STATUS'/>
                                              <C:prop name='TRANSP'/>
                                               <C:prop name='ATTENDEE'/>
                                             <C:prop name='UID'/>
                                             <C:prop name='DTSTART'/>
                                             <C:prop name='DTEND'/>
                                             <C:prop name='DURATION'/>
                                             <C:prop name='RRULE'/>
                                             <C:prop name='RDATE'/>
                                             <C:prop name='EXRULE'/>
                                             <C:prop name='EXDATE'/>
                                             <C:prop name='RECURRENCE-ID'/>
                                           </C:comp>
                                         </C:comp>
                                       </C:calendar-data>
                                     </D:prop>
                                     <C:filter>
       <C:comp-filter name='VCALENDAR'>
         <C:comp-filter name='VEVENT'>
           <C:time-range start='{0}'
                         end='{1}'/>
         </C:comp-filter>
       </C:comp-filter>
     </C:filter>
                                   </C:calendar-query>"

while retrieving events it gives forbidden error on some particular calendars of some accounts. While retrieving calendars it shows read/write access but while fetching events it gives error. It gives error on few calendars but error is continuous on them. I am getting following error -:

 <error> <supported-report /> </error>
Priyank Kotiyal
  • 241
  • 2
  • 13

1 Answers1

0

Calendars are WebDAV collections with a DAV:resourcetype of C:calendar (see https://www.rfc-editor.org/rfc/rfc4791#section-4.2 ) but there are other types of collections (calendar home, scheduling inbox, dropbox, etc...).

What is most likely happening is that you are issuing a calendar query against a collection which is not a calendar collection, hence the supported-report error.

You need to retrieve the DAV:resourcetype property of each collection and, only if it is a calendar, issue the above report.

Community
  • 1
  • 1
Arnaud Quillaud
  • 4,420
  • 1
  • 12
  • 8
  • Thanks but I am issuing calendar query for calendars only. One more thing on some calendars it works on retry but on some it never works. – Priyank Kotiyal Nov 03 '17 at 12:31
  • Show the list properties of the calendars you target (the result of the propfind:1 on the calendar homiest). Are you maybe targeting non-caldav calendars but subscribed calendars? – hnh Nov 03 '17 at 20:16
  • By subscribed calendars, did you mean shared calendars? What is non caldav calendar? – Priyank Kotiyal Nov 06 '17 at 05:27
  • For fetching user's calendars, I am using -: "" I can't share response XML in comment as its too long. Can you share your email id? – Priyank Kotiyal Nov 06 '17 at 06:19
  • Thanks. I just want to inform that issue is automatically fixed. I haven't did any changes to my code but server is not giving any error now. Is server gives this continuous error spontaneously? What are the reason for server to give any error? Is there some limit to number of hits to icloud's caldav server. Not sure when I am going to face this issue again in future. Sometimes servers give unauthorized error but some times it works on retry and sometimes not. Is it possible for to give error without any reason? – Priyank Kotiyal Nov 08 '17 at 11:29