This is a two part question, regarding the Google Script API.
First, I can read the SDK/API reference, and execute examples successfully, via the "try now" feature. But, what I am missing a step in understanding when trying to build webApps (with limited javascript knowledge - admittedly). Namely, the SDK shows the syntax for many things but not in the way I would expect to use it within Javascript.
A concrete example of my problem: I am trying to create a simple function to return verification Codes (8-digit codes) from the Admin API. Here is an example function.
function getCodes(){
var userEmail = 'testuser@exampl.com';
var user = AdminDirectory.Users.list({userKey: userEmail}).verificationCodes;
Logger.log('User data:\n %s', JSON.stringify(user, null, 2));
}
naturally, the syntax for the AdminDirectory call is wrong, I get errors. I have tried many different variation, but without a proper understanding of the reference, I feel like I am just guessing (and I have guessed a lot).
Can someone throw me a bone? Thanks