Directory API, UPDATE / PATCH client does not work with "Invalid client language"

I am trying to use the Directory API to update a client object, but trying to change something at the top level will return a 400 error (invalid client language).

This is the source object (some elements have been edited to ensure confidentiality)

Request

GET https://www.googleapis.com/admin/directory/v1/customers/<customerID> 

answer

 200 OK { "kind": "admin#directory#customer", "id": "<customerID>", "etag": "\"<etag>\"", "customerDomain": "<domainName>", "alternateEmail": "<email>", "postalAddress": { "contactName": "<name>", "organizationName": "", "locality": "<city>", "region": "<state>", "countryCode": "US", "addressLine1": "<address1>", "addressLine2": "", "addressLine3": "", "postalCode": "<zip>" }, "phoneNumber": "<phoneNumber>", "language": "en", "customerCreationTime": "2011-03-31T03:45:49.408Z" } 

Attempting to update the phone number or language separately will result in an error. It doesn’t matter if I use a patch or update call.

Phone Patch:

 { "phoneNumber": "+18005551234" } 

Call a language patch:

 { "language": "en-GB" } 

Patch or Refresh Call Answer

 400 OK { "error": { "errors": [ { "domain": "global", "reason": "invalid", "message": "Invalid Customer language" } ], "code": 400, "message": "Invalid Customer language" } } 

Now I just play with online tools ( https://developers.google.com/admin-sdk/directory/v1/reference/customers/patch ) before I output it to the code. I did not find anything in the documents, forums, tray issues or here where the problem is addressed; Any help would be greatly appreciated!

+5
source share
2 answers

This seems to be a bug with online tools. I managed to successfully manage the object using the updated version of GAM ( https://github.com/jay0lee/GAM ), and I'm ready to move forward. I will leave it here if someone else runs into a problem.

+3
source

Using a PUT request works for me, in node-sdk I have something like this:

  google.admin('directory_v1').customers.update({ auth: auth, customerKey: 'my_customer' resource: { customerDomain: 'some-domain', } }, function(err, response) { // Some code } 
0
source

Source: https://habr.com/ru/post/1233097/


All Articles