Google Admin SDK users watch doesn't push notifications for role changes or moving org units -


i subscribed , tested of events listed in [1]. "add": user created event "delete": user deleted event "makeadmin": user admin status change event "undelete": user undeleted event "update": user updated event

i used marketplace credentials oauth2 watch subscription in java. works fine adding user, deleting user, , changing user's name ("update" event). however, moving user different organization unit, adding or removing super admin roles don't trigger notifications. expect "update" event in case.

has had luck getting google push notifications org unit or domain admin changes?

public static final string[] subscribe_events = { "add", "delete", "undelete", "update", "makeadmin" };   // oauth access. httptransport httptransport = new nethttptransport(); jacksonfactory jsonfactory = new jacksonfactory(); collection<string> scopes = new arraylist<string>(); scopes.add("https://www.googleapis.com/auth/admin.directory.user.readonly");  googlecredential credential; try {   credential = new googlecredential.builder()       .settransport(httptransport)       .setjsonfactory(jsonfactory)       .setserviceaccountid(settings.oauth_marketplace_account_id)       .setserviceaccountscopes(scopes)       .setserviceaccountuser(currentuseremail)       .setserviceaccountprivatekeyfromp12file(           new java.io.file(settings.oauth_marketplace_certificate_key_path)).build();  } catch (exception e) {   log.log(level.severe, "oauth credential error.", e);   return false; }  directory directory =     new directory.builder(httptransport, jsonfactory, credential)         .setapplicationname(settings.oauth_application_name)         .sethttprequestinitializer(credential).build();  (final string event : subscribe_events) {   channel channel = new channel();   channel.setid(uuid.randomuuid().tostring());   channel.settype("web_hook");   channel.setaddress(watchurl);    try {     stringbuilder tokensb = new stringbuilder();     tokensb.append("domain=").append(urlencoder.encode(apidomain, "utf-8"));     tokensb.append("&event=").append(urlencoder.encode(event, "utf-8"));     channel.settoken(tokensb.tostring());   } catch (unsupportedencodingexception e) {     log.log(level.severe, "oauth users.list.watch encoding error", e);     break;   }    try {     watch watch = directory.users().watch(channel);     watch.setdomain(apidomain);     watch.setevent(event);     watch.setprojection("full");     watch.setviewtype("admin_view");      watch.execute();    } catch (exception e) {     log.log(level.severe, "oauth users.list.watch error", e);   } } 
  1. https://developers.google.com/admin-sdk/directory/v1/reference/users/watch

this appears bug in our push notification system. if file issue here can update on status of problem: https://code.google.com/a/google.com/p/apps-api-issues/issues/entry?labels=type-defect,api-admin


Comments