This resource reflects the list of all dive log entries posted by the authenticated user. This resource supports listing and adding dives, depending on the HTTP method used.
{"Dives": [ { "Id":"56", "DiveDate":"2010-09-18", "InTime":"14:33:00", "Duration":"00:40:30", "MaxDepth":"33", "DiverId":"4", "DiveNumber":29 }, { "Id":"42", "DiveDate":"2010-09-16", "InTime":"10:28:00", "Duration":"00:39:50", "MaxDepth":"20.7", "DiverId":"4", "DiveNumber":28 } ], "Status": "200 OK" }
<?xml version="1.0" encoding="UTF-8"?> <DiveIo> <Dives> <Dive> <Id>42</Id> <DiveDate>2010-09-16</DiveDate> <InTime>10:28:00</InTime> <Duration>00:39:50</Duration> <MaxDepth>20.7</MaxDepth> <DiverId>4</DiverId> <DiveNumber>29</DiveNumber> </Dive> <Dive> <Id>56</Id> <DiveDate>2010-09-18</DiveDate> <InTime>14:33:00</InTime> <Duration>00:40:30</Duration> <MaxDepth>33</MaxDepth> <DiverId>4</DiverId> <DiveNumber>29</DiveNumber> </Dive> </Dives> <Status>200 OK</Status> </DiveIo>
The following example shows the minimum contents of a file to be uploaded (for two dives). Only the minimum set of required fields is included in the example (and neither Samples nor Buddies) - a description of all available fields is contained in the Dive object description
<?xml version="1.0" encoding="UTF-8"?> <DiveIo> <Dives> <Dive> <DiveDate>2010-08-10</DiveDate> <InTime>11:14:00</InTime> <Duration>00:28:10</Duration> <MaxDepth>14.4</MaxDepth> </Dive> <Dive> <DiveDate>2010-09-18</DiveDate> <InTime>14:33:00</InTime> <Duration>00:40:30</Duration> <MaxDepth>33</MaxDepth> </Dive> </Dives> </DiveIo>
The following response to the request above shows that one dive (with Id "289") has been added to the diving log ("DivesAdded" list), while the second one has been skipped (duplicate of already existing dive) - ("DivesSkipped" list):
<?xml version="1.0" encoding="UTF-8"?> <DiveIo> <DivesAdded> <Dive> <Id>289</Id> <DiveDate>2010-08-10</DiveDate> <InTime>11:14:00</InTime> <Duration>00:28:10</Duration> <MaxDepth>14.4</MaxDepth> <DiverId>4</DiverId> <DiveNumber>17</DiveNumber> </Dive> </DivesAdded> <DivesSkipped> <Dive> <DiveDate>2010-09-18</DiveDate> <InTime>14:33:00</InTime> <Duration>00:40:30</Duration> <MaxDepth>33</MaxDepth> <DiverId>4</DiverId> </Dive> </DivesSkipped> <Status>200 OK</Status> </DiveIo>
For clients that (still) do not support the PUT HTTP method, the server also supports creating new dive log entries via the POST method as "multipart/form-data" ("File upload" POST method).