会社内の管理対象ユーザーを新規に作成します。このエンドポイントを使用できるのは、適切な管理者権限を持つユーザーとアプリケーションのみです。
id,type,name
応答に含める属性のカンマ区切りリスト。このパラメータを使用すると、標準の応答には通常含まれないフィールドをリクエストできます。
このパラメータを指定すると、明示的に指定しない限り標準フィールドは応答に含まれず、リクエストしたフィールドのほかには、簡易版レプリゼンテーションのフィールドしか返されないことに注意してください。
900 Jefferson Ave, Redwood City, CA 94063
255
ユーザーの住所
true
ユーザーが自身の連絡先リストで会社の他のユーザーを参照できるかどうか
my-user-1234
ユーザーの検索に使用できるアプリユーザーの外部識別子。これを使用して、外部IDプロバイダのユーザーIDをBoxユーザーに結び付けることが使用できます。
true
会社のデバイス制限からユーザーを除外するかどうか
true
ユーザーが2要素認証を使用する必要があるかどうか
true
ユーザーが社外のユーザーとのコラボレーションを許可されているかどうか
true
ユーザーがアプリユーザーであることを示します。
true
ユーザーがBox Syncを使用できるかどうか
CEO
100
ユーザーの役職
boss@box.com
ユーザーがログインに使用するメールアドレス
is_platform_access_only
がtrue
に設定されている場合を除いて必須です。
Aaron Levie
50
ユーザーの名前
6509241374
100
ユーザーの電話番号
user
ユーザーの会社ロール
次の値のいずれか1つ: coadmin
,user
11345156112
ユーザーが利用可能な容量の合計(バイト数)。これを-1
に設定すると
ストレージ容量が無制限になります。
active
ユーザーのアカウントのステータス
次の値のいずれか1つ: active
,inactive
,cannot_delete_edit
,cannot_delete_edit_upload
Africa/Bujumbura
ユーザーのタイムゾーン
["code1: 12345"]
追跡コードを使用すると、管理者は管理コンソールからレポートを生成し、特定のグループのユーザーに属性を割り当てることができます。この設定を使用するには、会社に対して有効にしておく必要があります。
curl -X POST https://api.box.com/2.0/users \
-H 'Authorization: Bearer <ACCESS_TOKEN>" '
-H 'Content-Type: application/json" '
-d '{
"login": "ceo@example.com",
"name": "Aaron Levie"
}'
var userParams = new BoxUserRequest()
{
Name = "Example User",
Login = "user@example.com"
};
BoxUser newUser = await client.UsersManager.CreateEnterpriseUserAsync(userParams);
BoxUser.Info createdUserInfo = BoxUser.createEnterpriseUser(api, "user@example.com", "A User");
new_user = client.create_user('Dummy User', 'user@example.com')
client.enterprise.addUser(
'eddard@winterfell.example.com',
'Ned Stark',
{
role: client.enterprise.userRoles.COADMIN,
address: '555 Box Lane',
status: client.enterprise.userStatuses.CANNOT_DELETE_OR_EDIT
})
.then(user => {
/* user -> {
type: 'user',
id: '44444',
name: 'Ned Stark',
login: 'eddard@winterfell.example.com',
created_at: '2012-11-15T16:34:28-08:00',
modified_at: '2012-11-15T16:34:29-08:00',
role: 'coadmin',
language: 'en',
timezone: 'America/Los_Angeles',
space_amount: 5368709120,
space_used: 0,
max_upload_size: 2147483648,
status: 'active',
job_title: '',
phone: '',
address: '555 Box Lane',
avatar_url: 'https://www.box.com/api/avatar/large/deprecated' }
*/
});
client.users.create(login: "new.user@example.com", name: "New User") { (result: Result<User, BoxSDKError>) in
guard case let .success(user) = result else {
print("Error creating user")
return
}
print("Created user \(user.name), with login \(user.login)")
}