Here is my method: I have two tasks now
1. i need to pass delta_dt some where to get last five days of data by sys_updated_on
2. i need to write if condition to go for loadtype as full or incremental. In incremental i need to get last 5 days of data.
1. i need to pass delta_dt some where to get last five days of data by sys_updated_on
2. i need to write if condition to go for loadtype as full or incremental. In incremental i need to get last 5 days of data.
def call_api_get_total_record_count(url, username, password, loadtype): delta_dt = (date.today() - timedelta(days=5)).isoformat() headers = {"Content-Type": "application/json", "Accept": "application/json"} parameters_full = {"sysparm_limit": "1"} parameters_incremental = {"sysparm_limit": "1", "sysparm_query": "sys_updated_on"} response = requests.get(url, auth=(username, password), headers=headers, params=parameters) totalrecordcount = int(response.headers['X-Total-Count']) return totalrecordcountthis code is to retrieve total count of rows either for full load or last 5 days of incremental load