def encode_special_characters(string: str) -> str:
    """Make string safe for urls as required by REST APIs"""
    char_mapping = {"#": ";23", "&": ";26", "/": "|", "*": ";2A"}
    for char, encoded_char in char_mapping.items():
        string = string.replace(char, encoded_char)
    return string