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
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives