Remove User API

Cagri Tanyar
Cagri Tanyar โœญโœญ

Hello,

I am attempting to remove a user and transfer their files to another user.

Although the API documentation is clear, I am not getting the desired results.

User gets deleted, but the sheets never get transferred:


constย optionsย =ย {

ย ย ย ย ย ย ย ย id:ย personToDelete.id,

ย ย ย ย ย ย ย ย transferSheets:ย true,

ย ย ย ย ย ย ย ย transferTo:ย userToTransferTo.id,

ย ย ย ย }

ย ย ย ย constย deleteResultย =ย awaitย smartsheet.users.removeUser(options);ย 

ย ย ย ย console.log(deleteResult);


I get { message: 'SUCCESS', resultCode: 0 } from this operation, but the files do not get transferred.


This is what I am following:

https://smartsheet-platform.github.io/api-docs/?javascript#remove-user


The person I am trying to transfer the sheets to is a Licensed user, Resource Viewer, Group Admin, and System Admin, whose account status Active.


I appreciate any guidance.


Thanks,

Tanyar

Best Answer

Answers

  • Cagri Tanyar
    Cagri Tanyar โœญโœญ

    Thank you @Genevieve P !!!

    For anyone else looking for further help with this, here is the solution:

    constย optionsย =ย {

    ย ย ย ย ย ย ย ย id:ย personToDelete.id,

    queryParameters: {

    ย ย ย ย ย ย ย ย  transferSheets:ย true,

    ย ย ย ย ย ย ย ย  transferTo:ย userToTransferTo.id,

    }

    ย ย ย ย }

    ย ย ย ย constย deleteResultย =ย awaitย smartsheet.users.removeUser(options);ย 

    ย ย ย ย console.log(deleteResult);


    Thanks,

    Tanyar

  • Thanks for sharing your final solution! I'm glad you figured it out.

    Need more information? ๐Ÿ‘€ | Help and Learning Center

    ใ“ใ‚“ใซใกใฏ (Konnichiwa), Hallo, Hola, Bonjour, Olรก, Ciao!๐Ÿ‘‹ | Global Discussions

NEW Smartsheet API Documentation - bookmark the updated link! https://developers.smartsheet.com