google admin sdk - Cannot change includeInGlobalAddressList using Directory API -


I am trying to migrate a script from Directory API to Directory API. Its purpose is to manage the contact information of some Google Apps domain users using the Inline Global Address List.

I can get the user object, and I am able to submit a patch request, but the change is not made. The original value for InInGlobalAddressList included in the object received from the patch method contains some vague references to the tags in the API documentation, but it is not clear to me if the etagon should be included in the patch body or as an F-Match header. (If the answer is an F-match header, then how should I pass in the way the python library is used?)

  http = httplib2.Http () http = credentials .authorize (http) service = build ("admin", "directory_v1", http = http) usersvc = service.users () d = usersvc.get (userKey = userkey, projection = "original", field = "etag, id , includeInGlobalAddressList "). Execute () shown = d ['includeInGlobalAddressList] "from visible to invisible contact in transit" pch = json.dumps ({' includeInGlobalAddressList ': False,' etag ': d [' etag ']}) print pp res = usersvc I get the result: patch (userKey = userkey, body = pch   

):

 "" ""  {"includeInGlobalAddressList": false, "ETag ":" \ "WIg4sZOp0a-9Z5MJXVMQx1SQW5A / avXX6NaPX78Y6qFG7S4TqKFMIEU \" "} {" includeInGlobalAddressList ": true," ETag ":" \ "WIg4sZOp0a-9Z5MJXVMQx1SQW5A / J0MuBtIvJoTcifknCMScMlyCQnc \" "" id ":" 109793672165131484748 "}  < / Pre> 

This also happens when I do not use the field or pass the tag.

Pai There is no need to do GET prior to request. Patch's idea is that only the converted data is sent to the string. Try:

  service = build ("admin", "directory_v1 ", Http = http) usersvc = service.users () res = usersvc.patch (userKey = userkey, body = {" includeInGlobalAddressList ": false}, fields =" id, includeInGlobalAddressList "). Execute () Print Race    

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -