Cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

The API you are requesting could not be found with fitbit-node package

ANSWERED

Hey all, 

 

I am using the FitBit API for my senior project and I keep getting the "The API you are requesting could not be found." error. I am using the fitbit-node package, and here is the section causing the error: 

router.get('/test', function(req, res) {

    if (req.session.authorized) {
        client.get('/1/user/-/activities/date/today.json', req.session.access_token).then(function(results) {
            res.json(results[0]);
        });
    } else {
        res.status(403);
        res.json({
            errors: [{
                message: 'not authorized'
            }]
        });
    }
});

 I am trying to access the /1/user/-/activities/date/today.json endpoint, but keep getting the error. I cannot access any other endpoint except /profile.json. The req.session.access_token is the stored access token from authentication. I am using the same set-up for /profile.json.  

 

I'm following examples from this repo and cannot figure out why it is not working: https://github.com/lukasolson/fitbit-node/blob/master/example.js

 

Thanks! 

 

 

Best Answer
0 Votes
1 BEST ANSWER

Accepted Solutions

@2b2a That means the endpoint you're trying to hit doesn't exist. It looks like you're appending "/1/user/-" when it's already there, when you should be just sending "/activities/date/today.json".

Andrew | Community Moderator, Fitbit

What motivates you?

View best answer in original post

Best Answer
0 Votes
1 REPLY 1

@2b2a That means the endpoint you're trying to hit doesn't exist. It looks like you're appending "/1/user/-" when it's already there, when you should be just sending "/activities/date/today.json".

Andrew | Community Moderator, Fitbit

What motivates you?

Best Answer
0 Votes