saveAlbum()

Pixelsilk API function to save an album by adding a new one or updating an existing one--requires the access-libraries permission
Parameters:
type: the type of the album
albumName: the name of the album

Output:
The function saveAlbum returns an object containing the album's id, the album's name, and the album's type

C# Example:
string type = "albumType";
string albumName = "albumName";
object albumObject = SaveAlbum(type, albumName);
Note the capital first letter of the C# method.

HTTP Example:
Request Headers:
POST /api2/saveAlbum HTTP/1.1
HOST: www.example.com
Content-Length: 134
Content-Type: application/x-www-form-urlencoded
Cookie: auth=A7BB95E91049...F6D35A0966F0

Request Data:
Unencoded Data:
json={
   "type":"binary",
   "albumName":"FileAlbum2"
}&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=F80134061410...247BBC4FFFF; path=/
Content-Type: text/javascript; charset=UTF-8
Content-Length: 81

Response Data:
{"id":"4a352167-c98a-46ea-ab24-162e3250d323", "name":"FileAlbum2","type":"binary"}

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

Input Object:
{
    type:"binary",
    albumName:"FileAlbum3"
}

Returned Data:
{
    "id":"86173d3d-0698-477b-aba4-14d885bea895",
    "name":"FileAlbum3",
    "type":"binary"
}

Back to Files »