Resource /photos/<id>
This resource represents the attributes of a single Photo object, identified by the "id" URL component.
- Resource URI
- https://api.dive.io/v1/photos/<id> (.xml/.json)
- Supported HTTP methods
- GET (show), POST (update), DELETE, OPTIONS
GET /photos/<id> (show)
Description
Returns the data stored about the photo, identified by <id>.
Authentication
Required. Only photos posted by the authenticated user can be requested
Request structure
The GET URI parameter <id> (lowercase) identifies the photo to be returned.
Response structure
A single Photo object
POST /photos/<id> (update)
- Description
- Updates the data of the photo identified by the parameter "id" with the given information.
- Authentication
- Required
- Request structure
-
- The URI component <id> identifies the photo record to be updated.
- The Photo fields to be updated must be given in a JSON or XML formatted Photo object.
- 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 Photo record, add an empty Tag / Hash element to the update, eg. for remove the "DiveId" field, use:
<DiveId />
- Note that not all fields of a Photo record are updateable - see list below
- Response structure
- Returns the 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:
- Title (Note: maximum length is 60 characters)
- Caption (Note: maximum length is 800 characters)
- DiveId (Note: only Dives of the same user are allowed)
- Privacy (One of "w", "d", "b")