Picasa

Picasa

Main class

Constructor

new Picasa()

Creates an instance of Picasa.
Source:

Methods

createAlbum(accessToken, albumData, callback) → {Promise}

Create an albums
Source:
Parameters:
Name Type Description
accessToken string See Picasa#getTokens
albumData object Can be empty object
Name Type Description
title string
summary string
callback function (error, response). If not provided, a promise will be returned
Returns:
Type:
Promise

deletePhoto(accessToken, albumId, photoId, callback) → {Promise}

Delete Photo
Source:
Parameters:
Name Type Description
accessToken string See Picasa#getTokens
albumId string
photoId string
callback function (error, response). If not provided, a promise will be returned
Returns:
Type:
Promise

getAlbums(accessToken, options, callback) → {Promise}

Get all Albums
Source:
Parameters:
Name Type Description
accessToken string See Picasa#getTokens
options object Can be empty object
Name Type Description
TODO integer TODO
callback function (error, response). If not provided, a promise will be returned
Returns:
Type:
Promise

getAuthURL(config, callback) → {Promise}

Get Auth URL. Redirect user to this URL to get code. The code will be used later for Picasa#getTokens
Source:
Parameters:
Name Type Description
config object Get config here: https://console.developers.google.com/home/dashboard (API Manager > Credentials)
Name Type Description
clientId string
redirectURI string URL to user will be redirected. After google displays a consent screen to the user, user will be redirect to this URL with a `code` in the URL
callback function (error, response). If not provided, a promise will be returned
Returns:
Type:
Promise

getPhotos(accessToken, options, callback) → {Promise}

Get Photos
Source:
Parameters:
Name Type Description
accessToken string See Picasa#getTokens
options object Can be empty object
Name Type Description
maxResults integer By default get all photos
albumId string By default all photos are selected
callback function (error, response). If not provided, a promise will be returned
Returns:
Type:
Promise

getTokens(config, code, callback) → {Promise}

Get access token and refresh token
Source:
Parameters:
Name Type Description
config object Get config here: https://console.developers.google.com/home/dashboard (API Manager > Credentials)
Name Type Description
clientId string
redirectURI string URL that user was redirected. After google displays a consent screen to the user, user will be redirect to this URL with a `code` in the URL
clientSecret string
code string Get code from URL param, when user is redirected from authURL. See Picasa#getAuthURL
callback function (error, response{accessToken, refreshToken}). If not provided, a promise will be returned
Returns:
Type:
Promise
- Object{accessToken, refreshToken}

postPhoto(accessToken, albumId, photoData, callback) → {Promise}

Create Photos
Source:
Parameters:
Name Type Description
accessToken string See Picasa#getTokens
albumId string
photoData object Photo's propperties
Name Type Description
title string
summary string
contentType string image/bmp, image/gif, image/png
binary blob Blob binary
callback function (error, response). If not provided, a promise will be returned
Returns:
Type:
Promise

renewAccessToken(config, refreshToken, callback) → {Promise}

Renews access token
Source:
Parameters:
Name Type Description
config object Get config here: https://console.developers.google.com/home/dashboard (API Manager > Credentials)
Name Type Description
clientId string
redirectURI string URL that user was redirected. After google displays a consent screen to the user, user will be redirect to this URL with a `code` in the URL
clientSecret string
refreshToken string The refreshToken is retrived after getTokens is executed. See Picasa#getTokens
callback function (error, response). If not provided, a promise will be returned
Returns:
Type:
Promise