Provisioning Api Creating a Group Http Protocol

62 views
Skip to first unread message

admin Patrizio

unread,
Dec 15, 2011, 2:54:15 PM12/15/11
to google-app...@googlegroups.com
Hi
I'm following the Provisioning API Developer's Guide ( http://code.google.com/intl/it-IT/googleapps/domain/provisioning_API_v2_developers_guide.html#Creating_a_User_for_a_Domain ) for implements some services.
I would like to Create a group using Http Protocol request as described in 'Methods for Groups' - 'Creating a Group' but the  request suggested contains only the url to inkove.
I tried to see also the atom feed reference (http://code.google.com/googleapps/domain/gdata_provisioning_api_v2.0_reference.html) and i find that '<apps:emailList>' are deprecated. Is there a way to create a group via HTTP protocol?
Regards
Patrizio Pontecorvi

Gunjan Sharma

unread,
Dec 15, 2011, 3:08:00 PM12/15/11
to google-app...@googlegroups.com
Hello Petrizio

We are aware of that issue. The doc is missing the POST request data. We will soon update it and will notify on this thread. Sorry for the inconvenience. By the time you can also try the gdata-client libraries to make call to the API and create groups using them. Creation of group is available in java, python, php, .Net libraries.

Thanks
Gunjan Sharma |  Developer Programs Engineer | gunjan...@google.com |  +91 7702534446



--
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/-/cgrJDqZeH1kJ.
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.

admin Patrizio

unread,
Dec 16, 2011, 10:54:18 AM12/16/11
to google-app...@googlegroups.com
Hello
thanks for the quick reply, 
I tried to use Java components to create a group, however, the example seams not complete because uses a variable groupsService which is not defined the class

This is the example:
import sample.appsforyourdomain.AppsForYourDomainClient;
...
AppsForYourDomainClient client = new AppsForYourDomainClient(email, password, domain);
groupsService.createGroup(String groupId, String groupName, String groupDescription, String emailPermission)

So I downloaded the source code to better understand what object to use and I found this in AppsForYourDomainClient.java

line 124
groupService = new AppsGroupsService(adminEmail, adminPassword, domain, "gdata-sample-AppsForYourDomain-AppsGroupService");

Then I wrote the following code

AppsForYourDomainClient client =Authentication.login("ad...@kelom.freehosting.com", "******", "kelom.freehosting.com");
AppsGroupsService groupService = new AppsGroupsService("ad...@kelom.freehosting.com", "********", "kelom.freehosting.com","gdata-sample-AppsForYourDomain-AppsGroupService");
GenericEntry entry =groupService.createGroup("MyGr", "MyGrName", "MyGrDes", null);
but at runtime I have this error
com.google.gdata.util.InvalidEntryException: Bad Request [Line 1, Column 319, element apps:property] apps:property/@value is required.
at com.google.gdata.client.http.HttpGDataRequest.handleErrorResponse(HttpGDataRequest.java:594)
at com.google.gdata.client.http.GoogleGDataRequest.handleErrorResponse(GoogleGDataRequest.java:563)
at com.google.gdata.client.http.HttpGDataRequest.checkResponse(HttpGDataRequest.java:552)
at com.google.gdata.client.http.HttpGDataRequest.execute(HttpGDataRequest.java:530)
at com.google.gdata.client.http.GoogleGDataRequest.execute(GoogleGDataRequest.java:535)
at com.google.gdata.client.Service.insert(Service.java:1409)
at com.google.gdata.client.GoogleService.insert(GoogleService.java:599)
at com.google.gdata.client.appsforyourdomain.AppsForYourDomainService.insert(AppsForYourDomainService.java:100)
at com.google.gdata.client.appsforyourdomain.AppsGroupsService.createGroup(AppsGroupsService.java:185)
at com.accenture.sdp.wrapper.google.Provisioning.main(Provisioning.java:63)

Could help me understand what's wrong?

Regards
Patrizio

Gunjan Sharma

unread,
Dec 19, 2011, 1:54:27 AM12/19/11
to google-app...@googlegroups.com
Hello Patrizio

Sorry for the inconvenience caused by the docs. We are updating them.
As far as the error is concerned this is because your are providing null to email_permission. If you wish not to provide any email_permission please use empty string like this.

GenericEntry entry =groupService.createGroup("MyGr", "MyGrName", "MyGrDes", "");

Thanks
Gunjan Sharma

Jay Lee

unread,
Dec 19, 2011, 9:34:02 AM12/19/11
to google-app...@googlegroups.com
FYI, here's the XML that the gdata-python-client library creates for the group creation POST DATA:

<?xml version=\'1.0\' encoding=\'UTF-8\'?>
  <ns1:property name="groupName" value="Group Name" />
  <ns1:property name="emailPermission" value="Anyone" />
  <ns1:property name="groupId" value="test_group_email" />
  <ns1:property name="description" value="Group Description" />
</ns0:entry>

Gunjan Sharma

unread,
Dec 19, 2011, 9:36:35 AM12/19/11
to google-app...@googlegroups.com
Also the docs have been updated for the same. Sorry again for the inconvenience caused.


Thanks
Gunjan Sharma | Developer Programs Engineer |  gunjan...@google.com | +91 7702534446



--
You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management APIs" group.

admin Patrizio

unread,
Dec 19, 2011, 1:47:25 PM12/19/11
to google-app...@googlegroups.com
Thanks to all
I solved the problem analyzing the source java yesterday, today I wanted to post some examples but I have seen that the guide has been updated.
The guide should be updated as well in the Java section.
For all methods in the management of groups should declare and initialize the object 'groupsService' as follows:

import com.google.gdata.client.appsforyourdomain.AppsGroupsService;
...
AppsGroupsService groupsService = new AppsGroupsService(email, password, domain,"gdata-sample-AppsForYourDomain-AppsGroupService");
groupsService.createGroup(String groupId, String groupName, String groupDescription, String emailPermission);

PS:This example creates a new group, use the method listed in the guide for other operations

Gunjan Sharma

unread,
Dec 22, 2011, 10:29:56 AM12/22/11
to google-app...@googlegroups.com
Hello Patrizio

We have updated the docs. The error were because we recently merged the provisioning docs of all languages into one consolidated doc and as with all changes there can be mistakes. Thank you for pointing them out.

Thanks
Gunjan Sharma
Reply all
Reply to author
Forward
0 new messages