-
Notifications
You must be signed in to change notification settings - Fork 3
HTTP API
Markus Günther edited this page Oct 17, 2015
·
1 revision
Credentials are CU-zkVDzWSctsEqqk
and secret
.
GET /albums
Header:
Accept: application/json
Authorization: Basic Q1UtemtWRHpXU2N0c0VxcWs6c2VjcmV0
{
"_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"
}
}
}
]
}
POST /albums
{
"albumName": "Wurstsche Fotos"
}
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
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
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 /albums/{albumId}
HTTP/1.1 204 No Content
Date: Sat, 10 Oct 2015 12:06:26 GMT
POST /albums/{albumId}
Content-Type: multipart/form-data
HTML5-form-based upload; sets headers and content as appropriate.
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
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>>
GET /albums/{albumId}/{photoId}?download=true
Accept: image/jpeg
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
GET /albums/{albumId}/{photoId}
Accept: application/json
{
"_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"
]
}
PUT /albums/{albumId}/{photoId}
{
"description": "Schönes Bild!",
"tags": ["test"]
}
HTTP/1.1 204 No Content
Date: Sat, 10 Oct 2015 13:27:12 GMT
GET /albums/{albumId}/{photoId}/thumbnail
HTTP/1.1 200 OK
Date: Sat, 10 Oct 2015 13:29:26 GMT
Content-Type: image/jpeg
Content-Length: 31219
<<BINARY DATA>>
DELETE /albums/{albumId}/{photoId}
HTTP/1.1 204 No Content