Methods
createAlbum(accessToken, albumData, callback) → {Promise}
Create an albums
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
accessToken |
string
|
See Picasa#getTokens
|
|||||||||
albumData |
object
|
Can be empty object
|
|||||||||
callback |
function
|
(error, response). If not provided, a promise will be returned |
Returns:
- Type:
-
Promise
deletePhoto(accessToken, albumId, photoId, callback) → {Promise}
Delete Photo
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
Parameters:
Name | Type | Description | ||||||
---|---|---|---|---|---|---|---|---|
accessToken |
string
|
See Picasa#getTokens
|
||||||
options |
object
|
Can be empty object
|
||||||
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
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
config |
object
|
Get config here: https://console.developers.google.com/home/dashboard (API Manager > Credentials)
|
|||||||||
callback |
function
|
(error, response). If not provided, a promise will be returned |
Returns:
- Type:
-
Promise
getPhotos(accessToken, options, callback) → {Promise}
Get Photos
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
accessToken |
string
|
See Picasa#getTokens
|
|||||||||
options |
object
|
Can be empty object
|
|||||||||
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
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
object
|
Get config here: https://console.developers.google.com/home/dashboard (API Manager > Credentials)
|
||||||||||||
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
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
accessToken |
string
|
See Picasa#getTokens
|
|||||||||||||||
albumId |
string
|
||||||||||||||||
photoData |
object
|
Photo's propperties
|
|||||||||||||||
callback |
function
|
(error, response). If not provided, a promise will be returned |
Returns:
- Type:
-
Promise
renewAccessToken(config, refreshToken, callback) → {Promise}
Renews access token
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
config |
object
|
Get config here: https://console.developers.google.com/home/dashboard (API Manager > Credentials)
|
||||||||||||
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