有沒有人使用過融合表API的函數importRows()? 作爲下面的API參考, https://developers.google.com/fusiontables/docs/v1/reference/table/importRows 我必須在請求正文中提供CSV數據。 但是,我應該爲HTML身體完全做什麼?融合表importrows
我的代碼:
http = getAuthorizedHttp()
DISCOVERYURL = 'https://www.googleapis.com/discovery/v1/apis/{api}/{apiVersion}/rest'
ftable = build('fusiontables', 'v1', discoveryServiceUrl=DISCOVERYURL, http=http)
body = create_ft(CSVFILE,"title here") # the function to load csv file and create the table with columns from csv file.
result = ftable.table().insert(body=body).execute()
print result["tableId"] # good, I have got the id for new created table
# I have no idea how to go on here..
f = ftable.table().importRows(tableId=result["tableId"])
f.body = ?????????????
f.execute()