Tag Archives: Google Apps

Retiring the Email Migration API

Posted by Wesley Chun, Developer Advocate, Google Apps

Last summer, we launched the new Gmail API, giving developers more flexible, powerful, and higher-level access to programmatic email management, not to mention improved performance. Since then, it has been expanded to replace the Google Apps Admin SDK's Email Migration API (EMAPI v2). Going forward, we recommend developers integrate with the Gmail API.

EMAPI v2 will be turned down on November 1, 2015, so you should switch to the Gmail API soon. To aid you with this effort, we've put together a developer’s guide to help you migrate from EMAPI v2 to the Gmail API. Before you do that, here’s your final reminder to not forget about these deprecations including EMAPI v1, which are coming even sooner (April 20, 2015).

Reminder to migrate to updated Google Data APIs

Over the past few years, we’ve been updating our APIs with new versions across Drive and Calendar, as well as those used for managing Google Apps for Work domains. These new APIs offered developers several improvements over older versions of the API. With each of these introductions, we also announced the deprecation of a set of corresponding APIs.

The deprecation period for these APIs is coming to an end. As of April 20, 2015, we will discontinue these deprecated APIs. Calls to these APIs and any features in your application that depend on them will not work after April 20th.

Discontinued APIReplacement API
Documents List APIDrive API
Admin AuditAdmin SDK Reports API
Google Apps ProfilesAdmin SDK Directory API
ProvisioningAdmin SDK Directory API
ReportingAdmin SDK Reports API
Email Migration API v1Email Migration API v2
Reporting VisualizationNo replacement available

When updating, we also recommend that you use the opportunity to switch to OAuth2 for authorization. Older protocols, such as ClientLogin, AuthSub, and OpenID 2.0, have also been deprecated and are scheduled to shut down.

For help on migration, consult the documentation for the APIs or ask questions about the Drive API or Admin SDK on StackOverflow.

Posted by Steven Bazyl, Developer Advocate

Speeding up HtmlService in Apps Script

Apps Script's HTML service is a great way to easily build user interfaces for Docs, Sheets, and Forms add-ons. However, HTML service is S-L-O-W. And until today there have been quite a few restrictions on using HTML service, including the inability to use a variety of JavaScript libraries.

Today, we are introducing an update to HTML service — IFRAME sandbox mode. Using this sandbox mode, you can significantly improve the performance. There are three key benefits.
  1. Your UI loads up much faster
  2. Standard HTML, JavaScript, and CSS features are now available without any restrictions
  3. It requires very few code changes: just set the SandboxMode to IFRAME:
var html = HtmlService.createHtmlOutputFromFile('foo');
html.setSandboxMode(HtmlService.SandboxMode.IFRAME);

We couldn’t resist using the new HTML service ourselves, so we’ve published an alternate version of the Google Translate add-on on GitHub that uses the iframe sandbox mode as well as Polymer and material design concepts.

translate-sample.png
With the launch of the IFRAME sandbox, it is now time to bid goodbye to UiApp. The UI service was a very useful way to serve user interfaces in Docs and Sheets at a time when sandboxing technologies were still evolving. Effective today, UI service is deprecated. It will be removed from documentation and autocomplete in the script editor on June 30, 2015. If you have built any UIs using UiApp, they will continue to work.

We are also deprecating the DocsList service. The Drive service and advanced Drive service are more powerful ways to access Google Drive data from Apps Script. DocsList will be shut down on April 20, 2015. Please migrate your scripts from the DocsList service to the Drive service or the advanced Drive service.

We understand that feature deprecation is sometimes inconvenient, but we strongly believe that the new features help the product evolve and gives Apps Script users better functionality, ultimately allowing developers to create more powerful solutions.


Posted by Saurabh Gupta, Product Manager, Google Apps Script

Get your Google Drive App listed on the Google Apps Marketplace

The Google Apps Marketplace brings together hundreds of third-party applications that integrate and enhance Google Drive, part of Google Apps for Work, our suite of collaboration and productivity tools for businesses. To improve discoverability and increase adoption, it’s important to make your Google Drive app integration available on the marketplace.

Today, we want to share with you four easy steps to get listed immediately and enable admins to install your application for all users in their domain. For more details, check out the Google Apps Marketplace documentation.

Step 1: Open your Drive project on Google Cloud console. Turn on “Google Apps Marketplace SDK” for your project. Screen Shot 2014-08-20 at 11.50.10 PM.png

Step 2: Click the gear icon to configure “Google Apps Marketplace SDK”. Refer to Google Apps Marketplace documentation for details. In the scopes section, be sure to request the same scopes as your Google Drive application, and check the “Enable Drive extension” checkbox.

Step 3: Go to the Chrome Web Store developer console and select your published Drive application.

Step 4: Update the following line in your Drive application’s Chrome Web Store manifest, upload and publish.

"container":"GOOGLE_DRIVE"
with
“container”: [”GOOGLE_DRIVE”, ”DOMAIN_INSTALLABLE”]

You’re done! You application is now available to all Google Apps for Work customers to install on a domain-wide basis through the Google Apps Marketplace. Refer to Publishing your app documentation for details. You can access Google Apps Marketplace inside Google Admin Console and verify your newly listed application.

Please subscribe to the Google Apps Marketplace G+ community for the latest updates.
Posted by Hiranmoy Saha, Software Engine, Google Apps Marketplace

Make your emails stand out in Inbox


As we announced last week, Inbox is a whole new take on, well, the inbox. It’s built by the Gmail team, but it’s not Gmail—it’s a new product designed to help users succeed in today’s world of email overload and multiple devices. At the same time, Inbox can also help you as a sender by offering new tools to make your emails more interactive!

Specifically, you can now take advantage of a new feature called Highlights.

Exactly like it sounds, Highlights “highlight” or surface key information and actions from an email and display them as easy-to-see chips in the inbox. For example, if you’re an airline that sends flight confirmation emails, Highlights can surface the “Check-in for your flight” action and display live flight status information for recipients right in the user’s main list. The same can apply if you send customers hotel reservations, event details, event invitations, restaurant reservations, purchases, or other tickets. Highlights help ensure that your recipients see your messages and the important details at a glance.

To take advantage of Highlights, you can mark up your email messages to specify which details you want surfaced for your customers. This will make it possible for not only Inbox, but also Gmail, Google Now, Google Search, and Maps to interact more easily with your messages and give your recipients the best possible experience across Android, iOS and the web.

As an example, the following JSON-LD markup can be used by restaurants to send reservation confirmations to their users/customers:
<script type="application/ld+json">
{
"@context": "http://schema.org",
"@type": "FoodEstablishmentReservation",
"reservationNumber": "WTA1EK",
"reservationStatus": "http://schema.org/Confirmed",
. . . information about dining customer . . .
"reservationFor": {
"@type": "FoodEstablishment",
"name": "Charlie’s Cafe",
"address": {
"@type": "PostalAddress",
"streetAddress": "1600 Amphitheatre Parkway",
"addressLocality": "Mountain View",
"addressRegion": "CA",
"postalCode": "94043",
"addressCountry": "United States"
},
"telephone": "+1 650 253 0000"
},
"startTime": "2015-01-01T19:30:00-07:00",
"partySize": "2"
}
</script>

When your confirmation is received, users will see a convenient Highlight with the pertinents at the top of their Inbox, then can open the message to obtain the full details of their reservation as shown above.

Getting started is simple: read about email markup, check out more markup examples, then register at developers.google.com/gmail/markup and follow the instructions from there!


by Shalini Agarwal, Product Management, Inbox by Gmail

Introducing Add-ons for Google Forms

Cross-posted from the Google Apps Updates blog.

Google Forms is a free and simple way to collect information — from quickly polling your friends about who'll be attending your trip to the haunted hayride, to getting thousands of responses to an awareness survey for work.

Over the last few months, Forms has been getting a bunch of updates to help you make good looking surveys, like new theme choices and the ability to create your own personalized themes.

To give you even more flexibility and options, we’re introducing add-ons for Forms—new tools, created by developer partners, that deliver even more features to your surveys (just like add-ons for Docs and Sheets).

Add-ons bring handy extras to your survey building experience, like setting a survey end date, sending custom emails based on responses, storing lists of choices that you frequently add to questions, and more.

You can access Add-ons from the “Add-ons” menu in Forms, or by directly visiting the Forms add-on store.



Here are just a few of the growing list of add-ons that you can use today with Google Forms:
  • formLimiter: Close your survey automatically, after a maximum number of responses is reached, or at a date and time of your choosing. 
  • Ultradox Trigger: Create custom emails, reports, invoices, newsletters, etc., based on information that people enter into your form. 
  • Form Values: Store and pull from lists that you use regularly in Forms, like a list of staff, students, rooms, resources or anything you want. 
We hope these new tools make your Forms creation process even easier and more helpful--and stay tuned for more--our developer partners will be launching even more add-ons in the coming weeks. 

PS: If you’re a developer with ideas for creating your own add-on for Forms, here’s some documentation to get you started.

Posted by Saurabh Gupta, Product Manager

Reminder: ScriptDB is shutting down soon

Back in May, we announced that ScriptDB, an experimental database in Google Apps Script, would be turned off on November 20, 2014.  Hopefully you've already migrated your data to another database, but if not, now is the time to check out alternatives like Cloud SQL. The migration guide explains how to export your data from ScriptDB.We’ve also improved the documentation for connecting to external databases through JDBC, makingit easier for you to set up Cloud SQL with Apps Script.

To summarize: ScriptDb will shut down on November 20, 2014, so please ensure you migrate your scripts before then!

Posted by Saurabh Gupta, Product Manager, Google Apps Script

Updates on Authentication for Gmail IMAP, POP, and SMTP

We’d like to highlight some recent and upcoming changes around authentication for Gmail IMAP, POP, and SMTP.

Additional Scrutiny for Password Authentication 
As previously announced, Google has begun increasing the security checks that occur when logging in with a user’s Google password. This includes access via Gmail IMAP, POP, and SMTP-MSA. It does not apply when authenticating with OAuth 2.0 via the XOAUTH2 mechanism.

If the checks detect anything suspicious about a password login attempt, our servers may deny login and return an error message requesting that the user first login to Google through a web browser. They may also require the user to explicitly enable “Less Secure Apps” on their account. Applications that perform password authentication to IMAP, POP, or SMTP are examples of "Less Secure Apps".

We strongly encourage developers to use OAuth 2.0 (via the XOAUTH2 mechanism for IMAP, POP, and SMTP) in order to better protect their users.

XOAUTH support ends May 5, 2015 
The OAuth 1.0 XOAUTH authentication mechanism for Gmail IMAP and SMTP-MSA is deprecated and will stop being supported on May 5, 2015. Developers must migrate to XOAUTH2 in order to continue authenticating to Gmail after that date. You can migrate existing users without their intervention by following the instructions in this migration guide. Instructions for developing your XOAUTH2 code are in the XOAUTH2 documentation.

Posted by Jamie Nicolson, Gmail Software Engineer

Installable triggers in add-ons for Google Docs and Sheets

Earlier this year, we introduced add-ons for Google Docs and Sheets—packaged Apps Script projects that users can easily install from our add-on store to get extra functionality and features.

Since then, plenty of developers told us they were eager to add installable Apps Script triggers to their add-ons. We're happy to announce that now you can do just that, making it possible to respond to more user actions. For example, a spreadsheet add-on can now react when a user submits a response to a Google Form, or can call a method that requires authorization when a user edits a cell.

Add-ons can now programmatically create and manage these installable triggers:

  • Sheets add-ons can use the change, edit, open, and form-submit installable triggers.
  • Docs add-ons can use the (new!) open installable trigger.

To see the power of installable triggers in action, check out developer Romain Vialard's Yet Another Mail Merge, which has already been updated. The original YAMM lets users quickly personalize Gmail drafts by replacing placeholder fields with data from a spreadsheet. The new version uses a trigger to send an email whenever a form is submitted.

If you've worked with installable triggers before, you'll find that they behave a little differently in add-ons (for one thing, there are no pesky "Summary of failures" emails!), so be sure to check out the documentation.

Posted by Edward Jones, Googler

Sudoku, Linear Optimization, and the Ten Cent Diet

Originally posted on the Google Research blog. Cross posted on the Google Developers blog

In 1945, future Nobel laureate George Stigler wrote an essay in the Journal of Farm Economics titled The Cost of Subsistence about a seemingly simple problem: how could a soldier be fed for as little money as possible?

The “Stigler Diet” became a classic problem in the then-new field of linear optimization, which is used today in many areas of science and engineering. Any time you have a set of linear constraints such as “at least 50 square meters of solar panels” or “the amount of paint should equal the amount of primer” along with a linear goal (e.g., “minimize cost” or “maximize customers served”), that’s a linear optimization problem.

At Google, our engineers work on plenty of optimization problems. One example is our YouTube video stabilization system, which uses linear optimization to eliminate the shakiness of handheld cameras. A more lighthearted example is in the Google Docs Sudoku add-on, which instantaneously generates and solves Sudoku puzzles inside a Google Sheet, using the SCIP mixed integer programming solver to compute the solution.



Today we’re proud to announce two new ways for everyone to solve linear optimization problems. First, you can now solve linear optimization problems in Google Sheets with the Linear Optimization add-on written by Google Software Engineer Mihai Amarandei-Stavila. The add-on uses Google Apps Script to send optimization problems to Google servers. The solutions are displayed inside the spreadsheet. For developers who want to create their own applications on top of Google Apps, we also provide an API to let you call our linear solver directly.


Second, we’re open-sourcing the linear solver underlying the add-on: Glop (the Google Linear Optimization Package), created by Bruno de Backer with other members of the Google Optimization team. It’s available as part of the or-tools suite and we provide a few examples to get you started. On that page, you’ll find the Glop solution to the Stigler diet problem. (A Google Sheets file that uses Glop and the Linear Optimization add-on to solve the Stigler diet problem is available here. You’ll need to install the add-on first.)

Stigler posed his problem as follows: given nine nutrients (calories, protein, Vitamin C, and so on) and 77 candidate foods, find the foods that could sustain soldiers at minimum cost.

The Simplex algorithm for linear optimization was two years away from being invented, so Stigler had to do his best, arriving at a diet that cost $39.93 per year (in 1939 dollars), or just over ten cents per day. Even that wasn’t the cheapest diet. In 1947, Jack Laderman used Simplex, nine calculator-wielding clerks, and 120 person-days to arrive at the optimal solution.

Glop’s Simplex implementation solves the problem in 300 milliseconds. Unfortunately, Stigler didn’t include taste as a constraint, and so the poor hypothetical soldiers will eat nothing but the following, ever:
  • Enriched wheat flour
  • Liver
  • Cabbage
  • Spinach
  • Navy beans
Is it possible to create an appealing dish out of these five ingredients? Google Chef Anthony Marco took it as a challenge, and we’re calling the result Foie Linéaire à la Stigler:


This optimal meal consists of seared calf liver dredged in flour, atop a navy bean purée with marinated cabbage and a spinach pesto.

Chef Marco reported that the most difficult constraint was making the dish tasty without butter or cream. That said, I had the opportunity to taste our linear optimization solution, and it was delicious.