AlbumExposure API

Spreads

* All spread operations apply to an album


Get spreads

GET /api/albums/1/spreads

Response
[
  {
    "id": "1"
    "position": 1,
    "image_file_name": "page_01.jpg",
    "image_file_size": 80841,
    "image_updated_at": "2012/03/13 18:22:24 +0000",
    "image_processing": false
    "image_urls": {
      "thumb": "https://d3ej44odz62oqc.cloudfront.net/spreads/1/thumb/L001.jpg?1351632940",
      "web": "https://d3ej44odz62oqc.cloudfront.net/spreads/1/web/L001.jpg?1351632940",
      "large": "https://d3ej44odz62oqc.cloudfront.net/spreads/1/large/L001.jpg?1351632940",
      "fullscreen": "https://d3ej44odz62oqc.cloudfront.net/spreads/1/fullscreen/L001.jpg?1351632940"
    }
  }
]

Get a spread

GET /api/albums/1/spreads/1

Response
Status: 200 OK


Create a spread

POST /api/albums/1/spreads

Request

We recommend you POST key/value pairs as form-data. (Similar to a URI query string.)

Key:   spread[image]
Value: #{Filedata}




Response
Status: 201 Created


Update a spread

PUT /api/albums/1/spreads/1

Request

Update just the position of a spread by passing an integer between 1 and n, where n is the number of spreads in the list.

{
  "position": 1
}

Request

If updating the spread's image, then post key/value pairs as form-data, instead of JSON. (See Create Spread.) A spread[position] key can also be added to update the image and position in the same request.

Key:   spread[image]
Value: #{Filedata}
Key:   spread[position]
Value: 1

Response
Status: 200 OK


Delete a spread

*** IMPORTANT ***: To replace an existing spread, rather than deleting, just create a spread with the same filename, or replace it's image.

DELETE /api/albums/1/spreads/1

Response
Status: 200 OK