/current_user works, but /current_user/campagns returns empty


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;

        .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) 


Try to use v2 endpoints rather than v1 endpoints.


That worked! Thanks!

1 Like