API client for Chute platform.
Chute makes it possible for you to easily organize, store and serve photos and videos. This NPM package provides you with a wrapper for the Chute API. You can learn more about Chute http://getchute.com and explore the API at http://picture.io.
npm install chute
var Chute = require'chute';var client = ;clientsettoken: 'access token'id: 'app id';
Chutes allow you to manage sets of photos - you can think of them like albums.
// all chutes foundclientchutesallforvar i = 0; i < chuteslength; i++chuteid;;// chute with ID=12345 foundclientchutesfind id: 12345chuteid;;// chute with ID=12345 found with contributors list insideclientchutesfind id: 12345 contributors: truechutecontributors;;// chute with ID=12345 found with members list insideclientchutesfind id: 12345 members: truechutemembers;;// chute with ID=12345 found with parcels list insideclientchutesfind id: 12345 parcels: truechuteparcels;;// chute with ID=12345 found with everything insideclientchutesfindid: 12345contributors: truemembers: trueparcels: truechuteid;;
// chute createdclientchutescreate name: 'Testing'chuteid;;
// chute with ID=235345 changed name to 'New name'clientchutesupdate id: 235345 name: 'New name'chuteid;;
// chute with ID=12345 removedclientchutesremove id: 12345;
Assets represent photos and videos contained within a Chute.
// asset with ID=12345 foundclientassetsfind id: 12345assetid;;// asset with ID=12345 found with comments insideclientassetsfind id: 12345 comments: trueassetcomments;;
clientassetsfind id: 12345asseturl //asseturlwidth640 //asseturlheight480 //asseturlfill640 480 //asseturlfit640 480 //;
clientassetsheart id: 12345// +1 to asset with ID=12345;clientassetsunheart id: 12345// -1 to asset with ID=12345;
clientassetsremove id: 12345// asset with ID=12345 removed;
Bundles allow you to create dynamic sets of photos
// bundle with ID=12345clientbundlesfind id: 12345bundleid;;
clientbundlescreateids: 134234 534125// bundle with assets 134234 and 534125 created;
clientbundlesremove id: 12345// bundle with ID=12345 removed;
Chute provides a simple upload flow that provides image processing and more.
// info about filesvar files = filename: 'image.jpg' size: 124235 md5: '0cc175b9c0f1b6a831c399e269772661' ;// ID of chute which you want upload image tovar chutes = 12423523;clientuploadsupload files: files chutes: chutes// assets is an array of asset IDs, which were just uploaded;
Put your app credentials(access token and id) into test and run it with:
mocha --timeout 10000
© Chute Corporation.