SmugMug

Online photo application

Go to site

Integrate the SmugMug API with the MongoDB API

Setup the SmugMug API trigger to run a workflow which integrates with the MongoDB API. Pipedream's integration platform allows you to integrate SmugMug and MongoDB remarkably fast. Free for developers.

Insert a document into a collection
 
Try it
Create Album

Creates an album.

 
Try it
Create Smugmug Album

This action creates an album in a folder. Specify the folder and the JSON document (as a Javascript object) in parameters. A minimal object might look like { UrlName: "weddings-smith-2020-06-02", Name: "Mr & Mrs Smith's June Wedding", Privacy: 2, SecurityType: 1 } More fields documented at https://api.smugmug.com/api/v2/folder

 
Try it
Get Album

Gets an album given its id.

 
Try it
Get Authenticated User

Gets details of the authenticated user.

 
Try it

Connect SmugMug

return await require("@pipedreamhq/platform").axios(this, {
  url: `https://api.smugmug.com/api/v2!authuser`,
  headers: {
    "Accept": `application/json`,
  },
}, {
  token: {
    key: auths.smugmug.oauth_access_token,
    secret: auths.smugmug.oauth_refresh_token,
  },
  oauthSignerUri: auths.smugmug.oauth_signer_uri,
})

Connect MongoDB

const MongoClient = require('mongodb').MongoClient

const {
  database,
  hostname,
  username,
  password,
} = auths.mongodb

const url = `mongodb+srv://${username}:${password}@${hostname}/test?retryWrites=true&w=majority`
const client = await MongoClient.connect(url, { 
  useNewUrlParser: true, 
  useUnifiedTopology: true 
})

const db = client.db(database)
// Enter your target collection as a parameter to this step
this.res = await db.collection(params.collection).insertOne({ name: "Luke Skywalker" })

await client.close()