api_url = 'https://analyticsapi.zoho.com/restapi/v2/workspaces/xxxxxx/views/xxxxxxx/data'
print(api_url)
headers = {
"Authorization": f"Zoho-oauthtoken {access_token}"
}
csv_file_path = '/Users/xxxxxx/Downloads/data.csv'
with open(csv_file_path, 'rb') as csv_file:
csv_bytes = csv_file.read()
files = {'file': ('data.csv', csv_bytes, 'text/csv')}
data = {"importType": "updateadd",
"fileType": "csv",
"autoIdentify": "true"
}
response = requests.post(api_url, headers=headers, files=files, data=data)
print(response.text)