0
Google 드라이브에서

나는이 API를 사용하므로 다른 스프레드 시트에 스프레드 시트에서 하나의 시트를 복사하려면 :구글 시트 spreadsheets.sheets.copyTo 반환 500 내부 서버 오류

https://developers.google.com/sheets/api/reference/rest/v4/spreadsheets.sheets/copyTo

내가부터 시작을 2 스프레드 시트를 열어서 gspread를 사용하여 업데이트 할 수 있습니다. 그러나 Python 코드를 실행할 때 500 Internal Server Error가 발생합니다.

googleapiclient.errors.HttpError: <HttpError 500 when requesting https://sheets.googleapis.com/v4/spreadsheets/myID/sheets/0:copyTo?alt=json returned "Internal error encountered."> 

API 페이지에서 API를 직접 테스트하면 동일한 결과가 나타납니다. 왜?

gspread 비슷한 API를 가지고 있지만 나는이 도서관에서 발견 유사한

+0

올바른 sheet_id를 사용하여 질문을 해결했습니다. 불행히도 시트 ID를 반환하는 API는 없지만 직접 파일 파일 URL을 가져올 수 있습니다. 시트 ID는 gid = –

답변

0

아무것도 발견하지 않으면 나는 또한 확인 : https://github.com/nithinmurali/pygsheets 드라이브 스프레드 시트 및 worhsheet에 작업을 할 수있는 가장 좋은 방법입니다. 워크 시트 사본은 매우 간단합니다.

import pygsheets 
gc = pygsheets.authorize(outh_file='client_secret.json') 
sh = gc.open('shname') 
wks = sh.add_worksheet("wksname_b", src_worksheet=sh.worksheet_by_title("wksname_a"))