Skip to content
Markus Günther edited this page Oct 17, 2015 · 1 revision

Prerequisites

Credentials are CU-zkVDzWSctsEqqk and secret.

List Albums

Request

GET /albums

Header:

Accept: application/json
Authorization: Basic Q1UtemtWRHpXU2N0c0VxcWs6c2VjcmV0

Response

{
  "_meta": {
    "links": {
      "listAlbums": {
        "href": "/albums",
        "method": "GET",
        "media": "application/json"
      },
      "createAlbum": {
        "href": "/albums",
        "method": "POST",
        "media": "application/json"
      }
    }
  },
  "numberOfAlbums": 2,
  "albums": [
    {
      "albumId": "AL-vcdjke39svm292",
      "title": "Jersey 2014",
      "numberOfPhotos": 1,
      "links": {
        "deleteAlbum": {
          "href": "/albums/AL-vcdjke39svm292",
          "method": "DELETE",
          "media": "application/json"
        },
        "viewCover": {
          "href": "/albums/AL-vcdjke39svm292/PH-aBffzee1ddddccF/thumbnail",
          "method": "GET",
          "media": "image/jpeg"
        },
        "listAlbum": {
          "href": "/albums/AL-vcdjke39svm292",
          "method": "GET",
          "media": "application/json"
        }
      }
    },
    {
      "albumId": "AL-zk3Dz0Sct9XccF",
      "title": "Hamburg 2014",
      "numberOfPhotos": 1,
      "links": {
        "deleteAlbum": {
          "href": "/albums/AL-zk3Dz0Sct9XccF",
          "method": "DELETE",
          "media": "application/json"
        },
        "viewCover": {
          "href": "/albums/AL-zk3Dz0Sct9XccF/PH-aB34z0013t9XccF/thumbnail",
          "method": "GET",
          "media": "image/jpeg"
        },
        "listAlbum": {
          "href": "/albums/AL-zk3Dz0Sct9XccF",
          "method": "GET",
          "media": "application/json"
        }
      }
    }
  ]
}

Create Album

Request

POST /albums
{
	"albumName": "Wurstsche Fotos"
}

Response

HTTP/1.1 201 Created
Date: Sat, 10 Oct 2015 11:12:38 GMT
Location: http:https://localhost:8080/albums/AL-tnvATjRAbacmt7
Content-Length: 0

List Album

Request

GET /albums/{albumId}?tags=[value1,value2,...]?offset=0?pageSize=50

Query Parameters:

  • tags: Comma-separated strings, defaults to wildcard
  • offset: non-negative integer, defauls to 0
  • pageSize: non-negative integer, defaults to 10, limit is 100

Response

HTTP/1.1 200 OK
Date: Sat, 10 Oct 2015 13:20:45 GMT
Content-Type: application/json
Content-Encoding: gzip
Vary: Accept-Encoding
Content-Length: 410

{
  "_meta": {
    "links": {
      "listAlbums": {
        "href": "/albums",
        "method": "GET",
        "media": "application/json"
      },
      "uploadPhoto": {
        "href": "/albums/AL-zk3Dz0Sct9XccF",
        "method": "POST",
        "media": "application/json"
      },
      "deleteAlbum": {
        "href": "/albums/AL-zk3Dz0Sct9XccF",
        "method": "DELETE",
        "media": "application/json"
      },
      "listAlbum": {
        "href": "/albums/AL-zk3Dz0Sct9XccF",
        "method": "GET",
        "media": "application/json"
      }
    }
  },
  "title": "Hamburg 2014",
  "numberOfPhotos": 1,
  "numberOfIncludedPhotos": 1,
  "offset": 0,
  "pageSize": 50,
  "tags": [
    
  ],
  "photos": [
    {
      "photoId": "PH-aB34z0013t9XccF",
      "description": "Blick auf den Hamburger Hafen",
      "tags": [
        "hafen"
      ],
      "links": {
        "viewMetadata": {
          "href": "/albums/AL-zk3Dz0Sct9XccF/PH-aB34z0013t9XccF",
          "method": "GET",
          "media": "application/json"
        },
        "viewThumbnail": {
          "href": "/albums/AL-zk3Dz0Sct9XccF/PH-aB34z0013t9XccF/thumbnail",
          "method": "GET",
          "media": "image/jpeg"
        },
        "downloadPhoto": {
          "href": "/albums/AL-zk3Dz0Sct9XccF/PH-aB34z0013t9XccF?download=true",
          "method": "GET",
          "media": "image/jpeg"
        },
        "viewPhoto": {
          "href": "/albums/AL-zk3Dz0Sct9XccF/PH-aB34z0013t9XccF",
          "method": "GET",
          "media": "image/jpeg"
        }
      }
    }
  ]
}

Delete Album

Request

DELETE /albums/{albumId}

Response

HTTP/1.1 204 No Content
Date: Sat, 10 Oct 2015 12:06:26 GMT

Upload Photo

Request

POST /albums/{albumId}
Content-Type: multipart/form-data

HTML5-form-based upload; sets headers and content as appropriate.

Response

HTTP/1.1 201 Created
Date: Sat, 10 Oct 2015 12:09:01 GMT
Location: http:https://localhost:8080/albums/AL-zk3Dz0Sct9XccF/AL-ePCBWcAUpfkTi2
Content-Length: 0

View Original

Request

GET /albums/{albumId}/{photoId}
Accept: image/jpeg

####Response

HTTP/1.1 200 OK
Date: Sat, 10 Oct 2015 12:20:19 GMT
Content-Type: image/jpeg
Content-Length: 12404
<<BINARY DATA>>

Download Original

Request

GET /albums/{albumId}/{photoId}?download=true
Accept: image/jpeg

Response

HTTP/1.1 200 OK
Date: Sat, 10 Oct 2015 12:22:06 GMT
Content-Type: image/jpeg
Content-Disposition: attachment; filename="test.jpg"
Content-Length: 12404

View Photo Metadata

Request

GET /albums/{albumId}/{photoId}
Accept: application/json

Response

{
  "_meta": {
    "links": {
      "updateMetadata": {
        "href": "/albums/AL-zk3Dz0Sct9XccF/PH-tnIViMWp3HuosT",
        "method": "PUT",
        "media": "application/json"
      },
      "viewPhoto": {
        "href": "/albums/AL-zk3Dz0Sct9XccF/PH-tnIViMWp3HuosT",
        "method": "GET",
        "media": "image/jpeg"
      },
      "listAlbum": {
        "href": "/albums/AL-zk3Dz0Sct9XccF",
        "method": "GET",
        "media": "application/json"
      },
      "deletePhoto": {
        "href": "/albums/AL-zk3Dz0Sct9XccF/PH-tnIViMWp3HuosT",
        "method": "GET",
        "media": "application/json"
      }
    }
  },
  "photoId": "PH-tnIViMWp3HuosT",
  "description": "Sch\u00f6nes Bild!",
  "tags": [
    "test"
  ]
}

Update Photo Metadata

Request

PUT /albums/{albumId}/{photoId}
{
	"description": "Schönes Bild!",
	"tags": ["test"]
}

Response

HTTP/1.1 204 No Content
Date: Sat, 10 Oct 2015 13:27:12 GMT

View Thumbnail

Request

GET /albums/{albumId}/{photoId}/thumbnail

Response

HTTP/1.1 200 OK
Date: Sat, 10 Oct 2015 13:29:26 GMT
Content-Type: image/jpeg
Content-Length: 31219

<<BINARY DATA>>

Delete Photo

Request

DELETE /albums/{albumId}/{photoId}
Response
HTTP/1.1 204 No Content