lynx   »   [go: up one dir, main page]

Box Developer Documentation

Delete User

Delete User

The process for deleting both app and managed users is the same. To delete a user account, supply the user ID for the account that should be removed.

cURL
curl -i -X DELETE "https://api.box.com/2.0/users/12345" \
     -H "authorization: Bearer <ACCESS_TOKEN>"
Node/TypeScript v10
await client.users.deleteUserById(user.id);
Python v10
client.users.delete_user_by_id(user.id)
.NET v10
await client.Users.DeleteUserByIdAsync(userId: user.Id);
Swift v10
try await client.users.deleteUserById(userId: user.id)
Java v10
client.getUsers().deleteUserById(user.getId())
Java v4
BoxUser user = new BoxUser(api, "0");
user.delete(false, false);
Python v3
user_id = '33333'
client.user(user_id).delete(force=True)
.NET v5
await client.UsersManager.DeleteEnterpriseUserAsync("44444", notify: false, force: true);
Node v3
// Delete the user even if they still have files in their account
client.users.delete('123', {force: true})
    .then(() => {
        // deletion succeeded — no value returned
    });

There are also two optional parameters that may be set when deleting a user account:

  • force: Whether the user should be deleted even if the account still has content in it.
  • notify: Whether the user will receive a notification that the account was deleted.

The delete user request will fail if the user account still has content in it. To resolve this, either transfer all files or folders to another account or use the optional force parameter.

Лучший частный хостинг