如何在google apps中使用admin sdk api创建用户。
如果我使用
Directory service = new Directory.Builder(httpTransport, JSON_FACTORY, credential).setApplicationName("DirectoryCommandLine").build();
User qq=new User();
qq.set("familyName",request.getParameter("familyName"));
qq.set("givenName",request.getParameter("givenName"));
qq.set("password",request.getParameter("password"));
qq.set("primaryEmail",request.getParameter("primaryEmail"));
qq.set("organizations",request.getParameter("organizations"));
Directory.Users.Insert grequest = service.users().insert(qq);
try {
grequest.execute();
} catch (IOException e) {}
您应该在catch块中输出错误,这将有助于调试您的问题…