Hi!
I’m making a simple app with Node/Express where I’m going to give access to the user if they are supporting me/my Patreon page, but only if they are on a certain tier. I’ve managed to get info about the user through the /current_user request, but once I try to get info about their pledge etc through /current_user/campagns I get this as a response:
{ data: [] }
Here is my request code:
function handleOAuthRedirectRequest(request, response) {
const oauthGrantCode = url.parse(request.url, true).query.code;
patreonOAuthClient
.getTokens(oauthGrantCode, patreonRedirectUrl)
.then(function(tokensResponse) {
var patreonAPIClient = patreonAPI(tokensResponse.access_token);
return patreonAPIClient('/current_user/campaigns')
})
.then(function(result) {
console.log('respons: ', result.rawJson);
//this is where the magic will happen IF I can get /campaigns to work
})
.catch(function(err) {
console.error('error!', err)
response.end(err)
})
}
Thanks!