I know this is simple, but I haven't used Zend_Gdata before, so I need some guidance. Please correct me if any of my assumptions are incorrect.
I am using Google Apps on my domain, so to get started, I would like to do something simple like listing all the users on the domain.
From what I understand, you need to use Zend_Gdata_ClientLogin
instead of Zend_Gdata_AuthSub
since I will be working with Zend_Gdata_Gapps
. This is what I've got so far:
$client = Zend_Gdata_ClientLogin::getHttpClient('[email protected]', 'password');
$gdata = new Zend_Gdata_Gapps($client, 'mydomain.com');
$users = $gdata->retrieveAllUsers();
However, retrieveAllUsers() is throwing an exception with this message:
Expected response code 200, got 401 <HTML> <HEAD> <TITLE>Token invalid</TITLE> </HEAD> <BODY BGCOLOR="#FFFFFF" TEXT="#000000"> <H1>Token invalid</H1> <H2>Error 401</H2> </BODY> </HTML>
What does that mean? What am I doing wrong? I don't know if it matters, but I am running this PHP script locally, but my Google Apps are running on a remote server. I am using Zend Framework version 1.7.5.
Update: If anyone is wondering, there were a few more problems I ran into while doing this. I found out that in order to use Zend_Gdata, you have the enable the "Provisioning API" in the admin section of your Google Apps. I found out that I only have the standard (free) version of Google Apps, which means that the Provisioning API is not available to me unless I have a premier (paid) version of Google Apps.