import getpass


def input_api_key() -> str:
    """Get the Meaki dashboard API key from the user's input.

    -> Return the API key (string) with the leading & trailing  whitespace
    removed if the key is not a blank value.
    """
    input_message = "Enter your Meraki's dashboard API Key: "
    api_key = getpass.getpass(f'{input_message}')
    while not api_key or api_key.isspace():
        if api_key.isspace():
            print('-> Data Error: API key contains all whitespace characters.')
        else:
            print("-> Data Error: API key can't be a blank value.")
        api_key = getpass.getpass(f'{input_message}')
    return api_key.strip()