import requests
import json


def edit_link(token, link, title):
    """
    Edits an already existing Bitly links title.

    Args:
        token (str): Bitly access token.
        link (str): Shortened URL to be edited by Bitly.
        title (str): Updated Bitly link title.

    Returns:
        Bitly status information and the returned Bitly link on success.
    """

    r = requests.get("https://api-ssl.bitly.com/v3/user/link_edit?access_token={}&link={}&edit=title&title={}".format(token, link, title))

    return json.loads(r.content.decode("utf-8"))