New Advanced services in Apps Script

New Advanced services in Apps Script - Hallo sahabat Testagk.blogspot.com, Pada sharing kali ini yang berjudul New Advanced services in Apps Script, mudah-mudahan isi postingan yang saya tulis ini dapat anda pahami.

Posting : New Advanced services in Apps Script
Judul : New Advanced services in Apps Script

lihat juga


New Advanced services in Apps Script

Posted by Kalyan Reddy, Developer Programs Engineer

Originally posted on the Google Apps Developer blog

Apps Script includes many built-in Google services for major products like Gmail and Drive, and lately, we've been working to add other APIs that developers have been clamoring for as advanced Google services. Today, we are launching seven more advanced services, including:

Like all other advanced services in Apps Script, they must first be enabled before use. Once enabled, they are just as easy to use as built-in Apps Script services -- the editor provides autocomplete, and the authentication flow is handled automatically.

Here is a sample using the Apps Activity advanced service that shows how to get a list of users that have performed an action on a particular Google Drive file.


function getUsersActivity() {
var fileId = 'YOUR_FILE_ID_HERE';
var pageToken;
var users = {};
do {
var result = AppsActivity.Activities.list({
'drive.fileId': fileId,
'source': 'drive.google.com',
'pageToken': pageToken
});
var activities = result.activities;
for (var i = 0; i < activities.length; i++) {
var events = activities[i].singleEvents;
for (var j = 0; j < events.length; j++) {
var event = events[j];
users[event.user.name] = true;
}
}
pageToken = result.nextPageToken;
} while (pageToken);
Logger.log(Object.keys(users));
}

This function uses the AppsActivity.Activities.list() method, passing in the required parameters drive.fileId and source, and uses page tokens to get the full list of activities. The full list of parameters this method accepts can be found in the Apps Activity API's reference documentation.



Demikianlah Artikel New Advanced services in Apps Script

Sekian posting New Advanced services in Apps Script, mudah-mudahan bisa memberi manfaat untuk anda semua. baiklah, sekian postingan kali ini.

Anda sedang membaca artikel New Advanced services in Apps Script dan artikel ini url permalinknya adalah http://testagk.blogspot.com/2015/04/new-advanced-services-in-apps-script.html Semoga artikel ini bisa bermanfaat.

0 Response to "New Advanced services in Apps Script"

Posting Komentar