Apps Script API के साथ फ़ंक्शन एक्ज़ीक्यूट करना

Google Apps Script API, scripts.run तरीका जो चुने गए Apps Script फ़ंक्शन को रिमोट तरीके से एक्ज़ीक्यूट करती है. यह तरीका अपनाया जा सकता है कॉलिंग ऐप्लिकेशन में, अपने किसी स्क्रिप्ट प्रोजेक्ट में फ़ंक्शन चलाने के लिए दूर से ही जवाब पाएँ.

ज़रूरी शर्तें

कॉल करने के लिए कोई ऐप्लिकेशन इस्तेमाल करने से पहले, आपको ये ज़रूरी शर्तें पूरी करनी होंगी scripts.run तरीका. आपको ये काम करने होंगे:

  • स्क्रिप्ट प्रोजेक्ट को एपीआई एक्ज़ीक्यूटेबल एपीआई के तौर पर डिप्लॉय करें. आप ज़रूरत के हिसाब से प्रोजेक्ट को डिप्लॉय, डिप्लॉय, और फिर से डिप्लॉय करें.

  • लागू करने के लिए, सही स्कोप वाला OAuth टोकन दें. इस OAuth टोकन में सभी स्कोप शामिल होने चाहिए इनका इस्तेमाल स्क्रिप्ट में किया जाता है, न कि सिर्फ़ उन्हें जिनका इस्तेमाल कॉल किए गए फ़ंक्शन में किया जाता है. ज़्यादा जानकारी के लिए, अनुमति के दायरे की पूरी सूची .

  • पक्का करें कि स्क्रिप्ट और कॉलिंग ऐप्लिकेशन का OAuth2 क्लाइंट एक सामान्य Google Cloud प्रोजेक्ट शेयर करते हैं. Cloud प्रोजेक्ट, स्टैंडर्ड Cloud प्रोजेक्ट होना चाहिए; Apps Script प्रोजेक्ट के लिए बनाए गए डिफ़ॉल्ट प्रोजेक्ट काफ़ी नहीं हैं. आपके पास नए स्टैंडर्ड Cloud प्रोजेक्ट या किसी मौजूदा प्रोजेक्ट का इस्तेमाल करने का विकल्प है.

  • Google Apps Script API को चालू करना को मैनेज किया जा सकता है.

scripts.run तरीका

scripts.run इस तरीके को चलाने के लिए, पहचान करने वाली मुख्य जानकारी की ज़रूरत होती है:

स्क्रिप्ट को डेवलपमेंट मोड में चलाने के लिए, वैकल्पिक रूप से कॉन्फ़िगर भी किया जा सकता है. यह मोड, स्क्रिप्ट प्रोजेक्ट के सबसे हाल ही में सेव किए गए वर्शन पर काम करता है हाल ही में डिप्लॉय किए गए वर्शन की जगह. इसे सेट करके ऐसा करें: devMode बूलियन अनुरोध का मुख्य हिस्सा true तक. स्क्रिप्ट का मालिक ही इसे डेवलपमेंट मोड में लागू कर सकता है.

पैरामीटर के डेटा टाइप को हैंडल करना

Apps Script API का इस्तेमाल करना scripts.run तरीका आम तौर पर, इसमें फ़ंक्शन पैरामीटर के तौर पर Apps Script में डेटा भेजना और फ़ंक्शन रिटर्न वैल्यू के रूप में डेटा को वापस पाना. एपीआई सिर्फ़ जानकारी ले सकता है और जवाब दे सकता है बुनियादी टाइप वाली वैल्यू: स्ट्रिंग, अरे, ऑब्जेक्ट, संख्याएं, और बूलियन. ये JavaScript के बुनियादी टाइप से मिलते-जुलते होते हैं. ज़्यादा मुश्किल Apps Script ऑब्जेक्ट, जैसे कि Document या शीट को या API के ज़रिए स्क्रिप्ट प्रोजेक्ट से हटाया जा सकता है.

जब कॉल करने के लिए इस्तेमाल किया जाने वाला ऐप्लिकेशन, बहुत ज़्यादा जानकारी देने वाली भाषा में लिखा हो, जैसे कि Java का इस्तेमाल करके, यह पैरामीटर में किसी सूची या सामान्य ऑब्जेक्ट के कलेक्शन के तौर पर पास होता है इन बुनियादी टाइप के हिसाब से होनी चाहिए. कई मामलों में, विज्ञापन देने वालों के लिए, अपने आप रूपांतरण टाइप करता है. उदाहरण के लिए, ऐसा फ़ंक्शन जो संख्या लेता है पैरामीटर को Java Double, Integer या Long ऑब्जेक्ट अतिरिक्त हैंडलिंग के बिना एक पैरामीटर.

जब एपीआई फ़ंक्शन से जवाब देता है, तो आपको अक्सर इसका इस्तेमाल करने से पहले, सही टाइप में वैल्यू दी गई है. यहां कुछ Java पर आधारित उदाहरण:

  • API के ज़रिए Java ऐप्लिकेशन को लौटाए गए नंबर इस तरह आते हैं java.math.BigDecimal ऑब्जेक्ट हैं और इन्हें इन्हें बदलना पड़ सकता है ज़रूरत के हिसाब से Doubles या int टाइप.
  • अगर Apps Script फ़ंक्शन, स्ट्रिंग का अरे दिखाता है, तो Java ऐप्लिकेशन रिस्पॉन्स को List<String> ऑब्जेक्ट में कास्ट करता है:

    List<String> mylist = (List<String>)(op.getResponse().get("result"));
    
  • अगर आपको Bytes वाला कलेक्शन दिखाना है, तो यह आपके लिए काम का हो सकता है का इस्तेमाल करके, अरे को Apps Script फ़ंक्शन में Base64 स्ट्रिंग के तौर पर एन्कोड किया जा सकता है. इसके बजाय वह स्ट्रिंग लौटा दें:

    return Utilities.base64Encode(myByteArray); // returns a String.
    

नीचे उदाहरण के तौर पर दिए गए कोड के सैंपल में, ऐसे तरीके बताए गए हैं जिनसे हम एपीआई से मिले रिस्पॉन्स को समझने की कोशिश करते हैं.

सामान्य प्रक्रिया

Apps Script API इस्तेमाल करने की सामान्य प्रोसेस के बारे में यहां बताया गया है Apps Script फ़ंक्शन को एक्ज़ीक्यूट करने के लिए:

पहला चरण: सामान्य Cloud प्रोजेक्ट सेट अप करना

आपकी स्क्रिप्ट और कॉलिंग ऐप्लिकेशन, दोनों को एक जैसा शेयर करना होगा Cloud प्रोजेक्ट शामिल है. यह Cloud प्रोजेक्ट कोई मौजूदा प्रोजेक्ट हो सकता है या इस मकसद के लिए बनाया गया एक नया प्रोजेक्ट. Cloud प्रोजेक्ट बनाने के बाद, आपको आपको उसका इस्तेमाल करने के लिए, स्क्रिप्ट प्रोजेक्ट को स्विच करना होगा.

दूसरा चरण: स्क्रिप्ट को लागू किए जा सकने वाले एपीआई के तौर पर डिप्लॉय करें

  1. आपको जिस फ़ंक्शन का इस्तेमाल करना है उसके साथ Apps Script प्रोजेक्ट खोलें.
  2. सबसे ऊपर दाईं ओर, डिप्लॉय करें &gt; नया डिप्लॉयमेंट पर क्लिक करें.
  3. इसके बाद, खुलने वाले डायलॉग बॉक्स में, 'डिप्लॉयमेंट टाइप चालू करें' पर क्लिक करें &gt; एपीआई एक्ज़ीक्यूट किया जा सकता है.
  4. "जिनके पास ऐक्सेस है" सेक्शन में ड्रॉप-डाउन मेन्यू से, वे उपयोगकर्ता चुनें जिन्हें को Apps Script API का इस्तेमाल करके, स्क्रिप्ट के फ़ंक्शन कॉल करने की अनुमति है.
  5. डिप्लॉय करें पर क्लिक करें.

तीसरा चरण: कॉल करने के लिए इस्तेमाल होने वाले ऐप्लिकेशन को कॉन्फ़िगर करें

कॉलिंग ऐप्लिकेशन को Apps Script API चालू करना होगा और OAuth सेट अप करना होगा क्रेंडेंशियल को कब और कितनी बार इस्तेमाल किया जा सकता है. आपके पास Cloud प्रोजेक्ट का ऐक्सेस होना चाहिए आपको ऐसा करना होगा.

  1. वह Cloud प्रोजेक्ट कॉन्फ़िगर करें जिसका इस्तेमाल, कॉल करने वाले ऐप्लिकेशन और स्क्रिप्ट कर रहे हैं. ऐसा करने के लिए, नीचे दिया गया तरीका अपनाएं:
    1. Cloud प्रोजेक्ट में Apps Script API को चालू करें.
    2. उस स्क्रीन को कॉन्फ़िगर करें जहां OAuth के लिए सहमति दी जाती है.
    3. OAuth क्रेडेंशियल बनाएं.
  2. स्क्रिप्ट प्रोजेक्ट खोलें और बाईं ओर, खास जानकारी पर क्लिक करें.
  3. प्रोजेक्ट OAuth के दायरे में जाकर, वे सभी स्कोप रिकॉर्ड करें जिन्हें स्क्रिप्ट आवश्यक है.
  4. कॉलिंग ऐप्लिकेशन कोड में, स्क्रिप्ट OAuth ऐक्सेस टोकन जनरेट करें एपीआई कॉल के लिए. यह कोई टोकन नहीं है जिसका इस्तेमाल एपीआई खुद करता है. यह एक ऐसा टोकन है जिसका इस्तेमाल स्क्रिप्ट को एक्ज़ीक्यूट करते समय इसकी ज़रूरत होती है. इसे Cloud प्रोजेक्ट का क्लाइंट आईडी और स्क्रिप्ट के वे दायरे जिन्हें आपने रिकॉर्ड किया है.

    Google की क्लाइंट लाइब्रेरी का इस्तेमाल करना इस टोकन को बनाने और ऐप्लिकेशन के लिए OAuth को हैंडल करने में मदद करते हैं, तो आम तौर पर इसकी मदद से आपको बड़े लेवल के "क्रेडेंशियल" बनाने की सुविधा मिलती है ऑब्जेक्ट करने के लिए स्क्रिप्ट के दायरे का इस्तेमाल करें. ज़्यादा जानकारी के लिए, उदाहरणों के लिए Apps Script API क्विकस्टार्ट स्कोप की सूची से क्रेडेंशियल ऑब्जेक्ट बनाया जा सकता है.

चौथा चरण: script.run का अनुरोध करना

कॉलिंग ऐप्लिकेशन कॉन्फ़िगर होने के बाद, scripts.run कॉल. हर एपीआई कॉल के लिए ये चरण पूरे होते हैं:

  1. कोई एपीआई अनुरोध बनाएं स्क्रिप्ट आईडी, फ़ंक्शन के नाम वगैरह का इस्तेमाल करके पैरामीटर का इस्तेमाल करें.
  2. scripts.run बनाओ को कॉल करें और उसमें आपके द्वारा बनाए गए स्क्रिप्ट OAuth टोकन को शामिल करें हेडर (अगर बेसिक POST अनुरोध का इस्तेमाल किया जा रहा है) या क्रेडेंशियल ऑब्जेक्ट का इस्तेमाल करें जिन्हें आपने स्क्रिप्ट के दायरे से बनाया है.
  3. स्क्रिप्ट को एक्ज़ीक्यूट करने की अनुमति दें. स्क्रिप्ट को इतने समय तक की अनुमति है छह मिनट की समयसीमा तय की गई है, इसलिए आपके ऐप्लिकेशन को भी यह अनुमति मिलनी चाहिए.
  4. पूरा होने के बाद, स्क्रिप्ट फ़ंक्शन कोई वैल्यू दिखा सकता है, जिसे एपीआई अगर वैल्यू के फ़ॉर्मैट में है, तो ऐप्लिकेशन को फिर से डिलीवर करता है.

आपको script.run एपीआई कॉल के उदाहरण दिख सकते हैं देखें.

एपीआई अनुरोध के उदाहरण

नीचे दिए गए उदाहरणों में, Apps Script API को एक्ज़ीक्यूट करने का अनुरोध करने का तरीका बताया गया है जिसमें अलग-अलग भाषाओं की सूची को प्रिंट करने के लिए Apps Script फ़ंक्शन का इस्तेमाल किया जाता है. फ़ोल्डर, उपयोगकर्ता की रूट डायरेक्ट्री में मौजूद होना चाहिए. Apps Script प्रोजेक्ट का स्क्रिप्ट आईडी जहां एक्ज़ीक्यूट किया गया फ़ंक्शन शामिल है वहां इस बात की जानकारी दी जानी चाहिए ENTER_YOUR_SCRIPT_ID_HERE. ये उदाहरण Google API क्लाइंट लाइब्रेरी से जुड़ी जानकारी भाषाएं.

टारगेट स्क्रिप्ट

इस स्क्रिप्ट का फ़ंक्शन, Drive API का इस्तेमाल करता है.

आपको इसमें Drive API चालू करना होगा: स्क्रिप्ट होस्ट करने वाला प्रोजेक्ट.

इसके अलावा, कॉल करने वाले ऐप्लिकेशन को OAuth क्रेडेंशियल भेजना होगा. इसमें यह जानकारी शामिल होनी चाहिए नीचे दी गई Drive का दायरा:

  • https://www.googleapis.com/auth/drive

उदाहरण के तौर पर दिए गए ऐप्लिकेशन, Google क्लाइंट लाइब्रेरी का इस्तेमाल करके इस स्कोप का इस्तेमाल करने वाले OAuth के लिए क्रेडेंशियल ऑब्जेक्ट.

/**
 * Return the set of folder names contained in the user's root folder as an
 * object (with folder IDs as keys).
 * @return {Object} A set of folder names keyed by folder ID.
 */
function getFoldersUnderRoot() {
  const root = DriveApp.getRootFolder();
  const folders = root.getFolders();
  const folderSet = {};
  while (folders.hasNext()) {
    const folder = folders.next();
    folderSet[folder.getId()] = folder.getName();
  }
  return folderSet;
}

Java


/**
 * Create a HttpRequestInitializer from the given one, except set
 * the HTTP read timeout to be longer than the default (to allow
 * called scripts time to execute).
 *
 * @param {HttpRequestInitializer} requestInitializer the initializer
 *                                 to copy and adjust; typically a Credential object.
 * @return an initializer with an extended read timeout.
 */
private static HttpRequestInitializer setHttpTimeout(
    final HttpRequestInitializer requestInitializer) {
  return new HttpRequestInitializer() {
    @Override
    public void initialize(HttpRequest httpRequest) throws IOException {
      requestInitializer.initialize(httpRequest);
      // This allows the API to call (and avoid timing out on)
      // functions that take up to 6 minutes to complete (the maximum
      // allowed script run time), plus a little overhead.
      httpRequest.setReadTimeout(380000);
    }
  };
}

/**
 * Build and return an authorized Script client service.
 *
 * @param {Credential} credential an authorized Credential object
 * @return an authorized Script client service
 */
public static Script getScriptService() throws IOException {
  Credential credential = authorize();
  return new Script.Builder(
      HTTP_TRANSPORT, JSON_FACTORY, setHttpTimeout(credential))
      .setApplicationName(APPLICATION_NAME)
      .build();
}

/**
 * Interpret an error response returned by the API and return a String
 * summary.
 *
 * @param {Operation} op the Operation returning an error response
 * @return summary of error response, or null if Operation returned no
 * error
 */
public static String getScriptError(Operation op) {
  if (op.getError() == null) {
    return null;
  }

  // Extract the first (and only) set of error details and cast as a Map.
  // The values of this map are the script's 'errorMessage' and
  // 'errorType', and an array of stack trace elements (which also need to
  // be cast as Maps).
  Map<String, Object> detail = op.getError().getDetails().get(0);
  List<Map<String, Object>> stacktrace =
      (List<Map<String, Object>>) detail.get("scriptStackTraceElements");

  java.lang.StringBuilder sb =
      new StringBuilder("\nScript error message: ");
  sb.append(detail.get("errorMessage"));
  sb.append("\nScript error type: ");
  sb.append(detail.get("errorType"));

  if (stacktrace != null) {
    // There may not be a stacktrace if the script didn't start
    // executing.
    sb.append("\nScript error stacktrace:");
    for (Map<String, Object> elem : stacktrace) {
      sb.append("\n  ");
      sb.append(elem.get("function"));
      sb.append(":");
      sb.append(elem.get("lineNumber"));
    }
  }
  sb.append("\n");
  return sb.toString();
}

public static void main(String[] args) throws IOException {
  // ID of the script to call. Acquire this from the Apps Script editor,
  // under Publish > Deploy as API executable.
  String scriptId = "ENTER_YOUR_SCRIPT_ID_HERE";
  Script service = getScriptService();

  // Create an execution request object.
  ExecutionRequest request = new ExecutionRequest()
      .setFunction("getFoldersUnderRoot");

  try {
    // Make the API request.
    Operation op =
        service.scripts().run(scriptId, request).execute();

    // Print results of request.
    if (op.getError() != null) {
      // The API executed, but the script returned an error.
      System.out.println(getScriptError(op));
    } else {
      // The result provided by the API needs to be cast into
      // the correct type, based upon what types the Apps
      // Script function returns. Here, the function returns
      // an Apps Script Object with String keys and values,
      // so must be cast into a Java Map (folderSet).
      Map<String, String> folderSet =
          (Map<String, String>) (op.getResponse().get("result"));
      if (folderSet.size() == 0) {
        System.out.println("No folders returned!");
      } else {
        System.out.println("Folders under your root folder:");
        for (String id : folderSet.keySet()) {
          System.out.printf(
              "\t%s (%s)\n", folderSet.get(id), id);
        }
      }
    }
  } catch (GoogleJsonResponseException e) {
    // The API encountered a problem before the script was called.
    e.printStackTrace(System.out);
  }
}

JavaScript

/**
 * Load the API and make an API call.  Display the results on the screen.
 */
function callScriptFunction() {
  const scriptId = '<ENTER_YOUR_SCRIPT_ID_HERE>';

  // Call the Apps Script API run method
  //   'scriptId' is the URL parameter that states what script to run
  //   'resource' describes the run request body (with the function name
  //              to execute)
  try {
    gapi.client.script.scripts.run({
      'scriptId': scriptId,
      'resource': {
        'function': 'getFoldersUnderRoot',
      },
    }).then(function(resp) {
      const result = resp.result;
      if (result.error && result.error.status) {
        // The API encountered a problem before the script
        // started executing.
        appendPre('Error calling API:');
        appendPre(JSON.stringify(result, null, 2));
      } else if (result.error) {
        // The API executed, but the script returned an error.

        // Extract the first (and only) set of error details.
        // The values of this object are the script's 'errorMessage' and
        // 'errorType', and an array of stack trace elements.
        const error = result.error.details[0];
        appendPre('Script error message: ' + error.errorMessage);

        if (error.scriptStackTraceElements) {
          // There may not be a stacktrace if the script didn't start
          // executing.
          appendPre('Script error stacktrace:');
          for (let i = 0; i < error.scriptStackTraceElements.length; i++) {
            const trace = error.scriptStackTraceElements[i];
            appendPre('\t' + trace.function + ':' + trace.lineNumber);
          }
        }
      } else {
        // The structure of the result will depend upon what the Apps
        // Script function returns. Here, the function returns an Apps
        // Script Object with String keys and values, and so the result
        // is treated as a JavaScript object (folderSet).

        const folderSet = result.response.result;
        if (Object.keys(folderSet).length == 0) {
          appendPre('No folders returned!');
        } else {
          appendPre('Folders under your root folder:');
          Object.keys(folderSet).forEach(function(id) {
            appendPre('\t' + folderSet[id] + ' (' + id + ')');
          });
        }
      }
    });
  } catch (err) {
    document.getElementById('content').innerText = err.message;
    return;
  }
}

Node.js

/**
 * Call an Apps Script function to list the folders in the user's root Drive
 * folder.
 *
 */
async function callAppsScript() {
  const scriptId = '1xGOh6wCm7hlIVSVPKm0y_dL-YqetspS5DEVmMzaxd_6AAvI-_u8DSgBT';

  const {GoogleAuth} = require('google-auth-library');
  const {google} = require('googleapis');

  // Get credentials and build service
  // TODO (developer) - Use appropriate auth mechanism for your app
  const auth = new GoogleAuth({
    scopes: 'https://www.googleapis.com/auth/drive',
  });
  const script = google.script({version: 'v1', auth});

  try {
    // Make the API request. The request object is included here as 'resource'.
    const resp = await script.scripts.run({
      auth: auth,
      resource: {
        function: 'getFoldersUnderRoot',
      },
      scriptId: scriptId,
    });
    if (resp.error) {
      // The API executed, but the script returned an error.

      // Extract the first (and only) set of error details. The values of this
      // object are the script's 'errorMessage' and 'errorType', and an array
      // of stack trace elements.
      const error = resp.error.details[0];
      console.log('Script error message: ' + error.errorMessage);
      console.log('Script error stacktrace:');

      if (error.scriptStackTraceElements) {
        // There may not be a stacktrace if the script didn't start executing.
        for (let i = 0; i < error.scriptStackTraceElements.length; i++) {
          const trace = error.scriptStackTraceElements[i];
          console.log('\t%s: %s', trace.function, trace.lineNumber);
        }
      }
    } else {
      // The structure of the result will depend upon what the Apps Script
      // function returns. Here, the function returns an Apps Script Object
      // with String keys and values, and so the result is treated as a
      // Node.js object (folderSet).
      const folderSet = resp.response.result;
      if (Object.keys(folderSet).length == 0) {
        console.log('No folders returned!');
      } else {
        console.log('Folders under your root folder:');
        Object.keys(folderSet).forEach(function(id) {
          console.log('\t%s (%s)', folderSet[id], id);
        });
      }
    }
  } catch (err) {
    // TODO(developer) - Handle error
    throw err;
  }
}

Python

import google.auth
from googleapiclient.discovery import build
from googleapiclient.errors import HttpError


def main():
  """Runs the sample."""
  # pylint: disable=maybe-no-member
  script_id = "1VFBDoJFy6yb9z7-luOwRv3fCmeNOzILPnR4QVmR0bGJ7gQ3QMPpCW-yt"

  creds, _ = google.auth.default()
  service = build("script", "v1", credentials=creds)

  # Create an execution request object.
  request = {"function": "getFoldersUnderRoot"}

  try:
    # Make the API request.
    response = service.scripts().run(scriptId=script_id, body=request).execute()
    if "error" in response:
      # The API executed, but the script returned an error.
      # Extract the first (and only) set of error details. The values of
      # this object are the script's 'errorMessage' and 'errorType', and
      # a list of stack trace elements.
      error = response["error"]["details"][0]
      print(f"Script error message: {0}.{format(error['errorMessage'])}")

      if "scriptStackTraceElements" in error:
        # There may not be a stacktrace if the script didn't start
        # executing.
        print("Script error stacktrace:")
        for trace in error["scriptStackTraceElements"]:
          print(f"\t{0}: {1}.{format(trace['function'], trace['lineNumber'])}")
    else:
      # The structure of the result depends upon what the Apps Script
      # function returns. Here, the function returns an Apps Script
      # Object with String keys and values, and so the result is
      # treated as a Python dictionary (folder_set).
      folder_set = response["response"].get("result", {})
      if not folder_set:
        print("No folders returned!")
      else:
        print("Folders under your root folder:")
        for folder_id, folder in folder_set.items():
          print(f"\t{0} ({1}).{format(folder, folder_id)}")

  except HttpError as error:
    # The API encountered a problem before the script started executing.
    print(f"An error occurred: {error}")
    print(error.content)


if __name__ == "__main__":
  main()

सीमाएं

Apps Script API की कई सीमाएं हैं:

  1. एक सामान्य Cloud प्रोजेक्ट. जिस स्क्रिप्ट को कॉल किया जा रहा है और कॉलिंग ऐप्लिकेशन को एक क्लाउड प्रोजेक्ट शेयर करना होगा. Cloud प्रोजेक्ट स्टैंडर्ड Cloud प्रोजेक्ट; Apps Script प्रोजेक्ट के लिए बनाए गए डिफ़ॉल्ट प्रोजेक्ट काफ़ी नहीं हैं. कॉन्टेंट बनाने स्टैंडर्ड Cloud प्रोजेक्ट, नया या मौजूदा प्रोजेक्ट हो सकता है.

  2. बेसिक पैरामीटर और रिटर्न टाइप. एपीआई, अनुरोध को पास नहीं कर सकता या वापस नहीं कर सकता Apps Script के लिए खास ऑब्जेक्ट (जैसे, दस्तावेज़, ब्लब, कैलेंडर, Drive फ़ाइलें, वगैरह) का इस्तेमाल करें. सिर्फ़ बेसिक टाइप, जैसे कि स्ट्रिंग, अरे, ऑब्जेक्ट, नंबर, और बूलियन पास किए जा सकते हैं और दिखाए जा सकते हैं.

  3. OAuth के दायरे. एपीआई सिर्फ़ उन स्क्रिप्ट को एक्ज़ीक्यूट कर सकता है जिनमें कम से कम एक आवश्यक दायरा. इसका मतलब है कि स्क्रिप्ट को कॉल करने के लिए, एपीआई का इस्तेमाल नहीं किया जा सकता इसके लिए, एक या उससे ज़्यादा सेवाओं की अनुमति लेने की ज़रूरत न हो.

  4. कोई ट्रिगर नहीं.एपीआई, Apps Script नहीं बना सकता ट्रिगर होंगे.