perl - Calls to update a user return 200 OK but do not update user -


Previous Story:

Migrating from the provisioning API in the Admin SDK Directory API. Using Pearl I can successfully get a bearer token, and I can use the token to get the entire user's personal user resource and user resource list. It all works well I have ensured that I am using the appropriate area in token request ().

Issue: Calling 200 OK (expected) calls for user updates, but changes are not being taken.

Using LWP to put an updated request. After the request has returned, here is a dump of LWP objects. You can see that as a part of the reaction I am getting 200 Reaction and a User Resource object. You can also see that the returned user does not reflect the changes sent in the resource request. I have confirmed in the Admin console for the domain that the change was not taken.

Any help would be appreciated.

  '_ content' = & gt; "User name": "admin # directory # user", "id": "sommerbar", "etag": "\\" etag \\ "", "primary e-mail": "user @ googletestdomain", "Name": false, "last lagin time": "2014-10-02T17:" user name "," full name ":" user name "}," admin ": incorrect," delimited admin ":" wrong, "ipWhitelisted "", "Customer id", "email", "e-mail", "e-mail": "{@}", "primary": "primary": true},] "customer id": "cacidade", "organatepath ":" / "," Mailbox Setup ": True," In the Global Address List ": A) '_heders' = & gt; HTTP :: Headers = hash (0x2031048) ':: std_case' = & gt; Hash (0x2031240) 'optional-protocol' = & gt; 'Optional-Protocol' 'Client-Date' = & gt; 'Client-date' 'client-peer' = & gt; 'Client-peer' 'client-response-num' = & gt; 'Client-Response -M' 'Client-SSL-Cert-Issuer' = & gt; 'Client-SSL-Cert-issuer' 'client-ssl-cert-subject' = & gt; 'Client-SSL-Cert-Subject' 'client-SSL-cipher' = & gt; 'Client-SSL-cipher' 'client-ssl-socket-class' = & gt; 'Customer-SSL-socket-class' 'x-content-type-option' = & gt; 'X-content-type-option' 'x-frame-options' = & gt; 'X-frames-option' 'x-xss-protection' = & gt; 'X-XSS-Protection' 'Optional-Protocol' = & gt; '443: quic, p = 0.01' 'cache-control' = & gt; 'No-Cash, No-Store, Max-Age = 0,' - Client-Date '= & gt; 'Mon, 27 Oct 2014 17:48:14 GMT' 'Client-peer' = & gt; '173.194.79.95:443' 'Customer-Response-Number' = & gt; 1 'Client-SSL-Certificate Issuer' = & gt; '/ C = US / O = Google Inc. / CN = Google Internet Authority G2' 'client-SSL-cert-topic' = & gt; '/ C = US / ST = California / L = Mountain View / o = Google Inc. / CN = *. Googleapis.com '' client-ssl-cipher '' & gt; 'ECDHE-RSA-AES 128-GCM-SHA 256' 'client-SSL-socket-class' = & gt; 'IO :: Socket :: SSL' connection '= & gt; 'Closed' 'content-type' = & gt; 'Application / json; Charset = UTF-8 "Date" = & gt; 'Mon, 27 Oct 2014 17:48:14 GMT' 'Atag' => '' '' '' '' '' '' '=' 'Venus, 01 January 1990 00:00 GMT' 'Pragma => 'No-cache' server '= & gt; 'GSE' 'different' = & gt; ARRAY (0x20311b0) 0 'Origin' 1 'Referer' 2 'X-base' 'X-content-type-option' = & gt; 'Nosniff' 'x-frame-options' = & gt; 'FrontIgnign' 'x-xss-protection' = & gt; '1; Mode = block '' _msg '= & gt; 'OK' '_protocol' = & gt; 'Http / 1.1' '_rc' = & gt; 200 '_request' = & gt; HTTP :: request = hash (0x1f5dc90) '_content' = & gt; '{"Name": {"givenName": "BBB", "familyName": "BBB"}}' '_headers' = & gt; HTTP :: Headers = hash (0x224fa08) ':: std_case' = & gt; Hash (0x1f28c90) 'if -ssl-cert-subject' = & gt; 'If-SSL-Cert-Subject' 'Authority' = & gt; 'Bareer mitoconer' 'content-length' = & gt; 47 'User-agent' = & gt; 'Libwww-perl / 6.05' '_method' = & gt; 'PUT' '_uri' => URI :: https = Scalar (0x1cbc8b8) - & gt; 'Http: //www.googleapis.com/admin/directory/v1/users/user@googletestdomain' '_uri_canonical' = & gt; URI :: https = Scalar (0x1cbc8b8) - & gt; REUSED_ADDRESS  

Here is a sample code used:

  #! Uson / bin / perl -w uses JSON; Use LWP :: UserAgent; My $ auth_token = 'myauthtoken'; My $ change = {'name' = & gt; {'Dniam' = & gt; 'BBB',},}; My $ json = new JSON; My $ ur = $ json- & gt; Encode ($ change, {utf8 = & gt; 1}); My $ url = 'https://www.googleapis.com/admin/directory/v1/users/user@googletestdomain'; My $ ua = LWP :: UserAgeent-> New (Timeout => 30); My $ res = $ ua- & gt; Put ($ url, 'authorization' = & gt; 'barrier'. $ Auth_token, 'content' = & gt; $ ur,); Setting the    

content-type header to > PAT request application / Jason has been fixed.


Comments