import requests


def exchange_token(refresh_token, token_endpoint, client_id):
    """Exchange token for access token."""
    response = requests.post(
        token_endpoint,
        data={
            'grant_type': 'refresh_token',
            'client_id': client_id,
            'refresh_token': refresh_token,
        })
    return response.json()