1
votes

According to https://developers.google.com/admin-sdk/directory/v1/reference/users

relations[].value   string  The name of the person the user is related to.   writable

However, if I try to create a relation of type "manager" with the value "John Smith", I get the following error:

com.google.api.client.googleapis.json.GoogleJsonResponseException: 400 Bad Request
{
  "code" : 400,
  "errors" : [ {
    "domain" : "global",
    "message" : "Invalid Email: John Smith",
    "reason" : "invalid"
  } ],
  "message" : "Invalid Email: John Smith"
}

Through trial and error, I've determined that the only value that will be accepted is an email address in the domain of the user you are attempting to update (it does not have to be a valid email address, i.e. an email address not used by one of the users registered in the domain).

Is this a bug in the API, or is it a deficiency in the documentation?

The interesting thing is that we have a client who has a few people with relations of type manager defined that have values that are not email addresses (i.e. "John Smith"). So, I'm thinking this may be a problem in the API.

1

1 Answers

0
votes

This is expected behavior and allows direct linking of an employee with their manager. If you wish to use free form text, use a custom type or one of the other types.

Update: The new user search functionality allows searching for a user's manager by email address externalId. This search is dependent on the manager being set to an email address as is required by the operation.