2017-09-26 1 views
1

'인증되지 않은 사용에 대한 일일 제한 초과'를 받으십시오. 계속 사용하려면 가입해야합니다. ' 범위에 'https://www.googleapis.com/auth/drive'을 추가 할 때. 범위 밖으로 가져 가면 다른 범위와 관련된 다른 모든 함수에서 작동합니다. 나는 파일을 복사하는 범위에서 이것을 필요로한다.Google 드라이브 범위 '인증되지 않은 사용에 대한 일일 오류 초과. 계속 사용하려면 가입해야합니다. '

public handleClientLoad() { 
     gapi.load('client:auth2', function() { 
     gapi.client.init({   
      discoveryDocs: ['https://sheets.googleapis.com/$discovery/rest?version=v4', 
      'https://www.googleapis.com/discovery/v1/apis/drive/v3/rest'], 
      clientId: 'MyclientID*.apps.googleusercontent.com', 
      scope: ` https://www.googleapis.com/auth/drive https://www.googleapis.com/auth/drive.metadata.readonly https://www.googleapis.com/auth/spreadsheets ` 
     }).then(() => { 

      gapi.client.drive.files.copy({ 
       'fileId': 'My File ID', 
       'resource': { 
       'parents': [ 
        'MY Parent File' 
       ], 
       'name': 'My File Name' 
       } 
      }) 

     }); 
     }); 
    } 
+0

본 [실]을 참조 할 수있다 (https://stackoverflow.com/questions/19335503). Google Console에서 API를 활성화했는지 확인하십시오. 전원을 켠 후 몇 분 기다렸다가 매번 새로운 토큰을 받으십시오. 이 [오류] (https://stackoverflow.com/questions/35467945)는 응용 프로그램이 apiKey (이전 api) 또는 (client_secret, client_id)없이 요청을 수행 할 때 발생할 수 있습니다. 미리보기 단계에서 API 액세스 권한이 없거나 API 키 또는 OAuth 2 토큰없이 API 호출 만하는 경우 dailyLimitExceededUnreg 오류가 발생합니다. – abielita

답변

0

인증 HTTP 헤더가없는 API 요청을 제출하면이 오류가 반환됩니다. 이 경우에 네트워크 트래픽을 추적 할 수 있습니까? 그렇다면 올바르게 작동하지 않을 수있는 gapi 클라이언트 라이브러리를 깨뜨리는 잘못된 구문과 같은 작업을하고 있다고 의심됩니다. 콘솔 메시지가 있습니까?

+0

다음은 콘솔 오류 메시지입니다. {domain : "usageLimits", 이유 : "dailyLimitExceededUnreg", 메시지 : "인증되지 않은 사용에 대한 일일 한도가 초과되었습니다. 계속 사용하려면 가입해야합니다.", extendedHelp : "https://code.google. co.kr/apis/console "} 네트워크 트래픽은 200 및 304 모두를 보여줍니다. – Ron

0

원래 질문에이 코드를 추가하여 문제를 해결할 수있었습니다.

var GoogleAuth; 
gapi.load('client:auth2', function() { 

// callback 
.then(() => { 
     **GoogleAuth = gapi.auth2.getAuthInstance(); 
     GoogleAuth.signIn();** 
     gapi.client.drive.files.copy({ 
// implement functionality 
관련 문제