import requests


def get_bucket(url, token, record_id):
    """ Get bucket url from record json data
    
    Parameters
    ----------
    url : str 
        The base url of application
    token : str
        The authentication token for the api 
    record_id : str
        The id for record we want to upload files to

    Returns
    -------
    bucket_url : str
        The url for the file bucket to which upload files
    """

    headers = {"Content-Type": "application/json"}
    url += f"{record_id}"
    r = requests.get(url, params={'access_token': token},
                     headers=headers)
    return r.json()["links"]["bucket"]