lib/Fabulator/Fitbit/FitbitApiBase.php
public function requestAccessToken($code, $redirectUri, $expiresIn = null, $state = null)
    {
        $parameters = [
            'code' => $code,
            'grant_type' => 'authorization_code',
            'client_id' => $this->clientId,
            'redirect_uri' => $redirectUri,
        ];

        if ($expiresIn != null) {
            $parameters['expires_in'] = $expiresIn;
        }

        if ($state != null) {
            $parameters['state'] = $state;
        }

        return $this->tokenRequest('oauth2/token', $parameters);
    }
public function requestAccessToken($code, $redirectUri, $expiresIn = null, $state = null)
    {
        $parameters = [
            'code' => $code,
            'grant_type' => 'authorization_code',
            'client_id' => $this->clientId,
            'redirect_uri' => $redirectUri,
        ];

        if ($expiresIn != null) {
            $parameters['expires_in'] = $expiresIn;
        }

        if ($state != null) {
            $parameters['state'] = $state;
        }

        return $this->tokenRequest('oauth2/token', $parameters);
    }
public function requestAccessToken ( $ code , $ redirectUri , $ expiresIn = null , $ state = null ) { $ parameters = [ 'code' => $ code , 'grant_type' => 'authorization_code' , 'client_id' => $ this -> clientId , 'redirect_uri' => $ redirectUri , ] ; if ( $ expiresIn != null ) { $ parameters [ 'expires_in' ] = $ expiresIn ; } if ( $ state != null ) { $ parameters [ 'state' ] = $ state ; } return $ this -> tokenRequest ( 'oauth2/token' , $ parameters ) ; }
Request new Fitbit access token.

@param string $code code from Fitbit
@param string $redirectUri redirect uri used to get code
@param int|null $expiresIn set length of token
@param string|null $state This parameter will be added to the redirect URI exactly as your application specifies.
@return ResponseInterface response from Fitbit API
Request new Fitbit access token .