box / boxcli

A command line interface for interacting with the Box API.
https://developer.box.com
Apache License 2.0
222 stars 59 forks source link

box users:update ID --login=New@Email.com not working #449

Closed TomAguero closed 1 year ago

TomAguero commented 1 year ago

Description of the Issue

I'm trying to update user's login email address and display name to remain in sync for when we rename them in our SSO provider. I'm using the command

box users:update 12345678 --login=NewName@Domain.com --name="New Name"

and the --login part is not working, it throws back an Unexpected API Response 400 Bad Request error. If I remove the --login part and only do --name it works fine and does rename the account, so the account I'm using to log in to Box CLI does have permissions to change user info.

Steps to Reproduce

  1. Connect to Box CLI
  2. Get the ID for a user
  3. run box users:update ID --login=NewEmail@Domain.com
  4. See error

Expected Behavior

To update the users login/email address

Error Message, Including Stack Trace

Unexpected API Response [400 Bad Request | aty454h9ue4c6m0x.169269534a0286fc3df34479e8ca6c142] bad_request - Bad Request The core of that is the same every time, but the alphanumeric series changes every time.

Versions Used

Box CLI: 3.6.0 win32-64 node-v14.19.3 Operating System: Windows 10

antusus commented 1 year ago

Hi,

documentation says that the email address must be verified. https://developer.box.com/reference/put-users-id/ I can see in the error logs that this email is not verified. You will need to add new domain to your account, then you can add new email and verify it and switch email address. https://developer.box.com/reference/post-users-id-email-aliases

TomAguero commented 1 year ago

So essentially there isn't feature parity with the website? I am able to go to the Box website and change someone's primary email without adding an alias or verifying the address.

antusus commented 1 year ago

Looks like this is the case. You can change the email from admin console but you cannot using the API. If you want you could reach out to Box Support directly (https://support.box.com/hc/en-us/requests/new) and describe the issue. SDK is just wrapping the APIs that are provided so if something is missing or not working the same as in the UI support will be able to connect you directly with the service owners and they might have an answer.

TomAguero commented 1 year ago

Thank you for confirming that. I will go ahead and reach out to Box support.