background preloader

Building Your First Script - Google Apps Script

Building Your First Script - Google Apps Script
Apps Script is a rapid application development platform that makes it fast to create business applications that integrate with Google Workspace. You write code in modern JavaScript and have access to built-in libraries for Google Workspace applications like Gmail, Google Calendar, Google Drive, and more. There's nothing to install—we give you a code editor right in your browser, and your scripts are saved to Drive and run on Google's servers. If you're new to JavaScript, Codecademy offers a number of JavaScript courses. (These courses weren't developed by and aren't associated with Google.) What can Apps Script do? Apps Script is versatile. Try a quickstart Try one of the following quickstarts to get an Apps Script project running in less than 5 minutes.

Big Updates for Apps Script Today at Google I/O, we announced many enhancements to Google Apps Script to help you build richer applications and share your apps with users. Apps Script began as a tool for helping users get more done with their Google spreadsheets. Over time, Apps Script has grown to handle much more. We launched script.google.com as a destination for Apps Script developers. HtmlService can help you create beautiful interfaces using Apps Script. We also launched a better way to store your application's data, ScriptDb . There are also now more options for deploying your web app. Finally, we wanted to make it easy to distribute your apps. We added a lot of new functionality to Apps Script, so in addition to our developer reference documentation , we've also created a new user guide . Building with Google Apps Script has become a lot easier and more powerful.

Introduction - Google Caja The Caja Compiler is a tool for making third party HTML, CSS and JavaScript safe to embed in your website. It enables rich interaction between the embedding page and the embedded applications. Caja uses an object-capability security model to allow for a wide range of flexible security policies, so that your website can effectively control what embedded third party code can do with user data. The Caja Compiler supports most HTML and CSS and the recently standardized "strict mode" JavaScript version of JavaScript -- even on older browsers that do not support strict mode. Benefits of using Caja New JavaScript Features.

JavaScript Client Library for Google APIs Alpha version released By Brendan O’Brien and Antonio Fuentes, Google Developer Team Today we reached another milestone in our efforts to provide infrastructure and tools to make it easier for developers to use Google APIs: we have released the Google APIs Client Library for JavaScript in Alpha. This client library is the latest addition to our suite of client libraries, which already includes Python, PHP, and Java. This compact and efficient client library provides access to all the Google APIs that are listed in the APIs Explorer. The client library is also flexible, supporting multiple browser environments including Chrome 8+, Firefox 3.5+, Internet Explorer 8+, Safari 4+, and Opera 11+. In addition, the JavaScript client library supports OAuth 2.0 authorization methods. You can load the client library using the following script tag: Loading an API and making a request is as easy as executing: To get started, visit the JavaScript Client Library documentation page.

Using the JavaScript Client Library (v2.0) - Google Data APIs Warning: This page is about Google's older APIs, the Google Data APIs; it's relevant only to the APIs that are listed in the Google Data APIs directory, many of which have been replaced with newer APIs. For information about a specific new API, see the new API's documentation. For information about authorizing requests with a newer API, see Google Accounts Authentication and Authorization. This document describes how to use the JavaScript client library to send Google Data API queries and interpret returned responses. Google provides a set of client libraries, in a variety of programming languages, for interacting with services that have data APIs. This document provides some general information about using the JavaScript client library, along with a set of examples of common uses. This document is intended for JavaScript programmers who want to write client applications that can interact with Google Data services. If you're new to JavaScript, the control flow may be a little confusing.

Getting Started - Google APIs Discovery Service The Discovery API provides a list of Google APIs for retrieving a machine-readable "Discovery document" metadata for each API. This document is intended for developers who want to write client libraries, IDE plugins, and other tools for interacting with Google APIs. Discovery Service Background Concepts The Google APIs Discovery Service is built upon two basic concepts: APIs Directory: A list of all APIs that are supported by the APIs Discovery Service. Data model A resource is an individual data entity with a unique identifier. APIs Directory List: A list of APIs Each directory entry contains an API name/version pair with the following information: Discovery Document resource: A machine-readable description of a particular API In addition to the information provided in the APIs Directory, a Discovery document also includes: The single Directory Collection is the conceptual container of the single APIs Directory resource, and the Discovery Document resources for each supported API. Operations

Using the API - Google APIs Discovery Service Contents Introduction This document is intended for developers who want to write client libraries, IDE plugins, and other tools for interacting with Google APIs. The Google APIs Discovery Service allows you to do all of the above by exposing machine readable metadata about other Google APIs through a simple API. All calls to the API are unauthenticated, JSON-based, REST requests that use SSL, i.e. If you're unfamiliar with Google APIs Discovery Service concepts, you should read Getting Started before starting to code. Discovery document format This section gives an overview of the Discovery document. All the examples below use the Discovery document from the URL Shortener API. GET Try it now in APIs Explorer! The format of a Discovery document includes information that falls into six main categories: Basic description of the API. Each of these Discovery document sections is described below. Basic API Description Authentication

Performance Tips - Google APIs Discovery Service This document covers some techniques you can use to improve the performance of your application. In some cases, examples from other APIs or generic APIs are used to illustrate the ideas presented. However, the same concepts are applicable to the Google APIs Discovery Service. Another way to improve the performance of your API calls is by requesting only the portion of the data that you're interested in. Partial response By default, the server sends back the full representation of a resource after processing requests. To request a partial response, use the fields request parameter to specify the fields you want returned. Example The following example shows the use of the fields parameter with a generic (fictional) "Demo" API. Simple request: This HTTP GET request omits the fields parameter and returns the full resource. Full resource response: The full resource data includes the following fields, along with many others that have been omitted for brevity.

APIs Console One account. All of Google. Sign in to continue to Google Cloud Platform Find my account Forgot password? Sign in with a different account Create account One Google Account for everything Google Client Libraries - Google Data APIs Warning: This page is about Google's older APIs, the Google Data APIs; it's relevant only to the APIs that are listed in the Google Data APIs directory, many of which have been replaced with newer APIs. For information about a specific new API, see the new API's documentation. For information about authorizing requests with a newer API, see Google Accounts Authentication and Authorization. Google Data APIs client libraries are available to help you write client applications that access your favorite API. For each language, the client library provides tools and an abstraction layer, letting you construct queries and use response data without having to create HTTP requests or process HTTP responses by hand. Each client library provides classes that correspond to the elements and data types that the API uses. For more information on how to use the client libraries, visit the API Directory and click through to the documentation for a specific API. Client Libraries Provided by Google

Developer's Guide Overview - Google Data APIs Warning: This page is about Google's older APIs, the Google Data APIs; it's relevant only to the APIs that are listed in the Google Data APIs directory, many of which have been replaced with newer APIs. For information about a specific new API, see the new API's documentation. For information about authorizing requests with a newer API, see Google Accounts Authentication and Authorization. Google's mission is to organize the world's information and make it universally accessible and useful. The Google Data Protocol provides a secure means for external developers to write new applications that let end users access and update the data stored by many Google products. This set of documents is intended for anyone who wants to understand Google Data Protocol. If you're looking for the Developer's Guide for a specific API, visit the Google Data Protocol API Directory. If you want to access an API in your favorite programming language, visit the Client Libraries download page. HTTP ETags.

Authentication and Authorization in the Google Data Protocol - Google Data APIs Warning: Most newer Google APIs are not Google Data APIs. The Google Data APIs documentation applies only to the older APIs that are listed in the Google Data APIs directory. For information about a specific new API, see that API's documentation. For information about authorizing requests with a newer API, see Google Accounts Authentication and Authorization. Third-party applications often require limited access to a user's Google Account for certain types of activity. Authentication services allow users to sign in to your application using a Google Account. Authorization services let users provide your application with access to the data they have stored in Google applications. Authentication and authorization services are often referred to collectively as auth. Authentication and authorization for Google APIs allow third-party applications to get limited access to a user's Google accounts for certain types of activities. Contents OAuth - authorization for web and installed applications

Resumable Media Uploads in the Google Data Protocol - Google Data APIs Eric Bidelman, Google Apps APIs team February 2010 Current web standards provide no reliable mechanism to facilitate the HTTP upload of large files. As a result, file uploads at Google and other sites have traditionally been limited to moderate sizes (e.g. 100 MB). For services like the YouTube and the Google Documents List APIs which support large file uploads, this presents a major hurdle. The Google Data resumable protocol directly addresses the aforementioned issues by supporting resumable POST/PUT HTTP requests in HTTP/1.0. This document describes how to incorporate Google Data's resumable upload feature into your applications. Initiating a resumable upload request To initiate a resumable upload session, send an HTTP POST request to the resumable-post link. The body of your POST request should be empty or contain an Atom XML entry and must not include the actual file contents. Here is another example request that instead uploads a word document. HTTP/1.1 200 OK Location: <upload_uri>

Tutorials - Google Apps Script Explore Apps Script samples and solutions that show you how to automate tasks, extend Google Workspace user interfaces, and integrate into Google and external services. View samples by use case, featured Google products, and type: About sample types The following provides an explanation of each sample type: Quickstart Quickstart samples offer quick, proof-of-concept code samples to get you working with Apps Script in under five minutes. Find quickstarts organized by project type at the left under Samples by project type or try this straightforward automation that creates a Google Doc and emails you a link to it. Solution Solution samples are fully functional Apps Script projects. Find solutions organized by project type at the left under Samples by project type or try this popular mail merge solution. Codelab Codelabs are interactive, step-by-step technical tutorials. Find Apps Script-specific codelabs at the left under Codelabs. Explore Apps Script code samples on GitHub

Related: