Created
July 10, 2012 08:11
-
-
Save auchenberg/3081969 to your computer and use it in GitHub Desktop.
Podio.js search example
This file contains 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
// Initialize and specify client id and secret | |
var Podio = require('podiojs'); | |
var podio = new Podio(); | |
podio.client.client_id = 'sample'; | |
podio.client.client_secret = 'gCb4aq1RAWvPgHqxTwiDtvNGa59S7i5FvGHFZeq4rnr9YUxHVqwdpz91SJlwsppH'; | |
podio.on('error', function(request, response, body) { | |
console.log('There was a problem with a request to ' + request.path+'. Error was "'+body.error_description+'" ('+body.error+')'); | |
}); | |
podio.on('rateLimitError', function(request, response, body) { | |
console.log('You hit the rate limit'); | |
}); | |
podio.authenticate('password', {'username': 'USERNAME', 'password': 'PASSWORD'}, function(response, body){ | |
podio.post('/search/', { 'query' : '70-cd-60-f8-41-a2 ' }, function(response, body){ | |
console.log(body); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment