Monday, March 9, 2015

Zoho Office Google Drive

Editor’s Note: This blog post is authored by Naveen Venkat, from Zoho. Weve welcomed many of Zohos apps in the Google Apps Marketplace and are happy to see them join the Drive developer community as well. -- Steven Bazyl

About Zoho

Zoho is a suite of online applications targeted at small and medium sized businesses. We offer over 25 services ranging from the basic productivity suite all the way up to business applications like CRM, project management, invoicing, custom app building platform and much more. We’ve just rolled out Zoho Office integration with Google Drive.

Zohos applications can be broadly classified into 3 categories: Productivity, Business and Collaboration apps. Productivity apps are the basic needs of an office environment and include the likes of a word processor, spreadsheet, presentation tool, calendar etc. Business apps include CRM, projects, custom application building platform, invoicing and bookkeeping services. Collaboration tools facilitate real time collaboration across geographical locations. Email, chat, discussions, docs wiki etc are what round out this category of services.

How it all began

We have many Google and Google Apps customers using Zoho applications through Google Apps Marketplace, Google Chrome Webstore or directly using "Sign in using Google" on our login page. Tightly integrating Zohos applications with Googles services is very crucial for us. During the launch of Google Drive, Google announced the availability of a SDK and the related Google Drive APIs that would facilitate third party apps to integrate with the service. We used this opportunity and initially started integrating Zoho Show (presentation tool) with Google Drive. At that time, we felt that the APIs are very extensive and pretty straight forward. This inspired us to integrate our entire Zoho Office Suite with Google Drive. In just a couple of weeks, we were able to integrate Zoho Writer (word processor), Zoho Sheet (spreadsheet tool), and Zoho Show (presentation tool) with Google Drive.

Requirements:

Some of the goals that we had in our mind when we started our integration were, to be able to :

  • Create a new Zoho document from Google Drive’s UI
  • Edit an existing document in Google Drive using Zoho’s editor
  • Import a Google document into Zoho Offices UI
  • Collaborate in real time on the same document from Google Drive in ZOffices editor.

Above all, we also focussed on enabling SSO to login into Zoho with Google accounts without having to provide any extra information.

Google APIs console - Register your app

The first step in integrating an app with Google Drive is to register the app in the Google APIs console. Because we have three different apps, we created three different projects - Writer, Sheet and Show so that they would be listed separately in the contextual menu of Google Drive. In the console, we also have to enable Drive APIs and SDK to get access to Drive APIs for the App ID. The console then prompts you to create OAuth 2.0 client ID for authenticating the user with the app. Once this is done, we had to provide Google some basic information about our app such as brand icons, default and secondary mime types, authorization scopes etc.

Google Chrome Web Store - Distribution channel for Drive apps

The next step is to create a Google Chrome Web listing which allows users to install your app in Google Drive. Since we already have Zoho apps listed in the Chrome Web Store it was easy for us to make a few changes in our existing listing. We’ve added the following code in the manifest files to enable Drive for our apps.


 
"container" : "GOOGLE_DRIVE",
"api_console_project_id" : "<APP_ID>",
 

APP_ID is the application’s ID which can be found in the Google APIs console.

This makes the Chrome Web Store listing Drive enabled, so now users simply have to install our Chrome Web Store apps and the Drive features will be enabled:

Zoho Writer, Zoho Sheet and Zoho Show’s Chrome Web Store apps

Authentication & Authorization

Google Drive apps are required to use OAuth 2.0 for authorization and are strongly encouraged to use OpenID Connect for authentication. Our Zoho Office Suite already supported OpenID authentication, so it was easy for us to implement it for the Z Writer, Sheet and Show apps for Google Drive.

To enable authentication for Drive users on our Zoho app we’ve added the following scopes to our Drive apps’ configuration page in the Google APIs Console:


 
https://www.googleapis.com/auth/userinfo.email
https://www.googleapis.com/auth/userinfo.profile
 

This will make sure access to the authentication information of the user is granted alongside access to the Drive API allowing us to access Google’s OpenID Connect endpoints.

Our previous outings with GData APIs introduced us to OAuth2.0. OAuth 2.0 takes care of the authorization flow for a new user and smoothly transitioning the user to the Zoho application environment.

How the integration works

Users can create a new document from Google Drive’s UI or edit their existing Google Drive documents with Zoho’s editors. And when the user hits save, the modified document will be saved in Google Drive as a new document, thereby leaving the original Document untouched. This new document comes with extensions recognized by Zohos apps. For example, a text document, Test.doc, from Google drive, when edited in Zoho Writer and saved, will be saved as Test.zdoc in Google Drive.

Zoho Writer integration in the Drive UI

Users can invite their Google contacts to collaborate on their Google Drive documents and edit them using Zoho editors.

One of the main challenges that we faced during the integration was when multiple users need to collaborate on the same document in Zohos editors.

In the recently launched Drive version v2 Google supports Permissions Feed to manage resource sharing. Based on the document permissions, we’ll allow the user to access the document for collaboration. Thus the Google users with whom the document has been shared can collaborate with each other in Zoho’s editor, without having to sign-in with Zoho explicitly. Zoho apps support inline collaboration which facilitates the shared users to collaborate seamlessly.

Thanks to Google team for their continued support right through the integration.




Naveen Venkat

Naveen started his professional career at Zoho in 2004. He is now a Product Manager at Zoho responsible for integrating various Zoho applications with Google Products and also making sure that Zoho has the best possible integration with various third party applications. When not working, he can usually be found playing Chess or ping pong.

Read more »

Google Apps Script and Recurring Calendar Events

Google Apps Script has added support for recurring calendar events. Users can now write scripts that create, retrieve, update, and delete recurring events in calendars. We’ve also made the interface for this feature simple and easy to use. Let’s look at some examples.

The following code snippet creates a calendar event for all days that are Friday the 13th, so you can remember to avoid bad luck on those days.

var calendar = CalendarApp.getCalendarsByName("My Calendar")[0];
var fridayTheThirteenth = CalendarApp.newRecurrence();
fridayTheThirteenth.addDateExclusion(newDate())
.addDailyRule()
.onlyOnWeekday(CalendarApp.Weekday.FRIDAY)
.onlyOnMonthDay(13);
calendar.createAllDayEventSeries("Bad luck!", new Date(),
fridayTheThirteenth)

The next code snippet adds an event to your calendar to remind you of election day in the United States.

var calendar = CalendarApp.getCalendarsByName("My Calendar")[0];
var usaElectionDay = CalendarApp.newRecurrence();
usaElectionDay.addDateExclusion(newDate())
.addYearlyRule().interval(4)
.onlyInMonth(CalendarApp.Month.NOVEMBER)
.onlyOnWeekday(CalendarApp.Weekday.TUESDAY)
.onlyOnMonthDays([2, 3, 4, 5, 6, 7, 8]);
calendar.createAllDayEventSeries("Go vote!!!", new Date(),
usaElectionDay);

The interface to interact with recurring events is very straight forward and powerful. We were able to easily select all days matching the parameters Friday the 13th, and also to match all Tuesdays in each occurrence of November having a date between 2 and 8. You can quickly and easily describe dates and times of recurring events you’re looking for. For more information, please check out the release notes and updated documentation.

Want to weigh in on this topic? Discuss on Buzz

Read more »

New features in Admin SDK Custom user attributes and opening up access to all domain users

[ed: This post originally appeared on the Google Developers Blog]

By Muzammil Esmail, Product Manager, Google for Work

The Admin SDK provides a comprehensive directory experience for Google for Work customers to help them meet specific business needs around data storage for customers. Here are some important updates to this SDK.


Custom attributes in the user’s profile
Now available is a new feature in the Directory API which allows you to add custom attributes for your users. For instance, you could store the projects your users work on, their desk number, job level, hiring date — whatever makes sense for your business.


Once the custom attributes for your domain have been defined, they behave just like regular fields in the user profile. You can get and set them for your users and also perform searches on custom fields (e.g. “all employees that work on the shinyNewApp in Hyderabad”).


Custom attributes can be of different data types; they can be single- or multi-valued. You can configure whether they are “public” i.e. visible to everyone on the domain, or “private” i.e. visible only to admins and the users themselves.


Read access to all domain users
Historically, only admins have been able to access the data in the Admin SDK. Beginning today, any user (not just admins) will now be able to call the Directory API to read the profile of any user on the domain (of course, we will respect ACLing settings and profile sharing settings).


We hope that you will be able to use this new feature to build business applications (e.g. corporate yellow pages, expense approval, vacation management, workflow applications, etc.) that can be used by all your users.

Please feel free to go through our documentation to go learn more about the Admin SDK, and specifically the Directory API. Happy hacking!
Read more »

Making PATCH requests from App Engine

PATCH requests allow you to perform partial updates on many of our REST APIs and in most cases can save bandwidth.

If you have ever tried to do a PATCH request on an App Engine application, you probably realized that it is not possible and that the list of HTTP Methods allowed is whitelisted to the following methods only: GET, POST, HEAD, PUT and DELETE. Trying to perform a PATCH request raises the following Exception:

java.net.ProtocolException: PATCH is not one of the supported http methods: [GET, POST, HEAD, PUT, DELETE]

There is a workaround to this. Most of our APIs support the X-HTTP-Method-Override header. This header can be used in a POST request to “fake” other HTTP methods. Simply set the value of the X-HTTP-Method-Override header to the HTTP method you would like to actually perform.

For example, to make a PATCH request to the Google Tasks API to update only the Notes field of a particular task you could use the following HTTP request:

POST /tasks/v1/lists/@default/tasks/TASK_ID HTTP/1.1
Host: www.googleapis.com
X-HTTP-Method-Override: PATCH
Authorization: Bearer
Content-Type: application/json
Content-Length: 31

{“Notes” : “Patch is working!”}

Which would be equivalent to this HTTP Request, which is not supported on App Engine:

PATCH /tasks/v1/lists/@default/tasks/TASK_ID HTTP/1.1
Host: www.googleapis.com
Authorization: Bearer
Content-Type: application/json
Content-Length: 31

{“Notes” : “Patch is working!”}

For instance, in an App Engine Java environment you could construct and execute this request this way:

URL url = new URL("https://www.googleapis.com/tasks/v1/" +     
"lists/@default/tasks/" + TASK_ID);
HTTPRequest request = new HTTPRequest(url, HTTPMethod.POST);
request.addHeader(new HTTPHeader("X-HTTP-Method-Override", "PATCH"));
request.addHeader(new HTTPHeader("Authorization", "Bearer " +
ACCESS_TOKEN));
request.setPayload("{"Notes" : "Patch is working!"}".getBytes());

URLFetchService fetchService = URLFetchServiceFactory.getURLFetchService();
HTTPResponse response = fetchService.fetch(request);

This trick can also be used if your application server is behind a firewall, behind a proxy server or in any other environment where HTTP methods other than POST might not be allowed. In that case you could use the X-HTTP-Method-Override header the same way to workaround these limitations.

You may also use our Google APIs Client library for Java or our Google APIs Client library for Python, both of which have support for PATCH requests and use the X-HTTP-Method-Override header when appropriate.


Nicolas Garnier profile | twitter | events

Nicolas joined Google’s Developer Relations in 2008. Since then hes worked on commerce oriented products such as Google Checkout and Google Base. Currently, he is working on Google Apps with a focus on the Google Calendar API, the Google Contacts API, and the Tasks API. Before joining Google, Nicolas worked at Airbus and at the French Space Agency where he built web applications for scientific researchers.

Read more »

TRUSTe Data Privacy Certification Now Available for Marketplace Apps

When evaluating web apps, customers often ask for information about the vendor’s privacy policy and how their data is handled. To make it easier for customers to discover and understand this information, we’ve teamed up with TRUSTe to offer TRUSTed Apps Data Privacy Certification for Marketplace Apps. This new program is designed specifically to help vendors of installable apps better communicate their data privacy and handling practices to potential customers.

Certified apps will have the TRUSTe logo displayed on their listing page, as well as in search and category results pages, similar to the screenshot below.


When a customers wants to see more details, they click on the TRUSTe logo to view a customized privacy policy report, hosted on TRUSTe.com:



All installable Marketplace apps are eligible to apply for free certification for the first year, and can choose to renew at $300 per year per app thereafter.

To learn more about the program, please see TRUSTe’s certification FAQ and program FAQ. We encourage all installable app vendors to apply today!

Want to weigh in on this topic? Discuss on Buzz

Read more »