Album object

The Album object contains info about a user's albums in Microsoft OneDrive. Albums are stored at the root level of a user's OneDrive directory, and can contain combinations of photos, videos, audio, files, and folders.

The Live SDK REST API supports reading Album objects.

Use the wl.photos scope to read a user's Album objects. Use the wl.skydrive scope to read a user's files. Use the wl.contacts_photos scope to read any albums, photos, videos, and audio that other users have shared with the user.

Valid object paths

  • /me/albums

  • /USER_ID/albums

  • /ALBUM_ID

An Album object can be returned as part of /ALBUM_ID/files, /me/skydrive/files, /me/skydrive/shared/files, /me/skydrive/shared/albums, or /USER_ID/skydrive/files.

Structures

The Album object contains the following structures.

Structure

Type

R/W

Description

data

array

R

An array container for Album objects when a collection of objects is returned.

id

string

R

The Album object's ID.

from

object

R

Info about the user who authored the album.

name (from object)

string

R

The name of the user who authored the album.

id (from object)

string

R

The ID of the user who authored the album.

name

string

RW

The name of the album. This structure is required when creating the object.

description

string/null

RW

A description of the album, or null if no description is specified.

parent_id

string

R

The resource ID of the parent.

upload_location

string

R

The URL to upload items to the album, hosted in OneDrive. Requires the wl.skydrive scope.

is_embeddable

true/false

R

A value that indicates whether this album can be embedded. If this album can be embedded, this value is true; otherwise, it is false.

count

number

R

The total number of items in the album.

link

string

R

A URL of the album, hosted in OneDrive.

type

string

R

The type of object; in this case, "album".

shared_with

object

R

The object that contains permissions info for the album. Requires the wl.skydrive scope.

access (shared_with object)

string

R

Info about who can access the album. The options are: People I selected, Just me, Everyone (public), Friends, My friends and their friends, and People with a link. The default is Just me.

created_time

string

R

The time, in ISO 8601 format, at which the album was created.

updated_time

string

R

The time, in ISO 8601 format, that the system updated the album last.

client_updated_time

string

R

The time, in ISO 8601 format, that the file was last updated.

Examples

The following is an example of a collection of Album object. (For brevity, only the first object is shown.)

{
   "data": [
      {
         "id": "album.8c8ce076ca27823f.8C8CE076CA27823F!126",
         "from": {
            "name": "Roberto Tamburello",
            "id": "8c8ce076ca27823f"
         },
         "name": "My Sample Album 1", 
         "description": "",
         "parent_id": "folder.de57f4126ed7e411",
         "upload_location": "https://apis.live.net/v5.0/folder.de57f4126ed7e411.DE57F4126ED7E411!126/files/",
         "is_embeddable": true
         "count": 4, 
         "link": "https://cid-8c8ce076ca27823f.skydrive.live.com/redir.aspx?page\u003dself\u0026resid\u003d8C8CE076CA27823F!126\u0026type\u003d5", 
         "type": "album",
         "shared_with": {
            "access": "Everyone (public)"
         },
         "created_time": "2011-04-21T23:19:47+0000", 
         "updated_time": "2011-04-22T19:18:12+0000"
      }, {
         ...
      }
   ]
}

To get a collection of Album objects by using the Live SDK REST API, make a GET request to /me/albums.

Note

To get an album's cover image, call /ALBUM_ID/picture.

To create a new Album resource, make a POST request to /me/albums. Pass the name and description attributes in the request body, as shown here.

{
   "name": "Vacation 2011",
   "description": "Photos from our fun vacation."
}

To delete an album, make a DELETE request to /ALBUM_ID.

To update the properties of an Album, make a PUT request to /ALBUM_ID. Pass the attributes to update in the request body, as shown here.

{
   "name": "Maui Vacation 2011",
   "description": "Photos from our vacation on Maui."
}

See also

REST objects