2

How i connect to my website and withing api.I send weight value to withing api and get body measurement value.And where i will get withing api code.

$config['withings_settings']['widgets'] = 'TRUE';
$config['withings_settings']['enabled'] = 'TRUE';
$config['withings_settings']['consumer_key'] = 'c65e4bff78de924609d8cce4dce837f2d931e0f13e8d9dbcbbdcf6f0c97cd';
$config['withings_settings']['consumer_secret'] = 'ec75fc954c37b57c67f8bc0ee6f1226d78b22ded5f173e73fd331f78ef0';
$config['withings_settings']['social_connection'] = 'TRUE';
$config['withings_settings']['connections_redirect']= 'settings/connections/';
$config['withings_settings']['archive'] = '';

/* Sites */
$config['withings_sites'][] = array(
    'url'       => 'http://withings.com/', 
    'module'    => 'withings', 
    'type'      => 'remote', 
    'title'     => 'Withings', 
    'favicon'   => 'http://withings.com/favicon.ico'
);

class OAuth_Provider_Withings extends OAuth_Provider {

    public $name = 'withings';
    public $uid_key = 'user_id';

    public function get_user_info(OAuth_Consumer $consumer, OAuth_Token $token)
    {
        // Create a new GET request with the required parameters
        $request = OAuth_Request::forge('resource', 'GET', 'http://wbsapi.withings.net/measure?action=getmeas&userid=933243', array(
            'oauth_consumer_key'    => $consumer->key,
            'oauth_token'           => $token->access_token
        ));

        // Sign the request using the consumer and token
        $request->sign($this->signature, $consumer, $token);

        $activities = $request->execute();

        // Create a response from the request
        return $activities;
    }   

}

I need get measurement response from withings whatever user submit a bodyweight.I need reference code for withing api and i also need step to access.Because i didnt use this before.

Advance thanks.

Steve Bennett
  • 114,604
  • 39
  • 168
  • 219
Deenadhayalan Manoharan
  • 5,436
  • 14
  • 30
  • 50

1 Answers1

0

you can check my github withings lib for withings . i have for the moment the getbody / activities measures..

the only issue i meet for the moment is when i m trying to create a notification , it seems the creation is doing well ( i can get a request on my website from withings ) but withings is still giving a 293 code .

https://github.com/huitiemesens/PHPoAuthLib

Charles-Antoine Fournel
  • 1,713
  • 1
  • 25
  • 37