°C/bar/m change

dive.io in Deutsch

Resource /dives/<id>

This resource represents a single dive log entry stored on the dive.io server. The dive log entry is identified by the "Id" attribute. Note that "DiveNumber" and "Id" are different things - "Id" is used to identify a dive record on the server, while "DiveNumber" is the (optional) number assigned to the dive in the logbook.

The Dive object returned may also include Buddy and profile information (Samples)

Resource URI
https://api.dive.io/v1/dives/<id> (.xml/.json)
Supported HTTP methods
GET (show), POST (update), DELETE, OPTIONS

GET /dives/<id> (show)

Returns the data stored about a single dive log entry, identified by <id>.
Required. Only dives by the authenticated user can be requested
Request structure
The GET URI parameter <id> (lowercase) identifies the dive record to be returned. Do use the "Id" attribute, and not the "DiveNumber" attribute for this parameter.
Response structure
A single Dive object (full format)

Example response (XML)

<?xml version="1.0" encoding="UTF-8"?>
    <Location>Okrug Gornji</Location>
    <Notes>What a lovely dive!</Notes>
    <Created>2011-03-17 11:00:11.27922+01</Created>
    <Modified>2011-04-20 11:46:32.162026+02</Modified>
      <!-- ... (more samples) -->
  <Status>200 OK</Status>

POST /dives/<id> (update)

Replaces the dive record identified by the parameter "id" with the given information.
Request structure
  • The URI component <id> identifies the dive record to be updated.
  • The dive fields to be updated must be given in a JSON or XML formatted Dive object. (like in the example above)
  • If XML format is used, the data must be given in a POST parameter named "xml". If JSON is used, data is to be given in the "json" POST parameter.
  • Fields that are contained in the given data are changed (if possible), fields that are not given are not modified.
  • To remove a field from a Dive record, add an empty Tag / Hash element to the update, eg. for remove the "SurfaceTemp" field, use:
        <SurfaceTemp />
  • Note that not all fields of a Dive record are updateable - see list below
Response structure
Returns the updated full Dive object, as well as a list of updated and ignored attributes.

List of Updateable fields

The following fields can be updated - other fields given in the POST data will be ignored: