import requests


def getToken(email, password):
    """
    This function return an access token retrieved from api/login
    
    Parameters
    ----------
    email : str
    password : str
    
    Returns
    ----------
    access token
        if access token is retrieved. 
    empty string
        Otherwise.
    """
    r = requests.post(r"https://opendata.hopefully.works/api/login", json={"email":email, "password":password})
    if r.status_code == 200:    
        return r.json()["accessToken"]
    else:
        return ""