getAlbums()

Pixelsilk API function to get the list of albums of a certain type for a site--requires the access-libraries permission
Parameters:
type: the type of the album

Output:
The function getAlbums returns a list of albums of a certain type for the site

C# Example:
string type = "albumType";
IEnumerable<object> files = GetAlbums(type);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/getAlbums HTTP/1.1
HOST: www.example.com
Content-Length: 87
Content-Type: application/x-www-form-urlencoded
Cookie: auth=9E772B18F08A...F1DB36DD3C5E

Request Data:
Unencoded Data:
json={
   "type":"image"
}&token=7AdbNHZQBtwc...RPTEK8UvSUQ=

Url-encoded Data:
json=%7b%0d%0a+++...%22%0d%0a%7d&token=7AdbNHZQBtwc...TEK8UvSUQ%3d

Response Headers:
HTTP/1.1 200 OK
Set-Cookie: auth=D29450F3491D...A862B478C34; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 320

Response Data:
[{"id":"0bf6e5e4-51d8-44c1-963c-876cb9b79480", "name":"ImageAlbum1","type":"image"},
{"id":"35e8d3cc-815b-44d8-9f18-a3b9320baff8", "name":"ImageAlbum2","type":"image"}]

JavaScript Example:
Method Call:
pixelsilk2.getAlbums(input, callback)

Input Object:
{
    type:"image"
}

Returned Data:
[
    {
        "id":"3f0d84a0-d35a-4122-ac36-e33fec144289",
        "name":"exampletest",
        "type":"image"
    },
    {
        "id":"0bf6e5e4-51d8-44c1-963c-876cb9b79480",
        "name":"ImageAlbum1",
        "type":"image"
    },
    {
        "id":"35e8d3cc-815b-44d8-9f18-a3b9320baff8",
        "name":"ImageAlbum2",
        "type":"image"
    }
]

Back to Files »