Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Directory API, Customer UPDATE/PATCH fails with "Invalid Customer language"

I'm trying to use the Directory API to update a customer object, but attempting to modify anything at the top-level results in a 400 (Invalid Customer Language) error being returned.

Here's the get of the initial object (some items redacted for privacy)

Request

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

Response

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 then update the phone number or language individually results in the error. It doesn't matter if I use a patch or update call.

Phone Number patch call:

{
  "phoneNumber": "+18005551234"
}

Language patch call:

{
  "language": "en-GB"
}

Patch or Update call response

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

Right now I'm just playing with the online tools (https://developers.google.com/admin-sdk/directory/v1/reference/customers/patch), before I pull it into code. I've not found anything in the docs, forums, issue tracker, or on here that addresses the issue; any assistance would be much appreciated!

like image 340
Gosherm Avatar asked Oct 19 '22 01:10

Gosherm


1 Answers

Looks like it's a bug with the online tools. I was able to successfully manipulate the object using an update version of GAM (https://github.com/jay0lee/GAM), and am ready to move forward. I'll leave this here in case anyone else runs across the problem.

like image 132
Gosherm Avatar answered Oct 22 '22 22:10

Gosherm