Skip to content

Getting "Token not found in session, are you sure you stored it?" when trying to access data using consumer key only authorization #5

Description

@jhnferraris

I've been trying to get the sleep data of my test user using the consumer key only verification.

So I've set the privacy setting of "Sleep" to "Anyone"

Here's my code to get the sleep data:

    $factory = new \Fitbit\ApiGatewayFactory();
    $factory->setCallbackURL($connection['callbackUrl']);
    $factory->setCredentials($connection['consumerKey'],   $connection['consumerSecret']);

    // Declared this to avoid the "missing storage adapter" error.
    $adapter = new \OAuth\Common\Storage\Session();
    $factory->setStorageAdapter($adapter);

    $sleepGateway = $factory->getSleepGateway();
    $sleepGateway->setUserID('XXXXX');
    print_r($sleepGateway->getSleep((new \DateTime('20140409'))));

However, whenever I try to access either the sleep data or the profile given that they are in Anyone setting returns "Token not found in session, are you sure you stored it?".

Any help on this issue would be appreciated. Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions