auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, auths) => {
}
if(steps.trigger.event.url.indexOf('favicon.ico') > 0) $end("favicon");
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, auths) => {
}
if(!steps.trigger.event.query.album) $end("Missing album name in query string.");
let result = await require("@pipedreamhq/platform").axios(this, {
url: 'https://photoslibrary.googleapis.com/v1/albums',
headers: {
Authorization: `Bearer ${auths.google_photos.oauth_access_token}`,
},
});
let favorite = result.albums.find(a => {
return a.title.toLowerCase() === steps.trigger.event.query.album.toLocaleLowerCase();
});
if(!favorite) $end("Invalid album name passed.");
return favorite.id;
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, auths) => {
}
let result = await require("@pipedreamhq/platform").axios(this, {
url: 'https://photoslibrary.googleapis.com/v1/mediaItems:search',
headers: {
Authorization: `Bearer ${auths.google_photos.oauth_access_token}`,
},
method:'post',
data: {
albumId:steps.get_album.$return_value,
pageSize:100
}
});
return result.mediaItems.map(m => m.baseUrl);
auths
objectreturn
or this.key = 'value'
, pass input data to your code viaparams
, and maintain state across executions with$checkpoint.async
(event, steps, auths) => {
}
await $respond({
status:200,
headers: {
'Content-Type':'application/json'
},
body:steps.get_photos.$return_value
})