I suggest that you carefully debug your code, particularly by printing out the complete username string that you construct by grabbing the different pieces. Only then you can be sure that you're sending the right username to Google.
-Patricia > -----Original Message----- > From: [email protected] > [mailto:[EMAIL PROTECTED] On Behalf Of Met Sacramento > Sent: Friday, September 26, 2008 12:39 PM > To: Google Apps APIs > Subject: [google-apps-apis] Problem with Provisioning API > > > Hey GAFYD Group... > > I'm having some problems with the provisioning API. I'm > trying to retrieve a user by a username submitted via GET/POST. > > When I explicitly pass the service.RetrieveUser() the > username, it works fine. When I pass it a variable (i.e. > self.request.get("username")... I'm using this on AppEngine), > it gives me the following stacktrace: > > > Traceback (most recent call last): > File "C:\Documents and Settings\setup\workspace\Google > AppEngine \google\appengine\ext\webapp\__init__.py", line > 496, in __call__ > handler.get(*groups) > File "C:\Documents and Settings\setup\workspace\PasswordReset\src > \resetpass.py", line 42, in get > self.response.out.write(service.RetrieveUser(username)) > File "C:\Documents and Settings\setup\workspace\PasswordReset\src > \gdata\apps\service.py", line 357, in RetrieveUser > return gdata.apps.UserEntryFromString(str(self.Get(uri))) > File "C:\Documents and Settings\setup\workspace\PasswordReset\src > \gdata\service.py", line 665, in Get > headers=extra_headers) > File "C:\Documents and Settings\setup\workspace\PasswordReset\src > \atom\service.py", line 163, in request > data=data, headers=all_headers) > File "C:\Documents and Settings\setup\workspace\PasswordReset\src > \atom\http_interface.py", line 148, in perform_request > return http_client.request(operation, url, data=data, > headers=headers) > File "C:\Documents and Settings\setup\workspace\PasswordReset\src > \gdata\alt\appengine.py", line 123, in request > method=method, headers=all_headers)) > File "C:\Documents and Settings\setup\workspace\Google > AppEngine \google\appengine\api\urlfetch.py", line 257, in fetch > raise InvalidURLError(str(e)) > InvalidURLError: ApplicationError: 1 > > What does this mean? Here is the code: > > service = gdata.apps.service.AppsService(email="[EMAIL PROTECTED]", > domain="DOMAIN.org", password="PASSWORD") > gdata.alt.appengine.run_on_appengine(service) > service.ProgrammaticLogin() > username = string.lower(self.request.get("firstname")) > + "-" + string.lower(self.request.get("lastname")) > self.response.out.write(username) > userobj = False > > self.response.out.write(service.RetrieveUser(username)) > > > You can see that I piece together the username (in the format > firstname-lastname) and create the username variable, from > GET variables "firstname" and "lastname". > > Any ideas? > > --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
