会社内の管理対象ユーザーを新規に作成します。このエンドポイントを使用できるのは、適切な管理者権限を持つユーザーとアプリケーションのみです。
id,type,name
レスポンスに含める属性のカンマ区切りリスト。このパラメータを使用すると、標準のレスポンスには通常含まれないフィールドをリクエストできます。
このパラメータを指定すると、明示的に指定しない限り標準フィールドはレスポンスに含まれず、リクエストしたフィールドのほかには、Mini版の表示のフィールドしか返されないことに注意してください。
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
ユーザーのタイムゾーン
追跡コードを使用すると、管理者は管理コンソールからレポートを生成し、特定のグループのユーザーに属性を割り当てることができます。この設定を使用するには、会社に対して有効にしておく必要があります。
tracking_code
tracking_code
次の値に固定: tracking_code
department
追跡コードの名前。管理コンソールであらかじめ設定しておく必要があります
Sales
追跡コードの値
新しく作成されたユーザーのユーザーオブジェクトを返します。
予期しないクライアントエラー。
curl -i -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('Temp 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)")
}
{
"id": 11446498,
"type": "user",
"address": "900 Jefferson Ave, Redwood City, CA 94063",
"avatar_url": "https://www.box.com/api/avatar/large/181216415",
"created_at": "2012-12-12T10:53:43-08:00",
"job_title": "CEO",
"language": "en",
"login": "ceo@example.com",
"max_upload_size": 2147483648,
"modified_at": "2012-12-12T10:53:43-08:00",
"name": "Aaron Levie",
"notification_email": {
"email": "notifications@example.com",
"is_confirmed": true
},
"phone": 6509241374,
"space_amount": 11345156112,
"space_used": 1237009912,
"status": "active",
"timezone": "Africa/Bujumbura"
}