수색…


소개

Google appscript는 독립 실행 형 플랫폼 및 Google 문서, 시트 및 양식의 애드온 형식으로 잘 실행됩니다. 그러나 어떤 조치를 수행하기 위해 클라이언트 브라우저가 Google 앱을 호출해야하는 경우가 있습니다.

따라서 Google은 클라이언트 측 요청을 Google 앱 스크립트에 도입했습니다. 이 문제를 해결하기 위해 Google은 클라이언트 측 라이브러리

다음은 Google 앱 스크립트에 대한 클라이언트 측 호출의 예입니다.

<script src="https://apis.google.com/js/api.js"></script>
<script>
function start() {
 // 2. Initialize the JavaScript client library.
 gapi.client.init({
'apiKey': 'YOUR_API_KEY',
// clientId and scope are optional if auth is not required.
'clientId': 'YOUR_WEB_CLIENT_ID.apps.googleusercontent.com',
'scope': 'profile',
}).then(function() {
// 3. Initialize and make the API request.
return gapi.client.request({
  'path': 'https://people.googleapis.com/v1/people/me',
  })
 }).then(function(response) {
console.log(response.result);
}, function(reason) {
console.log('Error: ' + reason.result.error.message);
});
};
// 1. Load the JavaScript client library.
 gapi.load('client', start);
</script>


Modified text is an extract of the original Stack Overflow Documentation
아래 라이선스 CC BY-SA 3.0
와 제휴하지 않음 Stack Overflow