Provision and Organize at the Same Time?

26 views
Skip to first unread message

Ryan

unread,
Oct 24, 2011, 3:49:31 PM10/24/11
to google-app...@googlegroups.com
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 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

unread,
Oct 27, 2011, 2:17:41 AM10/27/11
to google-app...@googlegroups.com
Hi Ryan,

The timing issue seems a little strange.  I'll check with some more engineers and see if there is a more deterministic way to create the user and modify the user's OU.

/Rufus


~ Ryan

--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.
To view this discussion on the web visit https://groups.google.com/d/msg/google-apps-mgmt-apis/-/q1j4iShHpG4J.
To post to this group, send email to google-app...@googlegroups.com.
To unsubscribe from this group, send email to google-apps-mgmt...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/google-apps-mgmt-apis?hl=en.



--
Andy "Rufus" Rothfusz | Developer Programs Engineer | Google | Mountain View, CA

Andy "Rufus" Rothfusz

unread,
Oct 27, 2011, 7:42:20 PM10/27/11
to google-app...@googlegroups.com
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 <pan...@traileyes.com> wrote:
Reply all
Reply to author
Forward
0 new messages