11-01-2016 20:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post

11-01-2016 20:11
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
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.

- Labels:
-
JavaScript
-
OAuth 2.0
Accepted Solutions
11-02-2016 09:18 - edited 11-02-2016 09:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



11-02-2016 09:18 - edited 11-02-2016 09:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@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".

11-02-2016 09:18 - edited 11-02-2016 09:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post



11-02-2016 09:18 - edited 11-02-2016 09:19
- Mark as New
- Bookmark
- Subscribe
- Permalink
- Report this post
@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".

