{"id":297821,"date":"2020-01-28T15:00:24","date_gmt":"2020-01-28T15:00:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=297821"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=297821","title":{"rendered":"\u042d\u043a\u0441\u043f\u043e\u0440\u0442 Google Forms + \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 Google Script \u0447\u0435\u0440\u0435\u0437 REST API (Python)"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/485898\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gi\/tl\/nl\/gitlnlklzpbmybk3jz3utl4_uow.png\"\/><\/p>\n<p>  \u0423 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u0434\u0432\u0435 \u0433\u0443\u0433\u043b-\u0444\u043e\u0440\u043c\u044b, 75 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439, 5 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u044d\u0442\u0438 \u0444\u043e\u0440\u043c\u044b, \u0430 \u0435\u0449\u0435 \u0433\u0443\u0433\u043b-\u0441\u043a\u0440\u0438\u043f\u0442, \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0444\u043e\u0440\u043c\u0443 \u0432 JSON. \u041d\u0435 \u0442\u043e \u0447\u0442\u043e \u0431\u044b \u0435\u0433\u043e \u0431\u044b\u043b\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438, \u043d\u043e \u0440\u0430\u0437 \u043d\u0430\u0447\u0430\u043b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u0442\u043e \u0438\u0434\u0438 \u0432 \u044d\u0442\u043e\u043c \u0443\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430.<\/p>\n<p>  \u0412 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0441\u0430\u043c \u0447\u0435\u0440\u0442 \u043d\u043e\u0433\u0443 \u0441\u043b\u043e\u043c\u0438\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a Google Apps Script \u0447\u0435\u0440\u0435\u0437 REST API, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Python.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h2>\n<p>  \u0423 \u043d\u0430\u0441 \u0432 \u00ab\u0414\u043e\u043a\u0442\u043e\u0440 \u0440\u044f\u0434\u043e\u043c\u00bb \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u043b\u0430\u0442\u0444\u043e\u0440\u043c\u0430 \u0434\u043b\u044f \u0447\u0430\u0442-\u0431\u043e\u0442\u043e\u0432, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0434\u043b\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0446\u0435\u043d\u0430\u0440\u0438\u0435\u0432 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0433\u0443\u0433\u043b-\u0444\u043e\u0440\u043c\u044b. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0438\u0437 \u0444\u043e\u0440\u043c \u043f\u043e \u043d\u0430\u0436\u0430\u0442\u0438\u044e \u043a\u043d\u043e\u043f\u043a\u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c JSON, \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0439 \u043d\u043e\u0434\u044b (\u043f\u0443\u043d\u043a\u0442\u044b \u0444\u043e\u0440\u043c\u044b) \u0438 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u043a \u043d\u0438\u043c (\u043f\u0435\u0440\u0435\u0445\u043e\u0434\u044b \u043c\u0435\u0436\u0434\u0443 \u043d\u043e\u0434\u0430\u043c\u0438, \u0442\u0438\u043f\u044b \u043d\u043e\u0434, \u0438\u0445 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435). \u041a\u0430\u0437\u0430\u043b\u043e\u0441\u044c \u0431\u044b, \u0436\u0435\u043b\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435, \u043d\u043e \u0433\u0443\u0433\u043b \u043d\u0435 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0441\u043e\u0431\u0438\u0440\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u00ab\u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0435\u0440\u00bb \u0441\u0432\u043e\u0438\u043c\u0438 \u0440\u0443\u043a\u0430\u043c\u0438. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e \u0448\u0430\u0433\u0430\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0435\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f.<\/p>\n<h2>\u0428\u0410\u0413 1. Google Apps Script<\/h2>\n<p>  Google \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u0441\u043e \u0441\u0432\u043e\u0438\u043c\u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u0430\u043c\u0438 (Sheets, Docs, Forms) \u0447\u0435\u0440\u0435\u0437 Google Apps Script \u2014 \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 google script (.gs). \u0414\u0430\u043d\u043d\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u043d\u0435 \u043f\u0440\u0435\u0434\u0443\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u0431\u043e\u0440\u0430 \u044f\u0437\u044b\u043a\u0430 google script, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043f\u0440\u0438\u043c\u0435\u0440 \u0433\u043e\u0442\u043e\u0432\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0435\u0433\u043e JSON \u0438\u0437 \u0438\u043c\u0435\u044e\u0449\u0435\u0439\u0441\u044f \u0433\u0443\u0433\u043b-\u0444\u043e\u0440\u043c\u044b. \u0417\u0430 \u043e\u0441\u043d\u043e\u0432\u0443 \u0431\u044b\u043b \u0432\u0437\u044f\u0442 \u0441 \u0433\u0438\u0442\u0445\u0430\u0431\u0430 <a href=\"https:\/\/github.com\/stevenschmatz\/export-google-form\/blob\/master\/src\/Code.gs\">\u043a\u043e\u0434<\/a> \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f <a href=\"https:\/\/github.com\/stevenschmatz\">Steven Schmatz<\/a>, \u0437\u0430 \u0447\u0442\u043e \u0432\u044b\u0440\u0430\u0436\u0430\u044e \u0435\u043c\u0443 \u0441\u0432\u043e\u044e \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u043d\u043e\u0441\u0442\u044c.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"javascript\">\/\/ Steven Schmatz \/\/ Humanitas Labs \/\/ 13 October, 2016.  \/\/ Roman Shekhovtsov \/\/ dr-telemed.ru \/\/ Autumn 2019  \/\/ Nikita Orekhov \/\/ dr-telemed.ru \/\/ Autumn 2019  \/**  * Converts the given form URL into a JSON object.  *\/ function main() {    form_url = &quot;&lt;YOUR_FORM_URL&gt;&quot;   var form = FormApp.openByUrl(form_url);   var items = form.getItems();    var result = {     &quot;metadata&quot;: getFormMetadata(form),     &quot;items&quot;: items.map(itemToObject),     &quot;count&quot;: items.length   };  \/\/  sendEmail(&quot;&lt;YOUR_EMAIL&gt;&quot;, result)    return result; }  \/** If we want to receive data by email  * Sends JSON as text to recipient email  * @param recipient: String  * @param result: JSON  *\/ function sendEmail(recipient, json_file){   var subject = &quot;google form json import&quot;   var body = JSON.stringify(json_file);   Logger.log(body);   MailApp.sendEmail(recipient, subject, body); }  \/**  * Returns the form metadata object for the given Form object.  * @param form: Form  * @returns (Object) object of form metadata.  *\/ function getFormMetadata(form) {   return {     &quot;title&quot;: form.getTitle(),     &quot;id&quot;: form.getId(),     &quot;description&quot;: form.getDescription(),     &quot;publishedUrl&quot;: form.getPublishedUrl(),     &quot;editorEmails&quot;: form.getEditors().map(function(user) { return user.getEmail() }),     &quot;count&quot;: form.getItems().length,     &quot;confirmationMessage&quot;: form.getConfirmationMessage(),     &quot;customClosedFormMessage&quot;: form.getCustomClosedFormMessage()   }; }  \/**  * Returns an Object for a given Item.  * @param item: Item  * @returns (Object) object for the given item.  *\/ function itemToObject(item) {   var data = {};    data.type = item.getType().toString();    \/\/ Downcast items to access type-specific properties    var itemTypeConstructorName = snakeCaseToCamelCase(&quot;AS_&quot; + item.getType().toString() + &quot;_ITEM&quot;);   var typedItem = item[itemTypeConstructorName]();    \/\/ Keys with a prefix of &quot;get&quot; have &quot;get&quot; stripped    var getKeysRaw = Object.keys(typedItem).filter(function(s) {return s.indexOf(&quot;get&quot;) == 0});    getKeysRaw.map(function(getKey) {     var propName = getKey[3].toLowerCase() + getKey.substr(4);      \/\/ Image data, choices, and type come in the form of objects \/ enums     if ([&quot;image&quot;, &quot;choices&quot;, &quot;type&quot;, &quot;alignment&quot;].indexOf(propName) != -1) {return};      \/\/ Skip feedback-related keys     if (&quot;getFeedbackForIncorrect&quot;.equals(getKey) || &quot;getFeedbackForCorrect&quot;.equals(getKey)       || &quot;getGeneralFeedback&quot;.equals(getKey)) {return};      var propValue = typedItem[getKey]();      data[propName] = propValue;   });    \/\/ Bool keys are included as-is    var boolKeys = Object.keys(typedItem).filter(function(s) {     return (s.indexOf(&quot;is&quot;) == 0) || (s.indexOf(&quot;has&quot;) == 0) || (s.indexOf(&quot;includes&quot;) == 0);   });    boolKeys.map(function(boolKey) {     var propName = boolKey;     var propValue = typedItem[boolKey]();     data[propName] = propValue;   });    \/\/ Handle image data and list choices    switch (item.getType()) {     case FormApp.ItemType.LIST:     case FormApp.ItemType.CHECKBOX:       data.choices = typedItem.getChoices().map(function(choice) {         return choice.getValue()       });     case FormApp.ItemType.MULTIPLE_CHOICE:       data.choices = typedItem.getChoices().map(function(choice) {         gotoPage = choice.getGotoPage()         if (gotoPage == null)             return choice.getValue()         else             return {                 &quot;value&quot;: choice.getValue(),                 &quot;gotoPage&quot;:choice.getGotoPage().getId()         };       });       break;      case FormApp.ItemType.IMAGE:       data.alignment = typedItem.getAlignment().toString();        if (item.getType() == FormApp.ItemType.VIDEO) {         return;       }        var imageBlob = typedItem.getImage();        data.imageBlob = {         &quot;dataAsString&quot;: &quot;&quot;, \/\/imageBlob.getDataAsString(), - BLOB too big         &quot;name&quot;: imageBlob.getName(),         &quot;isGoogleType&quot;: imageBlob.isGoogleType()       };        break;      case FormApp.ItemType.PAGE_BREAK:       data.pageNavigationType = typedItem.getPageNavigationType().toString();       break;      default:       break;   }    \/\/ Have to do this because for some reason Google Scripts API doesn't have a   \/\/ native VIDEO type   if (item.getType().toString() === &quot;VIDEO&quot;) {     data.alignment = typedItem.getAlignment().toString();   }    return data; }  \/**  * Converts a SNAKE_CASE string to a camelCase string.  * @param s: string in snake_case  * @returns (string) the camelCase version of that string  *\/ function snakeCaseToCamelCase(s) {   return s.toLowerCase().replace(\/(\\_\\w)\/g, function(m) {return m[1].toUpperCase();}); } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0427\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0432 \u043a\u043e\u0434\u0435: <\/p>\n<ul>\n<li>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>getFormMetadata<\/i> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 JSON \u0441 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0444\u043e\u0440\u043c\u044b<\/li>\n<li>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>itemToObject<\/i> \u2014 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u0442 \u043e\u0431\u044a\u0435\u043a\u0442 <i>form.item<\/i> \u0432 JSON \u0441 \u0442\u0440\u0435\u0431\u0443\u0435\u043c\u044b\u043c\u0438 \u043f\u043e\u043b\u044f\u043c\u0438 <\/li>\n<li>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>sendEmail<\/i> \u2014 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0442\u0435\u043a\u0441\u0442\u043e\u043c JSON \u0444\u0430\u0439\u043b \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u0443\u044e \u043f\u043e\u0447\u0442\u0443 <\/li>\n<li>\u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>main<\/i> \u2014 \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u0442 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 JSON<\/li>\n<li>\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>form_url<\/i> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>main<\/i> \u2014 \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0439 \u0433\u0443\u0433\u043b-\u0444\u043e\u0440\u043c\u044b<\/li>\n<\/ul>\n<p>  <\/p>\n<h2>\u0428\u0410\u0413 2. \u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h2>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0440\u0430\u0431\u043e\u0442\u043e\u0441\u043f\u043e\u0441\u043e\u0431\u043d\u043e\u0441\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<ol>\n<li><a href=\"https:\/\/script.google.com\/home\/start\">\u0441\u043e\u0437\u0434\u0430\u0435\u043c<\/a> \u0441\u0432\u043e\u0439 App Script \u043f\u0440\u043e\u0435\u043a\u0442<\/li>\n<li>\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0432 \u043d\u0435\u0433\u043e \u043a\u043e\u0434<\/li>\n<li>\u0432\u043c\u0435\u0441\u0442\u043e <i> &lt;YOUR_FORM_URL&gt; <\/i> \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u0432\u043e\u0435\u0439 \u0444\u043e\u0440\u043c\u044b \u0432\u0438\u0434\u0430 <i><a href=\"https:\/\/docs.google.com\/forms\/d\/FORM_IDENTIFICATOR\/edit\">docs.google.com\/forms\/d\/FORM_IDENTIFICATOR\/edit<\/a><\/i> <\/li>\n<li>\u0440\u0430\u0441\u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u0432\u044b\u0437\u043e\u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i> sendEmail <\/i> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>main<\/i> <\/li>\n<li>\u0432\u043c\u0435\u0441\u0442\u043e <i> &lt;YOUR_EMAIL&gt; <\/i> \u043f\u043e\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0430\u0434\u0440\u0435\u0441 \u0441\u0432\u043e\u0435\u0439 \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0447\u0442\u044b, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u0445\u043e\u0442\u0438\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c JSON<\/li>\n<li>\u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u043c \u043f\u0440\u043e\u0435\u043a\u0442<\/li>\n<li>\u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>main<\/i><\/li>\n<li>\u0435\u0441\u043b\u0438 \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0437\u0430\u043f\u0443\u0441\u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0442\u043e \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0441\u043e\u043e\u0431\u0449\u0438\u0442 \u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0434\u0430\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442\u0443 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c email \u0441 \u0432\u0430\u0448\u0435\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430. \u041d\u0435 \u0441\u0442\u043e\u0438\u0442 \u043f\u0443\u0433\u0430\u0442\u044c\u0441\u044f. \u042d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u0430\u044f \u0434\u043b\u044f \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u041f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u00abReview permissions\u00bb -&gt; \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u0441\u0432\u043e\u0439 \u0430\u043a\u043a\u0430\u0443\u043d\u0442 -&gt; \u00abAdvanced\u00bb -&gt; \u00abGo to PROJECT_NAME project (unsafe)\u00bb -&gt; \u00abAllow\u00bb<\/li>\n<li>\u0436\u0434\u0435\u043c \u043e\u0442\u0440\u0430\u0431\u043e\u0442\u043a\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/li>\n<li>\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432 \u043f\u043e\u0447\u0442\u043e\u0432\u044b\u0439 \u044f\u0449\u0438\u043a \u0438 \u0432\u0438\u0434\u0438\u043c JSON \u0444\u0430\u0439\u043b \u0432 \u0442\u0435\u043a\u0441\u0442\u043e\u0432\u043e\u043c \u0432\u0438\u0434\u0435<\/li>\n<\/ol>\n<p>  \u0412\u0441\u0435 \u0431\u044b \u043d\u0438\u0447\u0435\u0433\u043e, \u043d\u043e \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0440\u0443\u0447\u043d\u043e\u0435 \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0437 \u043f\u043e\u0447\u0442\u044b, \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0443 \u044d\u0442\u043e\u0433\u043e \u0442\u0435\u043a\u0441\u0442\u0430 (\u0432 \u043f\u0438\u0442\u043e\u043d\u0435, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440) \u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0438\u0442\u043e\u0433\u043e\u0432\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430. \u0417\u0432\u0443\u0447\u0438\u0442 \u043d\u0435 \u0441\u043b\u0438\u0448\u043a\u043e\u043c production-ready. \u0410\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u0443\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a \u044d\u0442\u043e\u0433\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 Google Apps Script API, \u043e\u0434\u043d\u0430\u043a\u043e \u043f\u0440\u0435\u0436\u0434\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u043d\u0430\u0448 \u0433\u0443\u0433\u043b-\u043f\u0440\u043e\u0435\u043a\u0442 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c.<\/p>\n<p>  <b>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435:<\/b> \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u044f\u0449\u0435\u0433\u043e, \u043d\u0438\u0436\u0435 \u044f \u0431\u0443\u0434\u0443 \u0441\u0441\u044b\u043b\u0430\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043d\u0430 \u0434\u0432\u0435 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u044b, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u0435\u0442\u0441\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u044c \u0438\u0445 \u0432 \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u0432\u043a\u043b\u0430\u0434\u043a\u0430\u0445:<\/p>\n<ol>\n<li><a href=\"https:\/\/script.google.com\/home\">\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430<\/a> \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \/ \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u2014 <i>\u00ab\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 1\u00bb<\/i><\/li>\n<li><a href=\"https:\/\/console.cloud.google.com\/home\">\u0421\u0442\u0440\u0430\u043d\u0438\u0446\u0430<\/a> Google Cloud Platform \u2014 <i>\u00ab\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 2\u00bb<\/i><\/li>\n<\/ol>\n<p>  <\/p>\n<h2>\u0428\u0410\u0413 3. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 Google Cloud Platform<\/h2>\n<p>  \u0417\u0430\u0445\u043e\u0434\u0438\u043c \u0432 Google Cloud Platform (\u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0430 2), \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439 \u043f\u0440\u043e\u0435\u043a\u0442, \u0438\u0431\u043e \u043f\u043e \u0443\u043c\u043e\u043b\u0447\u0430\u043d\u0438\u044e \u0441\u0442\u0430\u0442\u0443\u0441 \u043f\u0440\u043e\u0435\u043a\u0442\u0430 \u2014 Default, \u0430 \u0434\u043b\u044f \u043d\u0430\u0448\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f Standart. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0447\u0438\u0442\u0430\u0442\u044c <a href=\"https:\/\/developers.google.com\/apps-script\/guides\/cloud-platform-projects#when_standard_gcp_projects_are_required\">\u0442\u0443\u0442<\/a> (\u043f\u0443\u043d\u043a\u0442 3).<\/p>\n<p>  \u0412\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u0435\u043c\u0441\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 2, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0443 \u00abAPI \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b\u00bb, \u0437\u0430\u0442\u0435\u043c \u00ab\u041e\u043a\u043d\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 OAuth\u00bb. \u0421\u0442\u0430\u0432\u0438\u043c User Type \u00ab\u0412\u043d\u0435\u0448\u043d\u0438\u0439\u00bb.<\/p>\n<p>  \u0412 \u043f\u043e\u044f\u0432\u0438\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u00ab\u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u00bb.<\/p>\n<p>  \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 \u0432 Google Cloud Platform. \u0418\u0437 \u0431\u043b\u043e\u043a\u0430 \u00ab\u0418\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044f \u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0435\u00bb \u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u043d\u043e\u043c\u0435\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0430.<\/p>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 1. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0440\u0430\u043d\u0435\u0435 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043a\u0440\u0438\u043f\u0442. \u0412 \u043e\u0442\u043a\u0440\u044b\u0432\u0448\u0435\u043c\u0441\u044f \u043e\u043a\u043d\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438\u0434\u0435\u043c \u0432 \u00abResources\u00bb -&gt; \u00abCloud Platform project\u00bb. \u0412 \u043f\u043e\u043b\u0435 \u00abChange project\u00bb \u0432\u0432\u043e\u0434\u0438\u043c \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0440\u0430\u043d\u0435\u0435 \u043d\u043e\u043c\u0435\u0440 \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0422\u0435\u043f\u0435\u0440\u044c \u044d\u0442\u043e\u0442 \u0441\u043a\u0440\u0438\u043f\u0442 \u0430\u0441\u0441\u043e\u0446\u0438\u0438\u0440\u043e\u0432\u0430\u043d \u0441 \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0435\u043a\u0442\u043e\u043c. <\/p>\n<h2>\u0428\u0410\u0413 4. Python REST API<\/h2>\n<p>  \u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0431\u043e\u0442\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/developers.google.com\/apps-script\/api\/reference\/rest\">REST API<\/a>. \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u044f\u0437\u044b\u043a\u0430 \u0431\u044b\u043b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d Python. <\/p>\n<h3>\u041b\u043e\u0433\u0438\u043d \u0432 Apps Script API<\/h3>\n<p>  \u041a\u043e\u0434 \u0434\u043e\u043b\u0436\u0435\u043d \u0438\u043c\u0435\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0443, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u0435\u0440\u0432\u0430\u044f \u0438 \u043e\u0447\u0435\u043d\u044c \u0432\u0430\u0436\u043d\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u2014 \u043b\u043e\u0433\u0438\u043d \u0432 Apps Script API. \u041e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443 2 -&gt; \u00abAPI \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b\u00bb -&gt; \u00ab\u0423\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\u00bb -&gt; \u00ab\u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0443\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\u00bb -&gt; \u00ab\u0418\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440 \u043a\u043b\u0438\u0435\u043d\u0442\u0430 OAuth\u00bb -&gt; \u00ab\u0414\u0440\u0443\u0433\u0438\u0435 \u0442\u0438\u043f\u044b\u00bb. \u041d\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043d\u0430\u0448 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u043d\u0435\u0433\u043e. \u041d\u0430\u0445\u043e\u0434\u044f\u0441\u044c \u0432\u043e \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u00ab\u0423\u0447\u0435\u0442\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435\u00bb, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u00ab\u0421\u043a\u0430\u0447\u0430\u0442\u044c \u0444\u0430\u0439\u043b JSON\u00bb. \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u0433\u0440\u0443\u0436\u0435\u043d \u0444\u0430\u0439\u043b \u043a\u043b\u044e\u0447\u0435\u0439 \u0434\u043b\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u0438\u0437 \u043a\u043e\u0434\u0430 \u043a \u043f\u0440\u043e\u0435\u043a\u0442\u0443 \u0432 \u0433\u0443\u0433\u043b\u0435. \u041f\u043e\u043c\u0435\u0449\u0430\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 \u043f\u0430\u043f\u043a\u0443 \u00abcredentials\u00bb.<\/p>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u0430\u0442\u044c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 API (\u0432 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 Apps Script API) \u0432 \u0440\u0430\u043c\u043a\u0430\u0445 \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0435\u043a\u0442\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u0432 \u00abAPI \u0438 \u0441\u0435\u0440\u0432\u0438\u0441\u044b\u00bb -&gt; \u00ab\u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430\u00bb -&gt; \u043d\u0430\u0431\u0438\u0440\u0430\u0435\u043c \u0432 \u043f\u043e\u0438\u0441\u043a\u0435 \u00abApps Script API\u00bb \u0438 \u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u00ab\u0412\u043a\u043b\u044e\u0447\u0438\u0442\u044c\u00bb. <\/p>\n<p>  \u041f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u0432\u0437\u0430\u0438\u043c\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0441 \u0433\u0443\u0433\u043b\u043e\u043c, \u0438\u043c\u0435\u044e\u0442 \u0441\u043a\u043e\u043f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0434\u0430\u0442\u044c \u043f\u0440\u0438 \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0435. \u042d\u0442\u043e\u0442 \u0441\u043a\u043e\u043f \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u044b\u0445 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u043c \u0438 \u0443\u0437\u043d\u0430\u0442\u044c \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e, \u043f\u0440\u043e\u0439\u0434\u044f \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0435 1 \u0432 \u043e\u043a\u043d\u0435 \u0440\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u00abFile\u00bb -&gt; \u00abProject Properties\u00bb -&gt; \u00abScopes\u00bb. \u0423\u043a\u0430\u0437\u0430\u043d\u043d\u044b\u0435 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0432 \u043a\u043e\u0434\u0435.<\/p>\n<p>  \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043b\u043e\u0433\u0438\u043d\u0430 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"python\">import pickle import os.path  from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request  def login(config):     try:         creds = None         # The file token.pickle stores the user's access and refresh tokens, and is         # created automatically when the authorization flow completes for the first         # time.         token_file = config['credentials_path'] + config['token_file']         credentials_file = config['credentials_path'] + config['credentials_file']         if os.path.exists(token_file):             with open(token_file, 'rb') as token:                 creds = pickle.load(token)         # If there are no (valid) credentials available, let the user log in.         if not creds or not creds.valid:             if creds and creds.expired and creds.refresh_token:                 creds.refresh(Request())             else:                 flow = InstalledAppFlow.from_client_secrets_file(credentials_file, config['SCOPES'])                 creds = flow.run_local_server(port=0)             # Save the credentials for the next run             with open(token_file, 'wb') as token:                 pickle.dump(creds, token)          service = build('script', 'v1', credentials=creds)         pprint('Login successful')         return service      except Exception as e:         pprint(f'Login failure: {e}')         return None <\/code><\/pre>\n<p>  \u0414\u0430\u043d\u043d\u044b\u0439 \u0431\u043b\u043e\u043a \u043a\u043e\u0434\u0430 \u2014 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0430 \u0434\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 Google App Script. <br \/>  \u041c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0442\u043e\u043a\u0435\u043d \u0438, \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u044f login, \u043b\u0438\u0431\u043e \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043d\u043e\u0432\u044b\u0439 \u0442\u043e\u043a\u0435\u043d, \u043b\u0438\u0431\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0443\u0436\u0435 \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0439. <\/p>\n<p>  \u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0431\u044b\u043b \u0441\u043e\u0437\u0434\u0430\u043d \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 JSON \u0444\u0430\u0439\u043b, \u0438\u043c\u0435\u044e\u0449\u0438\u0439 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u0438\u0434:<\/p>\n<pre><code class=\"json\">{     &quot;SCOPES&quot;: [&quot;https:\/\/www.googleapis.com\/auth\/forms&quot;,         &quot;https:\/\/www.googleapis.com\/auth\/script.send_mail&quot;],     &quot;credentials_path&quot;: &quot;credentials\/&quot;,     &quot;credentials_file&quot;: &quot;google_test_project.json&quot;,     &quot;token_file&quot;: &quot;token.pickle&quot; } <\/code><\/pre>\n<p>  <b>\u0412\u0430\u0436\u043d\u043e:<\/b> \u0442\u043e\u043a\u0435\u043d \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0441 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u043c \u0441\u043a\u043e\u043f\u043e\u043c \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438, \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u043a\u043e\u043f\u0430 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0443\u0434\u0430\u043b\u0438\u0442\u044c \u0442\u043e\u043a\u0435\u043d \u0438 \u043f\u0440\u0438 \u043b\u043e\u0433\u0438\u043d\u0435 \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043d\u043e\u0432\u044b\u0439.<\/p>\n<h3>\u0423\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u0434\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h3>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u043d\u0430\u0443\u0447\u0438\u043c\u0441\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u0434 \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0437\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u0438 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043f\u043e\u043c\u0438\u043c\u043e \u0442\u043e\u0433\u043e \u043a\u043e\u0434\u0430, \u0447\u0442\u043e \u043c\u044b \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432 \u0433\u0443\u0433\u043b\u043e\u0432\u0441\u043a\u043e\u043c \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435, \u0435\u0441\u0442\u044c \u0435\u0449\u0435 <a href=\"https:\/\/developers.google.com\/apps-script\/concepts\/manifests\">\u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0444\u0430\u0439\u043b<\/a>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u043a\u0430\u0437\u0430\u043d\u044b \u043f\u0440\u0430\u0432\u0430 \u0437\u0430\u043f\u0443\u0441\u043a\u0430, \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u0434\u0435\u043f\u043b\u043e\u0439\u043c\u0435\u043d\u0442\u0430 \u0438 \u0442.\u0434. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043e\u0437\u043d\u0430\u043a\u043e\u043c\u0438\u0442\u044c\u0441\u044f \u0441 \u0435\u0433\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e <a href=\"https:\/\/developers.google.com\/apps-script\/manifest\/\">\u0441\u0441\u044b\u043b\u043a\u0435<\/a>. <br \/>  \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0444\u0430\u0439\u043b, \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u044b\u0439 \u0433\u0443\u0433\u043b\u043e\u043c \u043a \u0432\u0430\u0448\u0435\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443, \u043f\u0440\u043e\u0439\u0434\u0438\u0442\u0435 \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u00abView\u00bb -&gt; \u00abShow manifest file\u00bb. \u041c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u043f\u043e\u044f\u0432\u0438\u0442\u0441\u044f \u0432 \u0441\u043f\u0438\u0441\u043a\u0435 \u0444\u0430\u0439\u043b\u043e\u0432, \u043e\u0442\u043d\u043e\u0441\u044f\u0449\u0438\u0445\u0441\u044f \u043a \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u0441\u043a\u0440\u0438\u043f\u0442\u0443. <\/p>\n<p>  \u0420\u0435\u0447\u044c \u043e \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0435 \u0437\u0430\u0448\u043b\u0430 \u043d\u0435\u0441\u043f\u0440\u043e\u0441\u0442\u0430: \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u043a\u043e\u0434\u0430 \u043e\u0431\u043e\u0438\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 (*.gs) \u0438 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 (appscript.json). <\/p>\n<p>  \u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0447\u0438\u0442\u0430\u0435\u043c \u043a\u043e\u0434 .gs \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0438\u0442\u044c:<\/p>\n<pre><code class=\"python\">    with open('export-google-form.gs', 'r') as f:         sample_code = f.read() <\/code><\/pre>\n<p>  \u0422\u0435\u043f\u0435\u0440\u044c \u0441\u043a\u043e\u043f\u0438\u0440\u0443\u0435\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0438 \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u043c\u043e\u0434\u0438\u0444\u0438\u0446\u0438\u0440\u0443\u0435\u043c \u0435\u0433\u043e \u043f\u043e\u0434 \u043d\u0430\u0448\u0438 \u0446\u0435\u043b\u0438. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u0441\u0447\u0435\u0440\u043f\u044b\u0432\u0430\u044e\u0449\u0435 \u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0444\u0430\u0439\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u044d\u0442\u043e\u043c \u043c\u043e\u043c\u0435\u043d\u0442\u0435 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443. \u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0432 \u0434\u0435\u0444\u043e\u043b\u0442\u043d\u044b\u0439 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442 \u0441\u0435\u043a\u0446\u0438\u044e \u00abexecutionApi\u00bb, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0447\u0435\u0440\u0435\u0437 API. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0435\u043a\u0446\u0438\u0438 \u0443\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u043c \u043a\u0440\u0443\u0433 \u043b\u0438\u0446, \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0435\u0433\u043e. \u042f \u0440\u0430\u0437\u0440\u0435\u0448\u0438\u043b \u0437\u0430\u043f\u0443\u0441\u043a \u0434\u043b\u044f \u0432\u0441\u0435\u0445, \u043a\u0442\u043e \u043f\u0440\u043e\u0448\u0435\u043b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e, \u0447\u0442\u043e \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u0438\u0434\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u043e\u0440\u0443 \u00abANYONE\u00bb:<\/p>\n<pre><code class=\"python\">MANIFEST = ''' {     &quot;timeZone&quot;: &quot;America\/New_York&quot;,     &quot;exceptionLogging&quot;: &quot;STACKDRIVER&quot;,     &quot;executionApi&quot;: {         &quot;access&quot;: &quot;ANYONE&quot;     } } '''.strip() <\/code><\/pre>\n<p>  \u0422\u0435\u043b\u043e \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u043d\u043e \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0430\u0439\u043b\u043e\u0432 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439: <\/p>\n<ul>\n<li><i>name<\/i>: \u0438\u043c\u044f \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u043d \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440\u0435, \u0431\u0435\u0437 \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f<\/li>\n<li><i>type<\/i>: \u0442\u0438\u043f \u0444\u0430\u0439\u043b\u0430 (JSON \u0434\u043b\u044f \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430, SERVER_JS \u0434\u043b\u044f .gs)<\/li>\n<li><i>source<\/i>: \u043a\u043e\u0434 \u0444\u0430\u0439\u043b\u0430<\/li>\n<\/ul>\n<p>  <\/p>\n<pre><code class=\"python\">request = {         'files': [{             'name': 'hello',             'type': 'SERVER_JS',             'source': sample_code         }, {             'name': 'appsscript',             'type': 'JSON',             'source': MANIFEST         }         ] } <\/code><\/pre>\n<p>  \u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0441\u0430\u043c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442\u044c \u0432 \u0441\u0435\u0431\u0435 \u0442\u0435\u043b\u043e (request, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0439 \u0432\u044b\u0448\u0435) \u0438 ID \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c, \u043f\u0440\u043e\u0439\u0434\u044f \u0432 \u0440\u0435\u0434\u0430\u043a\u0442\u043e\u0440\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0432 \u00abFile\u00bb -&gt; \u00abProject Properties\u00bb \u0438 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0432 \u00abScript ID\u00bb:<\/p>\n<pre><code class=\"python\">script_id = 'qwertyuiopQWERTYUIOPasdfghjkl123456789zxcvbnmASDFGHJKL54' <\/code><\/pre>\n<p>  \u0423 \u043e\u0431\u044a\u0435\u043a\u0442\u0430 service, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043b\u043e\u0433\u0438\u043d\u0430, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043f\u043e\u043b\u0435 projects() \u0438 \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 updateContent(), \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0443 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043a\u0442\u0430 HttpRequest \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u043c\u0435\u0442\u043e\u0434 execute():<\/p>\n<pre><code class=\"python\">service.projects().updateContent(         body=request,         scriptId=script_id ).execute() <\/code><\/pre>\n<p>  \u041e\u0434\u043d\u0430\u043a\u043e, \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0437\u0430\u043f\u0443\u0441\u043a \u043a\u043e\u0434\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u0442 \u043a \u043e\u0448\u0438\u0431\u043a\u0435:<\/p>\n<pre><code class=\"json\">&quot;error&quot;: {     &quot;code&quot;: 403,     &quot;message&quot;: &quot;Request had insufficient authentication scopes.&quot;,     &quot;status&quot;: &quot;PERMISSION_DENIED&quot; } <\/code><\/pre>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u0438\u043c, \u043d\u0435 \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u0439 \u0432 \u0430\u0443\u0442\u0435\u043d\u0442\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u043c \u0441\u043a\u043e\u043f\u0435, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0443\u043a\u0430\u0437\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435. \u041e\u0431\u0440\u0430\u0442\u0438\u043c\u0441\u044f \u043a \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u043f\u043e API, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u043a \u043c\u0435\u0442\u043e\u0434\u0443 <a href=\"https:\/\/developers.google.com\/apps-script\/api\/reference\/rest\/v1\/projects\/updateContent\">updateContent<\/a>, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b\u0438 \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u0414\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u044f \u0433\u043b\u0430\u0441\u0438\u0442, \u0447\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u044d\u0442\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u0440\u0430\u0437\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a script.projects:<\/p>\n<pre><code class=\"python\">https:\/\/www.googleapis.com\/auth\/script.projects<\/code><\/pre>\n<p>  \u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0435\u0433\u043e \u0432 \u043d\u0430\u0448\u0443 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b \u0432 \u0441\u0435\u043a\u0446\u0438\u044e SCOPES. \u041a\u0430\u043a \u044f \u0443\u0436\u0435 \u043f\u0438\u0441\u0430\u043b \u0432\u044b\u0448\u0435, \u043f\u0440\u0438 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u0441\u043a\u043e\u043f\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0443\u0434\u0430\u043b\u044f\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043e\u0437\u0434\u0430\u044e\u0449\u0438\u0439\u0441\u044f \u0442\u043e\u043a\u0435\u043d.<\/p>\n<p>  \u041e\u0442\u043b\u0438\u0447\u043d\u043e! \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u043c\u044b \u043d\u0430\u0443\u0447\u0438\u043b\u0438\u0441\u044c \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0433\u0443\u0433\u043b \u0441\u043a\u0440\u0438\u043f\u0442. \u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0435\u0433\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u0438 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u0417\u0430\u043f\u0443\u0441\u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/h3>\n<p>  \u0417\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 <a href=\"https:\/\/developers.google.com\/apps-script\/api\/reference\/rest\/v1\/scripts\/run\">\u0437\u0430\u043f\u0443\u0441\u043a \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/a> \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 scriptID \u0438 body \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439:<\/p>\n<ul>\n<li><i>function<\/i>: \u0438\u043c\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c<\/li>\n<li><i>parameters<\/i>: <i>(optional)<\/i> \u043d\u0430\u0431\u043e\u0440 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u043e\u0433\u043e \u0442\u0438\u043f\u0430 (string, array &#8230;), \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0435\u043c\u044b\u0445 \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e<\/li>\n<li><i>sessionState<\/i>: <i>(optional)<\/i> \u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f Android \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439<\/li>\n<li><i>devMode<\/i>: <i>(optional)<\/i> True \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0435\u0441\u043b\u0438 \u044e\u0437\u0435\u0440 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u0438 \u0442\u043e\u0433\u0434\u0430 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0443\u0449\u0435\u043d\u0430 \u0441\u0430\u043c\u0430\u044f \u0441\u0432\u0435\u0436\u0430\u044f \u0432\u0435\u0440\u0441\u0438\u044f, \u043d\u0435\u0436\u0435\u043b\u0438 \u0442\u0430, \u0447\u0442\u043e \u0437\u0430\u0434\u0435\u043f\u043b\u043e\u0435\u043d\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e Apps Script API. (\u043f\u043e \u0434\u0435\u0444\u043e\u043b\u0442\u0443 \u2014 False)<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0437\u0430\u0448\u0438\u0432\u0430\u0442\u044c URL \u0433\u0443\u0433\u043b-\u0444\u043e\u0440\u043c\u044b \u0432 \u0441\u043a\u0440\u0438\u043f\u0442\u0435, \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c <i>form_url<\/i> \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>main<\/i> \u043a\u0430\u043a \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442. <\/p>\n<p>  <b>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/b> \u041a\u043e\u0433\u0434\u0430 \u043c\u044b \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043b\u0438 \u0441\u043a\u0440\u0438\u043f\u0442, \u0442\u043e \u0444\u0443\u043d\u043a\u0446\u0438\u044f <i>main<\/i> \u043d\u0438\u0447\u0435\u0433\u043e \u043d\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u043b\u0430, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0438\u0437\u043c\u0435\u043d\u0438\u043c \u043f\u0435\u0440\u0432\u044b\u0435 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430 \u0432 .gs \u0444\u0430\u0439\u043b\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<pre><code class=\"javascript\">function main(form_url) {    var form = FormApp.openByUrl(form_url); ....... <\/code><\/pre>\n<p>  \u0422\u0430\u043a \u043a\u0430\u043a \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u043e\u0434 Android \u0438 \u043c\u044b \u044f\u0432\u043b\u044f\u0435\u043c\u0441\u044f \u0432\u043b\u0430\u0434\u0435\u043b\u044c\u0446\u0430\u043c\u0438 \u0441\u043a\u0440\u0438\u043f\u0442\u0430, \u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435 body \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u0442\u0430\u043a:<\/p>\n<pre><code class=\"python\">body = {         &quot;function&quot;: &quot;main&quot;,         &quot;devMode&quot;: True,         &quot;parameters&quot;: form_url     } <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0441\u043a\u0440\u0438\u043f\u0442 \u0438 \u0437\u0430\u043f\u0438\u0448\u0435\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e resp:<\/p>\n<pre><code class=\"python\">resp = service.scripts().run(scriptId=script_id, body=body).execute() <\/code><\/pre>\n<p>  \u0421\u043e\u0445\u0440\u0430\u043d\u0438\u043c resp \u0432 \u0444\u0430\u0439\u043b \u0441 \u0443\u0434\u043e\u0431\u043d\u044b\u043c JSON \u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435\u043c:<\/p>\n<pre><code class=\"python\">import json  with open('habr_auto.json', 'w', encoding='utf-8') as f:     json.dump(resp['response']['result'], f, ensure_ascii=False, indent=4) <\/code><\/pre>\n<p>  <b>\u0412\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/b> \u0412 \u0441\u0438\u043b\u0443 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e script.run() \u0437\u0430\u043f\u0440\u043e\u0441 \u0436\u0434\u0435\u0442 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0447\u0435\u0440\u0435\u0437 \u0441\u043e\u043a\u0435\u0442, \u0442\u043e \u043f\u0440\u0438 \u043f\u0440\u0435\u0432\u044b\u0448\u0435\u043d\u0438\u0438 \u0442\u0430\u0439\u043c\u0430\u0443\u0442\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f, \u043f\u0440\u043e\u0438\u0437\u043e\u0439\u0434\u0435\u0442 \u043e\u0448\u0438\u0431\u043a\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0442\u0438\u043f\u0430:<\/p>\n<pre><code class=\"python\">socket.timeout: The read operation timed out <\/code><\/pre>\n<p>  \u0414\u043b\u044f \u0438\u0437\u0431\u0435\u0436\u0430\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u043e\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e \u0432 \u043d\u0430\u0447\u0430\u043b\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043b\u0438\u043c\u0438\u0442 \u043d\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0441\u043e\u043a\u0435\u0442\u0430, \u0437\u0430\u0432\u0435\u0434\u043e\u043c\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e\u0435 \u0434\u043b\u044f \u0442\u043e\u0433\u043e \u0447\u0442\u043e\u0431\u044b \u043e\u043d \u0434\u043e\u0436\u0434\u0430\u043b\u0441\u044f \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0441\u043a\u0440\u0438\u043f\u0442\u0430. \u0412 \u043c\u043e\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 120 \u0441\u0435\u043a\u0443\u043d\u0434 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e:<\/p>\n<pre><code class=\"python\">import socket  socket.setdefaulttimeout(120) <\/code><\/pre>\n<p>  \u0412\u0443\u0430\u043b\u044f! \u0423\u0434\u043e\u0431\u043d\u044b\u0439 \u043f\u0430\u0439\u043f\u043b\u0430\u0439\u043d \u0434\u043b\u044f \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u0438 \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0433\u0443\u0433\u043b \u0441\u043a\u0440\u0438\u043f\u0442\u043e\u0432 \u0433\u043e\u0442\u043e\u0432. \u041f\u043e\u043b\u043d\u044b\u0439 \u043a\u043e\u0434 \u0441, \u043f\u0440\u0438\u0441\u043f\u043e\u0441\u043e\u0431\u043b\u0435\u043d\u043d\u044b\u0439 \u043a \u0437\u0430\u043f\u0443\u0441\u043a\u0443 \u0438\u0437 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0430 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d \u0432 \u043c\u043e\u0435\u043c <a href=\"https:\/\/github.com\/nikanor97\/habr_google_script_api\">\u0433\u0438\u0442\u0445\u0430\u0431\u0435<\/a>.<\/p>\n<p>  \u0422\u0430\u043a\u0436\u0435, \u043f\u0440\u0438\u0432\u0435\u0434\u0443 \u043a\u043e\u0434 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u043d\u0438\u0436\u0435<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">login.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">from pprint import pprint import pickle import os.path  from googleapiclient.discovery import build from google_auth_oauthlib.flow import InstalledAppFlow from google.auth.transport.requests import Request   def login(config):     try:         creds = None         # The file token.pickle stores the user's access and refresh tokens, and is         # created automatically when the authorization flow completes for the first         # time.         token_file = config['credentials_path'] + config['token_file']         credentials_file = config['credentials_path'] + config['credentials_file']         if os.path.exists(token_file):             with open(token_file, 'rb') as token:                 creds = pickle.load(token)         # If there are no (valid) credentials available, let the user log in.         if not creds or not creds.valid:             if creds and creds.expired and creds.refresh_token:                 creds.refresh(Request())             else:                 flow = InstalledAppFlow.from_client_secrets_file(credentials_file, config['SCOPES'])                 creds = flow.run_local_server(port=0)             # Save the credentials for the next run             with open(token_file, 'wb') as token:                 pickle.dump(creds, token)          service = build('script', 'v1', credentials=creds)         pprint('Login successful')         return service      except Exception as e:         pprint(f'Login failure: {e}')         return None <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">update_script.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">from pprint import pprint import json import sys  from googleapiclient import errors  from google_habr_login import login  MANIFEST = ''' {     &quot;timeZone&quot;: &quot;America\/New_York&quot;,     &quot;exceptionLogging&quot;: &quot;STACKDRIVER&quot;,     &quot;executionApi&quot;: {         &quot;access&quot;: &quot;ANYONE&quot;     } } '''.strip()   def update_project(service, script_id, script_file_name):     # Read from file code we want to deploy     with open(script_file_name, 'r') as f:         sample_code = f.read()      # Upload two files to the project     request = {         'files': [{             'name': 'hello',             'type': 'SERVER_JS',             'source': sample_code         }, {             'name': 'appsscript',             'type': 'JSON',             'source': MANIFEST         }         ]     }      # Update files in the project     service.projects().updateContent(         body=request,         scriptId=script_id     ).execute()      pprint('Project was successfully updated')   def main():      try:          args = sys.argv         if len(args) != 4:             raise TypeError('Wrong number of arguments. Three argument required: &lt;config_file_name&gt;, &lt;script_id&gt; and '                              '&lt;script_file_name&gt;')         config_file_name = args[1]         script_id = args[2]         script_file_name = args[3]          with open(config_file_name, &quot;r&quot;) as f:             config = json.load(f)          service = login(config)          update_project(service, script_id, script_file_name)      except (errors.HttpError, ) as error:         # The API encountered a problem.         pprint(error.content.decode('utf-8'))   if __name__ == '__main__':     main()  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<div class=\"spoiler\"><b class=\"spoiler_title\">export_form.py<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"python\">from pprint import pprint import socket import json import sys  from googleapiclient import errors  from google_habr_login import login   socket.setdefaulttimeout(120)   # Get JSON, which is returned by script def get_json(service, file_name, script_id, form_url):     pprint('Exporting form...')     body = {         &quot;function&quot;: &quot;main&quot;,         &quot;devMode&quot;: True,         &quot;parameters&quot;: form_url     }     # Get JSON from script     resp = service.scripts().run(scriptId=script_id, body=body).execute()      # Write out JSON to file     with open(file_name, 'w', encoding='utf-8') as f:         json.dump(resp['response']['result'], f, ensure_ascii=False, indent=4)      pprint('Form was successfully exported')   def main():      try:          args = sys.argv         if len(args) != 5:             raise TypeError('Wrong number of arguments. Four arguments required:  &lt;config_file_name&gt;, '                             '&lt;result_file_name&gt;, &lt;script_id&gt; and &lt;google_form_url&gt;')         config_file_name = args[1]         file_name = args[2]         script_id = args[3]         form_url = args[4]          with open(config_file_name, &quot;r&quot;) as f:             config = json.load(f)          service = login(config)          get_json(service, file_name, script_id, form_url)      except (errors.HttpError, ) as error:         # The API encountered a problem.         pprint(error.content.decode('utf-8'))   if __name__ == '__main__':     main()  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u043e\u043c\u0435\u0441\u0442\u0438\u0442\u044c JSON \u0444\u0430\u0439\u043b \u0441 \u043a\u043b\u044e\u0447\u0430\u043c\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0430 \u043a \u0433\u0443\u0433\u043b\u0443 \u0432 \u043f\u0430\u043f\u043a\u0443 \u00abcredentials\u00bb, \u0430 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 JSON \u0432 \u043e\u0434\u043d\u043e\u0439 \u0434\u0438\u0440\u0435\u043a\u0442\u043e\u0440\u0438\u0438 \u0441\u043e \u0441\u043a\u0440\u0438\u043f\u0442\u0430\u043c\u0438. <\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043a\u0440\u0438\u043f\u0442, \u0442\u043e \u0432 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b\u0435 \u0432\u044b\u0437\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"bash\">python update_script.py &lt;config_file_name&gt; &lt;script_id&gt; &lt;script_file_name&gt; <\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435:<\/p>\n<ul>\n<li><i>config_file_name<\/i> \u2014 \u0438\u043c\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e JSON \u0444\u0430\u0439\u043b\u0430<\/li>\n<li><i>script_id<\/i> \u2014 ID \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/li>\n<li><i>script_file_name<\/i> \u2014 \u0438\u043c\u044f .gs \u0444\u0430\u0439\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043b\u0438\u0442 \u0432 \u0433\u0443\u0433\u043b<\/li>\n<\/ul>\n<p>  \u0414\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0441\u043a\u0440\u0438\u043f\u0442\u0430 \u043d\u0430\u0434\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c:<\/p>\n<pre><code class=\"bash\">python export_form.py &lt;config_file_name&gt; &lt;result_file_name&gt; &lt;script_id&gt; &lt;google_form_url&gt; <\/code><\/pre>\n<p>  \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435:<\/p>\n<ul>\n<li><i>config_file_name<\/i> \u2014 \u0438\u043c\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e JSON \u0444\u0430\u0439\u043b\u0430<\/li>\n<li><i>result_file_name<\/i> \u2014 \u0438\u043c\u044f JSON \u0444\u0430\u0439\u043b\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u0432\u044b\u0433\u0440\u0443\u0436\u0435\u043d\u0430 \u0444\u043e\u0440\u043c\u0430<\/li>\n<li><i>script_id<\/i> \u2014 ID \u0441\u043a\u0440\u0438\u043f\u0442\u0430<\/li>\n<li><i>google_form_url<\/i> \u2014 URL \u0433\u0443\u0433\u043b-\u0444\u043e\u0440\u043c\u044b<\/li>\n<\/ul>\n<p>  \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0436\u0434\u0443 \u0432\u0430\u0448\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0438 \ud83d\ude42<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/485898\/\"> https:\/\/habr.com\/ru\/post\/485898\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/485898\/\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/webt\/gi\/tl\/nl\/gitlnlklzpbmybk3jz3utl4_uow.png\"\/><\/p>\n<p>  \u0423 \u043d\u0430\u0441 \u0431\u044b\u043b\u043e \u0434\u0432\u0435 \u0433\u0443\u0433\u043b-\u0444\u043e\u0440\u043c\u044b, 75 \u0432\u043e\u043f\u0440\u043e\u0441\u043e\u0432 \u0432 \u043a\u0430\u0436\u0434\u043e\u0439, 5 \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0430\u043a\u0442\u0438\u0432\u043d\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u0438 \u044d\u0442\u0438 \u0444\u043e\u0440\u043c\u044b, \u0430 \u0435\u0449\u0435 \u0433\u0443\u0433\u043b-\u0441\u043a\u0440\u0438\u043f\u0442, \u044d\u043a\u0441\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u044e\u0449\u0438\u0439 \u0444\u043e\u0440\u043c\u0443 \u0432 JSON. \u041d\u0435 \u0442\u043e \u0447\u0442\u043e \u0431\u044b \u0435\u0433\u043e \u0431\u044b\u043b\u043e \u0441\u043b\u043e\u0436\u043d\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0440\u0430\u0437 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438, \u043d\u043e \u0440\u0430\u0437 \u043d\u0430\u0447\u0430\u043b \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u044e \u0440\u0430\u0431\u043e\u0442\u0443, \u0442\u043e \u0438\u0434\u0438 \u0432 \u044d\u0442\u043e\u043c \u0443\u0432\u043b\u0435\u0447\u0435\u043d\u0438\u0438 \u0434\u043e \u043a\u043e\u043d\u0446\u0430.<\/p>\n<p>  \u0412 \u043e\u0444\u0438\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0434\u043e\u043a\u0443\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 \u0441\u0430\u043c \u0447\u0435\u0440\u0442 \u043d\u043e\u0433\u0443 \u0441\u043b\u043e\u043c\u0438\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043f\u043e\u0434 \u043a\u0430\u0442\u043e\u043c \u043c\u044b \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0443\u0434\u0430\u043b\u0435\u043d\u043d\u0443\u044e \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0443 \u0438 \u0437\u0430\u043f\u0443\u0441\u043a Google Apps Script \u0447\u0435\u0440\u0435\u0437 REST API, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f Python.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-297821","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297821","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=297821"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/297821\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=297821"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=297821"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=297821"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}