Remove User API
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
-
It looks like you need to add an additional level into the options object called
queryParameters
So, instead of options.transferSheets it should be:
options.queryParameters.transferSheets
The same adjustment would need to be made for transferTo. Does that make sense? You can see an example of adding queryParameters on this page, here:
https://smartsheet-platform.github.io/api-docs/#query-strings
Let me know if this works for you!
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Answers
-
It looks like you need to add an additional level into the options object called
queryParameters
So, instead of options.transferSheets it should be:
options.queryParameters.transferSheets
The same adjustment would need to be made for transferTo. Does that make sense? You can see an example of adding queryParameters on this page, here:
https://smartsheet-platform.github.io/api-docs/#query-strings
Let me know if this works for you!
Cheers,
Genevieve
Need more help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
-
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 help? 👀 | Help and Learning Center
こんにちは (Konnichiwa), Hallo, Hola, Bonjour, Olá, Ciao! 👋 | Global Discussions
Categories
- All Categories
- 14 Welcome to the Community
- Customer Resources
- 64.9K Get Help
- 439 Global Discussions
- 138 Industry Talk
- 471 Announcements
- 4.9K Ideas & Feature Requests
- 129 Brandfolder
- 148 Just for fun
- 68 Community Job Board
- 488 Show & Tell
- 33 Member Spotlight
- 2 SmartStories
- 300 Events
- 36 Webinars
- 7.3K Forum Archives