That did it....
Yes, unfortunately, they only thing that I have to go by is the sample
code.... once I get more confortable with, I will start doing my own
stuff.... I guess use the provisioning 2.0.....
or maybe another api (c, py, etc.)
Thanks
On May 2, 1:45 pm, "Q (Google)" <[EMAIL PROTECTED]> wrote:
> Hi,
>
> It seems that you had followed the example in the README file for
> creating users; unfortunately, there's an error in the function name.
>
> Instead of calling CreateAccount, try CreateAccountWithEmail:
> ...
> print CreateAccountWithEmail($token, "mydomain", $first_name,
> $last_name, $user_name, $user_pass)
> ...
>
> Cheers,
> Q
>
> On May 1, 9:44 am, rama1200 <[EMAIL PROTECTED]> wrote:
>
>
>
> > I feel like a dummy..... I posted and issue, somewhat like this, some
> > time ago and thanks to api support, it was resolved, but now when I
> > try to do something else, I run into another issue....
>
> > I'm using the provided provisioningphpcode tocreateaccounts, but I
> > get this error message:
>
> > Attempting to get token...
> > Obtained token asome-things-go-here-asd-123
>
> > Creating Username1...
> >PHPFatal error: Call to undefined function CreateAccount() in /root/
> > provisioning-api-php/php/create_account.phpon line 26
> > xargs: /usr/bin/php: exited with status 255; aborting
>
> > And here is my code:
>
> > ::::::::::::::
> > create_account.php
> > ::::::::::::::
> > #!/usr/bin/php4 -q
> > <?php
>
> > require_once("auth.php");
> > require_once("account.php");
> > require_once("alias.php");
> > require_once("mailing.php");
>
> > /* Example user name, alias name and mailing list name for the demo.
> > */
> > $source_data = "test_create_users_list.txt";
> > $user_name = $argv[1];
> > $first_name = trim(`more '$source_data' |grep '$user_name' |awk
> > '{print $1}'`);
> > $last_name = trim(`more '$source_data' |grep '$user_name' |awk
> > '{print $2}'`);
> > $user_pass = trim(`more '$source_data' |grep '$user_name' |awk
> > '{print $4}'`);
>
> > //print "Username: $user_name, First Name: $first_name, Last Name:
> > $last_name, Password: $user_pass \n";
>
> > /* Get an administrator token. */
> > print "Attempting to get token...\n";
> > $token = GetAuthToken("[EMAIL PROTECTED]", "adminpasswd", "", "");
> > print "Obtained token $token\n\n";
>
> > /*Createa newaccount. */
> > print "Creating " . $user_name . "...\n";
> > print CreateAccount($token, "mydomain", $first_name, $last_name,
> > $user_name,
> > $user_pass) . "\n";
>
> > ?>
>
> > ::::::::::::::
> > test_create_users_list.txt
> > ::::::::::::::
> > Firstname1 Lastname1 Username1 Password1
> > Firstname2 Lastname2 Username2 Password2
> > Firstname3 Lastname3 Username3 Password3
> > Firstname4 Lastname4 Username4 Password4
> > Firstname5 Lastname5 Username5 Password5
> > ...
> > ...
>
> > ::::::::::::::
> > get_users_jnum_test.sh
> > ::::::::::::::
> > #!/bin/bash
> > more user_list_test.txt | gawk '{print $3}' | xargs -l1 /usr/bin/php
> > create_account.php
>
> > Thanks for any help, once again.- Hide quoted text -
>
> - Show quoted text -
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Google Apps APIs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/google-apps-apis?hl=en
-~----------~----~----~----~------~----~------~--~---