Last active
December 17, 2015 10:18
-
-
Save andreareginato/5593328 to your computer and use it in GitHub Desktop.
node .test.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* * * * * * * * * * * * * * * * * * * | |
| * Example file to live test the API * | |
| * * | |
| * > node .test.js * | |
| * * | |
| * * * * * * * * * * * * * * * * * * */ | |
| /* | |
| * Set a valid access token | |
| */ | |
| access_token = '9056d24aa19424de7e8e9440aabfe3acd824b1bcb46778ace3b21279bb7dff5f'; | |
| /* | |
| * General config | |
| */ | |
| access = { | |
| 'access_token': access_token, | |
| 'refresh_token': 'refresh_token', | |
| 'token_type': 'bearer', | |
| 'expires_in': null | |
| }; | |
| var credentials = { | |
| clientID: 'e0ce688bfa4e930c047152ba9407152c42a4808e3687e1cc254cafef705bc799', | |
| clientSecret: '9398aa2c90c624c72ae90d32245f69f0361cac3e80c3ca56e5285a34c8df403b', | |
| site: 'http://people.lelylan.com' | |
| }; | |
| var callback = function(error, response) { | |
| if (error) console.log('Lelylan Error', error.message); | |
| console.log(response); | |
| }; | |
| /* | |
| * Request with OAuth2 access token | |
| */ | |
| //var OAuth2 = require('simple-oauth2')(credentials); | |
| //var token = OAuth2.AccessToken.create(access); | |
| //var Lelylan = require('./lib/lelylan-node.js')({ token: token }); | |
| //Lelylan.Category.all({}, callback); | |
| /* | |
| * Request without authorization | |
| */ | |
| //var Lelylan = require('./lib/lelylan-node.js')(); | |
| //var uri = 'http://requestb.in/1kkw2h91'; | |
| //var secret = 'secret-buba'; | |
| //var params = { 'properties': [{ 'id': '<status>', 'value': 'on' }] }; | |
| //Lelylan.Physical.properties(uri, secret, params, callback); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment