Apps Script API দিয়ে ফাংশন চালান

Google Apps Script API একটি scripts.run পদ্ধতি প্রদান করে যা দূরবর্তীভাবে একটি নির্দিষ্ট Apps স্ক্রিপ্ট ফাংশন চালায়। আপনি দূরবর্তীভাবে আপনার স্ক্রিপ্ট প্রকল্পগুলির একটিতে একটি ফাংশন চালাতে এবং একটি প্রতিক্রিয়া পেতে একটি কলিং অ্যাপ্লিকেশনে এই পদ্ধতিটি ব্যবহার করতে পারেন।

প্রয়োজনীয়তা

একটি কলিং অ্যাপ্লিকেশন scripts.run পদ্ধতি ব্যবহার করার আগে আপনাকে অবশ্যই নিম্নলিখিত প্রয়োজনীয়তাগুলি পূরণ করতে হবে৷ তোমাকে অবশ্যই :

  • একটি API এক্সিকিউটেবল হিসাবে স্ক্রিপ্ট প্রকল্প স্থাপন করুন. আপনি প্রয়োজন অনুসারে প্রকল্পগুলি স্থাপন, আনডিপ্লোয় এবং পুনরায় স্থাপন করতে পারেন।

  • কার্যকর করার জন্য একটি সঠিকভাবে স্কোপযুক্ত OAuth টোকেন প্রদান করুন। এই OAuth টোকেনটি স্ক্রিপ্ট দ্বারা ব্যবহৃত সমস্ত স্কোপগুলিকে কভার করতে হবে, শুধুমাত্র কল ফাংশনের দ্বারা ব্যবহৃত নয়৷ পদ্ধতির রেফারেন্সে অনুমোদনের সুযোগের সম্পূর্ণ তালিকা দেখুন।

  • নিশ্চিত করুন যে স্ক্রিপ্ট এবং কলিং অ্যাপ্লিকেশনের OAuth2 ক্লায়েন্ট একটি সাধারণ Google ক্লাউড প্রকল্প শেয়ার করে৷ ক্লাউড প্রকল্পটি অবশ্যই একটি আদর্শ ক্লাউড প্রকল্প হতে হবে; অ্যাপস স্ক্রিপ্ট প্রকল্পগুলির জন্য তৈরি ডিফল্ট প্রকল্পগুলি অপর্যাপ্ত৷ আপনি একটি নতুন স্ট্যান্ডার্ড ক্লাউড প্রকল্প বা বিদ্যমান একটি ব্যবহার করতে পারেন৷

  • ক্লাউড প্রকল্পে Google Apps Script API সক্ষম করুন

scripts.run পদ্ধতি

scripts.run পদ্ধতি চালানোর জন্য মূল সনাক্তকরণ তথ্য প্রয়োজন:

ডেভেলপমেন্ট মোডে এক্সিকিউট করার জন্য আপনি ঐচ্ছিকভাবে আপনার স্ক্রিপ্ট কনফিগার করতে পারেন। এই মোডটি স্ক্রিপ্ট প্রোজেক্টের সবচেয়ে সাম্প্রতিক সংরক্ষিত সংস্করণের পরিবর্তে অতি সম্প্রতি স্থাপন করা সংস্করণের সাথে কার্যকর করে। অনুরোধের বডিতে devMode বুলিয়ান সেট করে এটি true । শুধুমাত্র স্ক্রিপ্টের মালিক এটি বিকাশ মোডে কার্যকর করতে পারেন।

হ্যান্ডলিং প্যারামিটার ডেটা প্রকার

Apps Script API scripts.run পদ্ধতি ব্যবহার করে সাধারণত Apps Script-এ ফাংশন প্যারামিটার হিসেবে ডেটা পাঠানো এবং ফাংশন রিটার্ন মান হিসেবে ডেটা ফেরত পাওয়া যায়। API শুধুমাত্র মৌলিক প্রকারের সাথে মান নিতে এবং ফেরত দিতে পারে: স্ট্রিং, অ্যারে, অবজেক্ট, সংখ্যা এবং বুলিয়ান। এগুলি জাভাস্ক্রিপ্টের মৌলিক প্রকারের মতো। আরও জটিল Apps স্ক্রিপ্ট অবজেক্ট যেমন ডকুমেন্ট বা শীট এপিআই দ্বারা স্ক্রিপ্ট প্রোজেক্টে বা থেকে পাস করা যাবে না।

যখন আপনার কলিং অ্যাপ্লিকেশানটি জাভা-এর মতো একটি দৃঢ়-টাইপ ভাষায় লেখা হয়, তখন এটি এই মৌলিক প্রকারের সাথে সম্পর্কিত জেনেরিক বস্তুর তালিকা বা অ্যারে হিসাবে প্যারামিটারে পাস করে। অনেক ক্ষেত্রে, আপনি স্বয়ংক্রিয়ভাবে সাধারণ ধরনের রূপান্তর প্রয়োগ করতে পারেন। উদাহরণস্বরূপ, একটি ফাংশন যা একটি সংখ্যা প্যারামিটার নেয় তাকে অতিরিক্ত হ্যান্ডলিং ছাড়াই প্যারামিটার হিসাবে জাভা Double বা Integer বা Long অবজেক্ট দেওয়া যেতে পারে।

যখন API ফাংশন প্রতিক্রিয়া প্রদান করে, তখন আপনাকে প্রায়শই প্রত্যাবর্তিত মানটি ব্যবহার করার আগে সঠিক প্রকারে কাস্ট করতে হবে। এখানে কিছু জাভা-ভিত্তিক উদাহরণ রয়েছে:

  • একটি জাভা অ্যাপ্লিকেশনে API দ্বারা প্রত্যাবর্তিত নম্বরগুলি java.math.BigDecimal অবজেক্ট হিসাবে আসে এবং প্রয়োজন অনুসারে Doubles বা int প্রকারে রূপান্তর করতে হতে পারে।
  • যদি অ্যাপস স্ক্রিপ্ট ফাংশন স্ট্রিংগুলির একটি অ্যারে প্রদান করে, একটি জাভা অ্যাপ্লিকেশন একটি List<String> অবজেক্টে প্রতিক্রিয়া দেয়:

    List<String> mylist = (List<String>)(op.getResponse().get("result"));
    
  • আপনি যদি Bytes একটি অ্যারে ফেরত দিতে চান, তাহলে অ্যাপস স্ক্রিপ্ট ফাংশনের মধ্যে অ্যারেটিকে বেস64 স্ট্রিং হিসাবে এনকোড করা আপনার পক্ষে সুবিধাজনক মনে হতে পারে এবং পরিবর্তে সেই স্ট্রিংটি ফেরত দিতে পারেন:

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

নীচের উদাহরণ কোড নমুনা API প্রতিক্রিয়া ব্যাখ্যা করার উপায় ব্যাখ্যা করে।

সাধারণ পদক্ষেপ

অ্যাপস স্ক্রিপ্ট ফাংশন চালানোর জন্য অ্যাপস স্ক্রিপ্ট API ব্যবহার করার জন্য নিম্নলিখিত সাধারণ পদ্ধতি বর্ণনা করে:

ধাপ 1: সাধারণ ক্লাউড প্রকল্প সেট আপ করুন

আপনার স্ক্রিপ্ট এবং কলিং অ্যাপ্লিকেশন উভয়কেই একই ক্লাউড প্রকল্প ভাগ করতে হবে। এই ক্লাউড প্রকল্পটি একটি বিদ্যমান প্রকল্প বা এই উদ্দেশ্যে তৈরি একটি নতুন প্রকল্প হতে পারে। একবার আপনার একটি ক্লাউড প্রকল্প হয়ে গেলে, এটি ব্যবহার করতে আপনাকে অবশ্যই আপনার স্ক্রিপ্ট প্রকল্পটি পরিবর্তন করতে হবে৷

ধাপ 2: স্ক্রিপ্টটিকে একটি API এক্সিকিউটেবল হিসাবে স্থাপন করুন

  1. আপনি যে ফাংশনগুলি ব্যবহার করতে চান তার সাথে অ্যাপস স্ক্রিপ্ট প্রকল্পটি খুলুন।
  2. উপরের ডানদিকে, Deploy > New Deployment এ ক্লিক করুন।
  3. যে ডায়ালগটি খোলে, সেখানে ডিপ্লয়মেন্ট প্রকার সক্ষম করুন ক্লিক করুন > API এক্সিকিউটেবল
  4. "কার অ্যাক্সেস আছে" ড্রপ-ডাউন মেনুতে, অ্যাপস স্ক্রিপ্ট API ব্যবহার করে স্ক্রিপ্টের ফাংশন কল করার অনুমতিপ্রাপ্ত ব্যবহারকারীদের নির্বাচন করুন।
  5. Deploy এ ক্লিক করুন।

ধাপ 3: কলিং অ্যাপ্লিকেশন কনফিগার করুন

কলিং অ্যাপ্লিকেশনটিকে অবশ্যই Apps Script API সক্ষম করতে হবে এবং এটি ব্যবহার করার আগে OAuth প্রমাণপত্রাদি স্থাপন করতে হবে৷ এটি করার জন্য আপনার ক্লাউড প্রকল্পে অ্যাক্সেস থাকতে হবে।

  1. আপনার কলিং অ্যাপ্লিকেশন এবং স্ক্রিপ্ট ব্যবহার করছে এমন ক্লাউড প্রকল্পটি কনফিগার করুন। আপনি নিম্নলিখিত পদক্ষেপগুলির সাথে এটি করতে পারেন:
    1. ক্লাউড প্রকল্পে Apps Script API সক্ষম করুন
    2. OAuth সম্মতি স্ক্রিন কনফিগার করুন
    3. OAuth শংসাপত্র তৈরি করুন
  2. স্ক্রিপ্ট প্রকল্প খুলুন এবং বাম দিকে, ওভারভিউ ক্লিক করুন .
  3. Project Oauth স্কোপের অধীনে, স্ক্রিপ্টের জন্য প্রয়োজনীয় সমস্ত স্কোপ রেকর্ড করুন।
  4. কলিং অ্যাপ্লিকেশন কোডে, API কলের জন্য একটি স্ক্রিপ্ট OAuth অ্যাক্সেস টোকেন তৈরি করুন৷ এটি API নিজেই ব্যবহার করে এমন একটি টোকেন নয়, বরং একটি স্ক্রিপ্ট চালানোর সময় প্রয়োজন। এটি ক্লাউড প্রজেক্ট ক্লায়েন্ট আইডি এবং আপনার রেকর্ড করা স্ক্রিপ্ট স্কোপ ব্যবহার করে তৈরি করা উচিত।

    Google ক্লায়েন্ট লাইব্রেরিগুলি এই টোকেন তৈরি করতে এবং অ্যাপ্লিকেশনটির জন্য OAuth পরিচালনা করতে ব্যাপকভাবে সহায়তা করতে পারে, সাধারণত আপনি স্ক্রিপ্ট স্কোপগুলি ব্যবহার করে একটি উচ্চ-স্তরের "প্রমাণপত্র" অবজেক্ট তৈরি করতে পারবেন৷ স্কোপের তালিকা থেকে একটি শংসাপত্র অবজেক্ট তৈরির উদাহরণগুলির জন্য Apps Script API quickstart দেখুন।

ধাপ 4: script.run অনুরোধ করুন

কলিং অ্যাপ্লিকেশন কনফিগার হয়ে গেলে, আপনি scripts.run কল করতে পারেন। প্রতিটি API কল নিম্নলিখিত পদক্ষেপগুলি নিয়ে গঠিত:

  1. স্ক্রিপ্ট আইডি, ফাংশনের নাম এবং প্রয়োজনীয় প্যারামিটার ব্যবহার করে একটি API অনুরোধ তৈরি করুন।
  2. scripts.run কল করুন এবং হেডারে আপনি যে স্ক্রিপ্ট OAuth টোকেন তৈরি করেছেন তা অন্তর্ভুক্ত করুন (যদি একটি মৌলিক POST অনুরোধ ব্যবহার করেন) অথবা অন্যথায় স্ক্রিপ্ট স্কোপগুলির সাথে আপনার তৈরি একটি শংসাপত্র অবজেক্ট ব্যবহার করুন৷
  3. স্ক্রিপ্ট কার্যকর করা শেষ করার অনুমতি দিন। স্ক্রিপ্টগুলিকে কার্যকর করার সময় ছয় মিনিট পর্যন্ত নেওয়ার অনুমতি দেওয়া হয়, তাই আপনার আবেদনের অনুমতি দেওয়া উচিত।
  4. সমাপ্তির পরে, স্ক্রিপ্ট ফাংশন একটি মান ফেরত দিতে পারে, যে মানটি সমর্থিত টাইপ হলে API অ্যাপ্লিকেশনে ফিরিয়ে দেয়।

আপনি নীচে script.run API কলগুলির উদাহরণ খুঁজে পেতে পারেন।

API অনুরোধের উদাহরণ

ব্যবহারকারীর রুট ডিরেক্টরিতে ফোল্ডারগুলির একটি তালিকা প্রিন্ট করার জন্য একটি Apps স্ক্রিপ্ট ফাংশনকে কল করে বিভিন্ন ভাষায় কীভাবে একটি Apps Script API এক্সিকিউশন অনুরোধ করতে হয় তা নিম্নলিখিত উদাহরণগুলি দেখায়৷ এক্সিকিউটেড ফাংশন সহ অ্যাপস স্ক্রিপ্ট প্রোজেক্টের স্ক্রিপ্ট আইডি অবশ্যই নির্দিষ্ট করতে হবে যেখানে ENTER_YOUR_SCRIPT_ID_HERE এর সাথে নির্দেশ করা হয়েছে। উদাহরণগুলি তাদের নিজ নিজ ভাষার জন্য Google API ক্লায়েন্ট লাইব্রেরির উপর নির্ভর করে।

টার্গেট স্ক্রিপ্ট

এই স্ক্রিপ্টের ফাংশনটি ড্রাইভ API ব্যবহার করে।

স্ক্রিপ্ট হোস্টিং প্রকল্পে আপনাকে অবশ্যই ড্রাইভ API সক্ষম করতে হবে

অতিরিক্তভাবে, কলিং অ্যাপ্লিকেশনগুলিকে অবশ্যই OAuth শংসাপত্র পাঠাতে হবে যাতে নিম্নলিখিত ড্রাইভ স্কোপ অন্তর্ভুক্ত থাকে:

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

এখানে উদাহরণ অ্যাপ্লিকেশনগুলি এই সুযোগ ব্যবহার করে OAuth-এর জন্য শংসাপত্রের বস্তু তৈরি করতে Google ক্লায়েন্ট লাইব্রেরি ব্যবহার করে।

/**
 * 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;
}

জাভা


/**
 * 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);
  }
}

জাভাস্ক্রিপ্ট

/**
 * 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;
  }
}

পাইথন

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. একটি সাধারণ ক্লাউড প্রকল্প । যে স্ক্রিপ্টটি কল করা হচ্ছে এবং কলিং অ্যাপ্লিকেশনটিকে অবশ্যই একটি ক্লাউড প্রকল্প ভাগ করতে হবে৷ ক্লাউড প্রকল্পটি অবশ্যই একটি আদর্শ ক্লাউড প্রকল্প হতে হবে; অ্যাপস স্ক্রিপ্ট প্রকল্পগুলির জন্য তৈরি ডিফল্ট প্রকল্পগুলি অপর্যাপ্ত৷ স্ট্যান্ডার্ড ক্লাউড প্রকল্প একটি নতুন প্রকল্প বা বিদ্যমান একটি হতে পারে।

  2. বেসিক প্যারামিটার এবং রিটার্ন প্রকার । এপিআই অ্যাপ্লিকেশানে Apps স্ক্রিপ্ট-নির্দিষ্ট বস্তুগুলি (যেমন ডকুমেন্টস , ব্লবস , ক্যালেন্ডার , ড্রাইভ ফাইল ইত্যাদি) পাস বা ফেরত দিতে পারে না৷ শুধুমাত্র মৌলিক ধরনের যেমন স্ট্রিং, অ্যারে, অবজেক্ট, সংখ্যা এবং বুলিয়ান পাস করা যায় এবং ফেরত দেওয়া যায়।

  3. OAuth স্কোপ এপিআই শুধুমাত্র এমন স্ক্রিপ্ট চালাতে পারে যার অন্তত একটি প্রয়োজনীয় সুযোগ রয়েছে। এর মানে হল আপনি একটি স্ক্রিপ্ট কল করতে API ব্যবহার করতে পারবেন না যার জন্য এক বা একাধিক পরিষেবার অনুমোদনের প্রয়োজন নেই৷

  4. কোনো ট্রিগার নেই । API অ্যাপস স্ক্রিপ্ট ট্রিগার তৈরি করতে পারে না।