import re


def __get_auth_api_url(module, url):
    """
    Return the parsed URL of the specific authentication API.
    :param AnsibleModule module: the ansible module
    :param str url: the initial URL of API
    :rtype: str
    """
    # format the input for zmd_port
    if module.params['zmf_port'] is None:
        module.params['zmf_port'] = ''
    else:
        module.params['zmf_port'] = str(module.params['zmf_port']).strip()
    matchObj = re.findall('{(.+?)}', url)
    for x in matchObj:
        if x == 'zmf_port' and module.params[x] == '':
            url = re.sub(':{' + x + '}', module.params[x], url)
        else:
            url = re.sub('{' + x + '}', module.params[x].strip(), url)
    return url