import requests


def get_record(
    airtable_key: str,
    base_id: str,
    table_name: str = "submissions",
    record_id: str = "",
):
    """
    Get record from Airtable with a given record ID `record_id`
    """
    if record_id != "":
        request_url = f"https://api.airtable.com/v0/{base_id}/{table_name}/{record_id}"
        headers = {
            "Authorization": f"Bearer {airtable_key}",
        }
        output = requests.get(request_url, headers=headers)
        return output
    else:
        return None