Retrieve token of TonicDNS API.

    Arguments:

        usename:  TonicDNS API username
        password: TonicDNS API password
        server:   TonicDNS API server

def get_token(username, password, server):
    """Retrieve token of TonicDNS API.

    Arguments:

        usename:  TonicDNS API username
        password: TonicDNS API password
        server:   TonicDNS API server
    """
    method = 'PUT'
    uri = 'https://' + server + '/authenticate'
    token = ''

    authinfo = {
        "username": username,
        "password": password,
        "local_user": username}

    token = tonicdns_client(uri, method, token, data=authinfo)

    return token