import requests


def create_cdec_json_api_str(station_ids: list) -> str:
    """
    Function to call an api for the station ids and get the
    date from the start date to today.

    :param station_ids: List of station ids
    """
    api_str = "https://cdec.water.ca.gov/dynamicapp/req/JSONDataServlet"
    
    # seperator for these is '%2C' --> meaning a ','
    stations_str = '%2C'.join(station_ids)
    payload = {
        'Stations': stations_str,
        'SensorNums': 2,
        'dur_code': 'D',
        'Start': '1970-11-10',
        'End': '2020-11-10'
    }

    res = requests.get(api_str, params=payload)

    return res.json()