chatter/base.py
def _refresh_access_token(self):
        """
        If the client application has a refresh token, it can use it to send a request for a new access token. 
        
        To ask for a new access token, the client application should send a POST request to https://login.instance_name/services/oauth2/token with the following query parameters:
        
            grant_type:     Value must be refresh_token for this flow.
            refresh_token:  The refresh token the client application already received. 
            client_id:      Consumer key from the remote access application definition.
            client_secret:  Consumer secret from the remote access application definition.
            format:         Expected return format. This parameter is optional. The default is json. Values are:
        
                * urlencoded
                * json
                * xml
        
        e.g.
        
            $ curl -i --form grant_type=refresh_token \
                --form refresh_token=<refresh_token> \
                --form client_id=<client_id> \
                --form client_secret=<client_secret> \
                --form format=json \
                https://na1.salesforce.com/services/oauth2/token
        """

        resource = "https://na1.salesforce.com/services/oauth2/token"
        fields = dict(grant_type="refresh_token", refresh_token=self.refresh_token,
                      client_id=self.auth.client_id, client_secret=self.auth.client_secret,
                      format="json")
        status, data = self._handle_response("POST", resource, fields=fields, 
                                             refresh_access_token=False)
        
        if "access_token" in data:
            # Update access token
            self.access_token = data["access_token"]
            
            # Notify others via callback
            if callable(self.access_token_refreshed_callback):
                self.access_token_refreshed_callback(self.access_token)
            
            # Return True, indicating access_token refresehed
            return True

        # Return False, indicating access_token not refreshed
        return False
def _refresh_access_token(self):
        """
        If the client application has a refresh token, it can use it to send a request for a new access token. 
        
        To ask for a new access token, the client application should send a POST request to https://login.instance_name/services/oauth2/token with the following query parameters:
        
            grant_type:     Value must be refresh_token for this flow.
            refresh_token:  The refresh token the client application already received. 
            client_id:      Consumer key from the remote access application definition.
            client_secret:  Consumer secret from the remote access application definition.
            format:         Expected return format. This parameter is optional. The default is json. Values are:
        
                * urlencoded
                * json
                * xml
        
        e.g.
        
            $ curl -i --form grant_type=refresh_token \
                --form refresh_token=<refresh_token> \
                --form client_id=<client_id> \
                --form client_secret=<client_secret> \
                --form format=json \
                https://na1.salesforce.com/services/oauth2/token
        """

        resource = "https://na1.salesforce.com/services/oauth2/token"
        fields = dict(grant_type="refresh_token", refresh_token=self.refresh_token,
                      client_id=self.auth.client_id, client_secret=self.auth.client_secret,
                      format="json")
        status, data = self._handle_response("POST", resource, fields=fields, 
                                             refresh_access_token=False)
        
        if "access_token" in data:
            # Update access token
            self.access_token = data["access_token"]
            
            # Notify others via callback
            if callable(self.access_token_refreshed_callback):
                self.access_token_refreshed_callback(self.access_token)
            
            # Return True, indicating access_token refresehed
            return True

        # Return False, indicating access_token not refreshed
        return False
If the client application has a refresh token, it can use it to send a request for a new access token. 
        
        To ask for a new access token, the client application should send a POST request to https://login.instance_name/services/oauth2/token with the following query parameters:
        
            grant_type:     Value must be refresh_token for this flow.
            refresh_token:  The refresh token the client application already received. 
            client_id:      Consumer key from the remote access application definition.
            client_secret:  Consumer secret from the remote access application definition.
            format:         Expected return format. This parameter is optional. The default is json. Values are:
        
                * urlencoded
                * json
                * xml
        
        e.g.
        
            $ curl -i --form grant_type=refresh_token \
                --form refresh_token=<refresh_token> \
                --form client_id=<client_id> \
                --form client_secret=<client_secret> \
                --form format=json \
                https://na1.salesforce.com/services/oauth2/token