用户插入方法不存储辅助电子邮件

Users insert method doesn't store secondary e-mail

是否可以选择使用 Google 目录 API 存储用户的辅助电子邮件?

我只是想用"emails"属性(根据它https://developers.google.com/admin-sdk/directory/v1/reference/users/insert),但是没有用。

这是我正在使用的请求正文示例:

{
    "name": {
        "familyName": "John",
        "givenName": "Doe",
        "fullname": "John Doe"
    },
    "primaryEmail": "john.doe@somesite.edu.br",
    "password": "somepasswordhere",
    "emails": {
        "address": "some.secondary.email.here@gmail.com",
        "primary": false,
        "type": "other",
    },
    "organizations": {
        "name": "Some Organization",
        "department": "Blah",
        "title": "Test",
        "type": "school",
    },
    "changePasswordAtNextLogin": true,
    "relations": {
        "type": "mother",
        "value": "John's Mother"
    }
}

对不起。我的错。

"emails" 属性 需要一个列表而不是像我放置的请求主体那样的对象。

所以,最终的请求体是:

"emails": [{
    "address": "some.secondary.email.here@gmail.com",
    "primary": false,
    "type": "other",
}],