def METHOD_NAME(username, password, customer_id, directory, minutes_before, api_version):
    current_time = datetime.datetime.now()
    if minutes_before > 0:
        current_time = current_time - \
            datetime.timedelta(minutes=minutes_before)
    fifteen_minutes_ago = current_time - datetime.timedelta(minutes=15)
    CYCLE_TO = int(fifteen_minutes_ago.timestamp())
    twenty_minutes_ago = current_time - datetime.timedelta(minutes=20)
    CYCLE_FROM = int(twenty_minutes_ago.timestamp())
    FILTERS = f"filter.requestTimestampFrom={CYCLE_FROM}&filter.requestTimestampTo={CYCLE_TO}&order.0.requestTimestamp=asc"
    headers = {'Accept': 'text/csv', 'X-MWG-API-Version': f'{api_version}'}
    url = f"https://msg.mcafeesaas.com/mwg/api/reporting/forensic/{customer_id}?{FILTERS}"
    try:
        name = os.getcwd() + directory + "mcp_" + str(CYCLE_TO) + ".csv"
        logger.info(f'requesting {directory}')
        with requests.get(url, auth=(username, password), headers=headers, stream=True) as r:
          r.raise_for_status()
          with open(name, 'wb') as local_file:
            logger.info(f'downloading {directory} started')
            for chunk in r.iter_content(chunk_size=8192):
              local_file.write(chunk)
            logger.info(f'downloading {directory} finished')
    except Exception as f:
        logger.error(f"The API call for {directory} failed")
        logger.error(f)
        return None