def METHOD_NAME(otpkey=None, user=None, realm=None,
                         type="hotp", serial="mylabel", tokenlabel="<s>",
                         extra_data=None):
    timebased = ""
    if "totp" == type.lower():
        timebased = "&timeBased=true"
    # We need realm und user to be a string
    realm = realm or ""
    user = user or ""
    extra_data = extra_data or {}
    label = tokenlabel.replace("<s>",
                               serial).replace("<u>",
                                               user).replace("<r>", realm)
    url_label = quote(label)
    extra_parameters = _construct_extra_parameters(extra_data)
    url = "oathtoken:///addToken?name={0!s}&lockdown=true&key={1!s}{2!s}{3!s}".format(
                                                                  url_label,
                                                                  otpkey,
                                                                  timebased,
                                                                  extra_parameters
                                                                  )
    return url