Last active
August 29, 2015 14:24
-
-
Save connor11528/75c2e105359bb229dd82 to your computer and use it in GitHub Desktop.
Attempting to get information about Kelly Clarkson from the BandPage API
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
// Bandpage API | |
var BANDPAGE_APP_ID = '4945-------953728'; | |
var BANDPAGE_API_KEY = '5ae045d8e3-------92177c69'; | |
var BANDPAGE_API_SECRET = '055837ad8400---------058e7d1e3'; | |
var BANDPAGE_BASE = 'https://api-read.bandpage.com/'; | |
var request = require('request'); | |
var kelly_clarkson_bid = '12334995322703872'; | |
// get bandpage token | |
request({ | |
url: BANDPAGE_BASE + 'token', | |
'auth':{ | |
'user': BANDPAGE_API_KEY, | |
'pass': BANDPAGE_API_SECRET | |
}, | |
qs: { | |
client_id: BANDPAGE_API_KEY, | |
grant_type: 'client_credentials' | |
}, | |
method: 'post' | |
}, function(err, res, body){ | |
if(err){ | |
console.log(err); | |
return; | |
} | |
var ACCESS_TOKEN = JSON.parse(body)['access_token']; | |
// request data on kelly clarkson (chyaaa) | |
request({ | |
url: BANDPAGE_BASE + kelly_clarkson_bid, | |
qs: { | |
access_token: ACCESS_TOKEN | |
} | |
}, function(err2, res2, body2){ | |
if(err2){ | |
console.log(err2); | |
return; | |
} | |
// {"error":"Permission denied","errors":[{"code":null,"message":"Permission denied"}]} | |
console.log(body2); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
artist profile admins need to give explicit permission to application for this to work. poo poo