Thanks for your response :) this clear the issue up posting some code for future references.
//Get API URL to manage users $url = https://apps-apis.google.com/a/feeds/yourdomain/user/2.0/[user_name]; //Get header for request $header[] = 'Content-type: application/atom+xml'; $header[] = 'Authorization: GoogleLogin auth=[authentication_token_from_google]; //Create a temporary file $xml = tmpfile(); fwrite($xml, $change_password_xml); fseek($xml, 0); //Create a new cURL resource $ch = curl_init(); //Set request options //Set URL curl_setopt($ch, CURLOPT_URL, $url); //Set post curl_setopt($ch, CURLOPT_PUT, TRUE); //Set request header curl_setopt($ch, CURLOPT_HTTPHEADER, $header); //Return response page curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE); //Set fields that are going to be post curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, FALSE); //Include header output (this will include the header in the $result variable ) curl_setopt($ch, CURLOPT_HEADER, 1); //Set file to be put curl_setopt($ch, CURLOPT_INFILE, $xml); curl_setopt($ch, CURLOPT_INFILESIZE, strlen($change_password_xml)); //Send the request to the browser $result = curl_exec($ch); //This will have the request response int $information array $information = curl_getinfo($ch); //Close cURL resource curl_close($ch); if ($result['http_code'] == 200) { //Do what ever you need to do here }//Server is overloaded try to change it again elseif ($result['http_code'] == 503) { //Do what ever you need to do } Note: Anything that is in [] would be replace with values from the current code. On Feb 17, 4:46 am, Claudio Cherubino <[email protected]> wrote: > Hi Ally, > > You have to check the HTTP Response Code for your PUT request, if it is 200 > then your update operation was performed successfully. > Unlike the other fields, the password is never returned so you won't find > its value in the response entry. > > Claudio > > On Wed, Feb 16, 2011 at 9:15 PM, Alejandra Rodriguez < > > [email protected]> wrote: > > Hi, > > > I am writing a Drupal module so that when a user changes his password in > > our site it would change in our Google email accounts. > > > I am getting my token previously and then sending: > > > <?xml version='1.0' encoding='utf-8'?> > > <atom:entry xmlns:atom='http://www.w3.org/2005/Atom'xmlns:apps=' > >http://schemas.google.com/apps/2006'> > > <apps:login userName='user_name' password='password' > > changePasswordAtNextLogin='false' hashFunctionName='SHA-1' suspended='false' > > admin='false' agreedToTerms='true' /> > > </atom:entry> > > > I am getting back > > > <?xml version='1.0' encoding='UTF-8'?> > > <entry xmlns='http://www.w3.org/2005/Atom'xmlns:apps=' > >http://schemas.google.com/apps/2006'xmlns:gd=' > >http://schemas.google.com/g/2005'> > > <id> > > >https://apps-apis.google.com/a/feeds/students.fhchs.edu/user/2.0/stud... > > </id> > > <updated> > > 1970-01-01T00:00:00.000Z</updated> > > <category scheme='http://schemas.google.com/g/2005#kind'term=' > >http://schemas.google.com/apps/2006#user'/> > > <title type='text'> > > student_test</title> > > <link rel='self' type='application/atom+xml' href=' > >https://apps-apis.google.com/a/feeds/mydomain/user/2.0/student_test'/> > > <link rel='edit' type='application/atom+xml' href=' > >https://apps-apis.google.com/a/feeds/mydomain/user/2.0/student_test'/> > > <apps:login userName='student_test' suspended='false' ipWhitelisted='false' > > admin='false' changePasswordAtNextLogin='false' agreedToTerms='false'/> > > <apps:quota limit='7168'/> > > <apps:name familyName='test' givenName='student'/> > > <gd:feedLink rel='http://schemas.google.com/apps/2006#user.nicknames' > > href=' > >https://apps-apis.google.com/a/feeds/mydomain/nickname/2.0?username=s... > > > <gd:feedLink rel='http://schemas.google.com/apps/2006#user.emailLists' > > href=' > >https://apps-apis.google.com/a/feeds/mydomain/emailList/2.0?recipient... > > > </entry> > > > I would like to find if the password has been change and I don't see > > anything that gives me a clue, I am following the what is recommended in > > >http://code.google.com/googleapps/domain/gdata_provisioning_api_v2.0_... > > > If you someone knows what can be done I will greatly appreciated :) > > > Thanks! > > Ally > > > -- > > You received this message because you are subscribed to the Google Groups > > "Google Apps Domain Information and Management 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-mgmt-apis?hl=en. -- You received this message because you are subscribed to the Google Groups "Google Apps Domain Information and Management 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-mgmt-apis?hl=en.
