Hi Ryan, I talked with our local Provisioning API guru and he indicated that you're already doing it the right way. That is, you must do the GET to see if the account is created before trying to move them to an OU, and there is no guaranteed time when the account will be ready.
One solution might be to create a batching interface in your app: let the admin create one or more users at the same time and also specify the OU at the time of creation. Your app then would poll the user creation and apply the OU change when it was ready. You'd provide a dashboard to the admin to show which users had been created and organized from the batch so far. /Rufus On Mon, Oct 24, 2011 at 12:49 PM, Ryan <[email protected]> wrote: > I'm making a solution to dynamically provision new accounts, as needed, and > then move the account to the correct OU. However, there seems to be a timing > issue between the two. The > documentation<http://code.google.com/googleapps/domain/gdata_provisioning_api_v2.0_developers_protocol.html#Creating_an_Organization_User>says > that it is possible, #2. What I do is provision the new account, wait 2 > minutes, then try to move OU's. However, the Organization API reports that > the user does not exist. > > To get a little more in-depth, my solution follows these steps for a new > user: > > 1. Check for the users' account, which reports back that it does NOT > exist, by GETing from > https://apps-apis.google.com/a/feeds/MYDOMAIN/user/2.0/USERNAME > 2. Provision a new account by POSTing to > https://apps-apis.google.com/a/feeds/MYDOMAIN/user/2.0 > 3. Forces the user to wait 2 minutes before retrying to login again > 4. Check for the users' account again, which reports back that it DOES > exist, by GETing from > https://apps-apis.google.com/a/feeds/MYDOMAIN/user/2.0/USERNAME > 5. Check for the users Organization details, which reports back that it > does NOT exist, by GETing from > https://apps-apis.google.com/a/feeds/orguser/2.0/CUSTID/USER@EMAIL > > So the weird thing here is that the user management API reports that the > account exists but the organization API does not. At the same time, the user > does not show up in the Domain Dashboard. However, after 30+ minutes the > account then shows up in the Dashboard and the API can "move" OU's. > Thoughts? > > Thanks > ~ Ryan > > -- Andy "Rufus" Rothfusz | Developer Programs Engineer | Google | Mountain View, CA -- You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management 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-mgmt-apis?hl=en.
