11-01-2016 20:11
11-01-2016 20:11
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!
Answered! Go to the Best Answer.
Best Answer11-02-2016 09:18 - edited 11-02-2016 09:19
Community Moderator Alumni are previous members of the Moderation Team, which ensures conversations are friendly, factual, and on-topic. Moderators are here to answer questions, escalate bugs, and make sure your voice is heard by the larger Fitbit team. Learn more
11-02-2016 09:18 - edited 11-02-2016 09:19
@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".
Best Answer11-02-2016 09:18 - edited 11-02-2016 09:19
Community Moderator Alumni are previous members of the Moderation Team, which ensures conversations are friendly, factual, and on-topic. Moderators are here to answer questions, escalate bugs, and make sure your voice is heard by the larger Fitbit team. Learn more
11-02-2016 09:18 - edited 11-02-2016 09:19
@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".
Best Answer