400 (Bad Request) when calling listGroups() method with Google API PHP client

I want to retrieve all groups in my domain. I'm using google api php client and have the following error when i try it :

$client = new Google_Client();

...

$directory = new Google_Service_Directory($client);

$directory->groups->listGroups();

Error calling GET https://www.googleapis.com/admin/directory/v1/groups: (400) Bad Request

Do you know how can i fix it ?

Answers


The problem has been fixed. I had to specify a domain in the listGroups() function :

$directory->groups->listGroups(array('domain' => 'mydomain.com'));

Need Your Help

Rails nested form error

jquery ruby-on-rails ruby-on-rails-4 nested-forms nested-attributes

I have no idea what could possibly be causing this. I am making my second nested form in an app. I have a website for students to get jobs. The Job model and form refers to work done off of the ...

How to integrate phpBB with Wordpress

wordpress plugins module integration phpbb3

Is there any way to integrate phpBB with Wordpress. I already have a wordpress blog and I need to integrate phpBB to it. I want to synchronize the user table of both phpBB and wordpress. User can a...

About UNIX Resources Network

Original, collect and organize Developers related documents, information and materials, contains jQuery, Html, CSS, MySQL, .NET, ASP.NET, SQL, objective-c, iPhone, Ruby on Rails, C, SQL Server, Ruby, Arrays, Regex, ASP.NET MVC, WPF, XML, Ajax, DataBase, and so on.