Interface UserResources
- Namespace
- Smartsheet.Api
- Assembly
- smartsheet-csharp-sdk.dll
This interface provides methods to access User resources.
Thread Safety: Implementation of this interface must be thread safe.
public interface UserResources
Properties
SheetResources
Return the UserSheetResources object that provides access to sheets resources associated with User resources.
UserSheetResources SheetResources { get; }
Property Value
- UserSheetResources
the associated discussion resources
Methods
AddAlternateEmail(long, IEnumerable<AlternateEmail>)
Add alternate email(s).
It mirrors to the following Smartsheet REST API method: POST /users/{userId}/alternateemails
IList<AlternateEmail> AddAlternateEmail(long userId, IEnumerable<AlternateEmail> altEmails)
Parameters
userIdlongthe Id of the user
altEmailsIEnumerable<AlternateEmail>list of AlternateEmail(s)
Returns
- IList<AlternateEmail>
Return the list of AlternateEmails (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null)
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
AddProfileImage(long, string, string?)
Uploads a profile image for the specified user.
User AddProfileImage(long userId, string file, string? fileType = null)
Parameters
userIdlongthe Id of the user
filestringpath to the image file
fileTypestringfileType content type of the image file
Returns
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
AddUser(User, bool?, bool?)
Add a user to the organization
It mirrors to the following Smartsheet REST API method: POST /Users
User AddUser(User user, bool? sendEmail = null, bool? allowInviteAccountAdmin = null)
Parameters
userUserthe user
sendEmailbool?flag indicating whether or not to send a welcome email. Defaults to false.
allowInviteAccountAdminbool?if user is an admin in another organization, setting to true will invite their entire organization.
Returns
- User
the created user
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
DeactivateUser(long)
Deactivates the user associated with the current Smartsheet plan, blocking the user from using Smartsheet in any way. Deactivating a user does not affect their existing permissions on owned or shared items.
Optionally, with Enterprise Plan Manager (EPM) enabled, you can deactivate a user from child organizations.
It mirrors to the following Smartsheet REST API method: POST /users/{userId}/deactivate
void DeactivateUser(long userId)
Parameters
userIdlongThe ID of the user to deactivate.
Exceptions
- InvalidOperationException
If any argument is null or empty string.
- InvalidRequestException
User is not eligible for deactivation (e.g., email belongs to ISP domain, email unassociated with plan domain, or user is managed by external source like IdP or directory integration).
- AuthorizationException
Authentication failed or token missing. Requires System Admin permissions.
- ResourceNotFoundException
User not found.
- ServiceUnavailableException
Unexpected error on the server.
- SmartsheetException
If there is any other error during the operation.
DeleteAlternateEmail(long, long)
Delete alternate email.
It mirrors to the following Smartsheet REST API method: DELETE /users/{userId}/alternateemails/{alternateEmailId}
void DeleteAlternateEmail(long userId, long altEmailId)
Parameters
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
DowngradeUser(long, long, DowngradeSeatType)
Downgrades a user's seat type within your Smartsheet organization or plan from a licensed Member, Provisional Member or Guest to a non-licensed Viewer or Guest.
It mirrors to the following Smartsheet REST API method: POST /users/{userId}/plans/{planId}/downgrade
void DowngradeUser(long userId, long planId, DowngradeSeatType seatType)
Parameters
userIdlongThe ID of the user to downgrade.
planIdlongThe ID of the plan.
seatTypeDowngradeSeatTypeThe seat type to downgrade to ("VIEWER" or "GUEST").
Exceptions
- InvalidOperationException
If any argument is null or empty string.
- InvalidRequestException
User is not eligible for downgrade (e.g., not Active, not Member/Provisional/Guest, or is an admin and removeAdminStatus is false).
- AuthorizationException
Authentication failed or token missing.
- ResourceNotFoundException
User not found.
- ServiceUnavailableException
Unexpected error on the server.
- SmartsheetException
If there is any other error during the operation.
GetAlternateEmail(long, long)
Get alternate email.
It mirrors to the following Smartsheet REST API method: GET /users/{userId}/alternateemails/{alternateEmailId}
AlternateEmail GetAlternateEmail(long userId, long altEmailId)
Parameters
Returns
- AlternateEmail
Return the AlternateEmail (note that if there is no such resource, this method will throw ResourceNotFoundException rather than returning null)
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
GetCurrentUser()
Get the current user.
It mirrors to the following Smartsheet REST API method: GET /users/me
UserProfile GetCurrentUser()
Returns
- UserProfile
the current user
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
GetCurrentUser(IEnumerable<UserInclusion>?)
Get the current user.
It mirrors to the following Smartsheet REST API method: GET /users/me
UserProfile GetCurrentUser(IEnumerable<UserInclusion>? includes = null)
Parameters
includesIEnumerable<UserInclusion>used to specify the optional objects to include.
Returns
- UserProfile
the current user
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
GetUser(long)
Gets the user.
It mirrors to the following Smartsheet REST API method: GET /users/{userId}
UserProfile GetUser(long userId)
Parameters
userIdlongthe user Id
Returns
- UserProfile
the user
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
ListAlternateEmails(long, PaginationParameters?)
List all user alternate email(s).
It mirrors to the following Smartsheet REST API method: GET /users/{userId}/alternateemails
PaginatedResult<AlternateEmail> ListAlternateEmails(long userId, PaginationParameters? pagination = null)
Parameters
userIdlongthe Id of the user
paginationPaginationParametersthe pagination
Returns
- PaginatedResult<AlternateEmail>
the list of all AlternateEmails
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
ListUserPlans(long, string?, long?)
Fetch all user's plans.
It mirrors to the following Smartsheet REST API method: GET /2.0/users/{userId}/plans
TokenPaginatedResult<UserPlan> ListUserPlans(long userId, string? lastKey, long? maxItems)
Parameters
userIdlongThe ID of the user to fetch plans for.
lastKeystringThe last key for pagination.
maxItemslong?The maximum number of items to return.
Returns
- TokenPaginatedResult<UserPlan>
TokenPaginatedResult<T> object containing UserPlan.
Exceptions
- InvalidOperationException
If any argument is null or empty string.
- InvalidRequestException
If there is any problem with the REST API request.
- AuthorizationException
If there is any problem with the REST API authorization.
- ResourceNotFoundException
If the user cannot be found (404 Not Found).
- ServiceUnavailableException
If the REST API service is not available (possibly due to rate limiting or 500 Internal Server Error).
- SmartsheetException
If there is any other error during the operation.
ListUsers(IEnumerable<string>, IEnumerable<ListUserInclusion>?, PaginationParameters?)
Gets the list of Users in the organization. To filter by email, use the optional email query string parameter to specify a list of users’ email addresses.
It mirrors to the following Smartsheet REST API method: GET /Users
PaginatedResult<User> ListUsers(IEnumerable<string> emails, IEnumerable<ListUserInclusion>? includes = null, PaginationParameters? paging = null)
Parameters
emailsIEnumerable<string>list of email addresses on which to filter the results
includesIEnumerable<ListUserInclusion>elements to include in response
pagingPaginationParametersthe pagination
Returns
- PaginatedResult<User>
the list of all Users
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
ListUsers(IEnumerable<string>, long?, SeatType?, PaginationParameters?)
Gets the list of Users in the organization with plan and seat type filtering.
It mirrors to the following Smartsheet REST API method: GET /2.0/users
PaginatedResult<User> ListUsers(IEnumerable<string> emails, long? planId, SeatType? seatType, PaginationParameters? paging = null)
Parameters
emailsIEnumerable<string>list of email addresses on which to filter the results
planIdlong?plan ID to filter users
seatTypeSeatType?seat type to filter users
pagingPaginationParametersthe pagination
Returns
- PaginatedResult<User>
the list of filtered Users
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
PromoteAlternateEmail(long, long)
Promote an alternate email to primary.
It mirrors to the following Smartsheet REST API method: POST /users/{userId}/alternateemails/{alternateEmailId}/makeprimary
AlternateEmail PromoteAlternateEmail(long userId, long altEmailId)
Parameters
Returns
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
ReactivateUser(long)
Reactivates the user associated with the current Smartsheet plan, restoring the user's access to Smartsheet, owned items, and shared items.
Optionally, with Enterprise Plan Manager (EPM) enabled, you can specify the ID of a user within your managed plan hierarchy.
Important: You can reactivate the user only if that user has been deactivated for less than thirty (30) days.
It mirrors to the following Smartsheet REST API method: POST /users/{userId}/reactivate
void ReactivateUser(long userId)
Parameters
userIdlongThe ID of the user to reactivate.
Exceptions
- InvalidOperationException
If any argument is null or empty string.
- InvalidRequestException
User is not eligible for reactivation (e.g., email belongs to ISP domain, email unassociated with plan domain, user not in organization, or deactivated for more than 30 days).
- AuthorizationException
Authentication failed or token missing. Requires System Admin permissions.
- ResourceNotFoundException
User not found.
- ServiceUnavailableException
Unexpected error on the server.
- SmartsheetException
If there is any other error during the operation.
RemoveUser(long, long?, bool?, bool?)
Removes a User from an organization. User is transitioned to a free collaborator with read-only access to owned sheets (unless those are optionally transferred to another user).
It mirrors to the following Smartsheet REST API method: DELETE /user{Id}
void RemoveUser(long userId, long? transferTo = null, bool? transferSheets = null, bool? removeFromSharing = null)
Parameters
userIdlongthe Id of the user
transferTolong?(required if user owns groups): The ID of the user to transfer ownership to. If the user being deleted owns groups, they will be transferred to this user. If the user owns sheets, and transferSheets is true, then the deleted user’s sheets will be transferred to this user.
transferSheetsbool?If true, and transferTo is specified, the deleted user’s sheets will be transferred. Else, sheets will not be transferred. Defaults to false.
removeFromSharingbool?Set to true to remove the user from sharing for all sheets/workspaces in the organization. If not specified, User will not be removed from sharing.
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
RemoveUserFromPlan(long, long)
Removes a user from a plan.
It mirrors to the following Smartsheet REST API method: DELETE /2.0/users/{userId}/plans/{planId}
void RemoveUserFromPlan(long userId, long planId)
Parameters
userIdlongThe ID of the user to remove from the plan.
planIdlongThe ID of the plan to remove the user from.
Exceptions
- InvalidOperationException
If any argument is null or empty string.
- InvalidRequestException
If there is any problem with the REST API request.
- AuthorizationException
If there is any problem with the REST API authorization.
- ResourceNotFoundException
If the user cannot be found (404 Not Found).
- ServiceUnavailableException
If the REST API service is not available (possibly due to rate limiting or 500 Internal Server Error).
- SmartsheetException
If there is any other error during the operation.
UpdateUser(User)
Update a user.
It mirrors to the following Smartsheet REST API method: PUT /users/{userId}
User UpdateUser(User user)
Parameters
userUserthe user to update
Returns
- User
the updated user
Exceptions
- InvalidOperationException
if any argument is null or empty string
- InvalidRequestException
if there is any problem with the REST API request
- AuthorizationException
if there is any problem with the REST API authorization (access token)
- ResourceNotFoundException
if the resource cannot be found
- ServiceUnavailableException
if the REST API service is not available (possibly due to rate limiting)
- SmartsheetException
if there is any other error during the operation
UpgradeUser(long, long, UpgradeSeatType?)
Upgrades a user's seat type within your Smartsheet organization or plan to a licensed Member or Guest.
It mirrors to the following Smartsheet REST API method: POST /users/{userId}/plans/{planId}/upgrade
void UpgradeUser(long userId, long planId, UpgradeSeatType? seatType)
Parameters
userIdlongThe ID of the user to upgrade.
planIdlongThe ID of the plan.
seatTypeUpgradeSeatType?The seat type to upgrade to ("MEMBER" or "GUEST").
Exceptions
- InvalidOperationException
If any argument is null or empty string.
- InvalidRequestException
If there is any problem with the REST API request.
- AuthorizationException
If there is any problem with the REST API authorization.
- ResourceNotFoundException
If the user cannot be found (404 Not Found).
- ServiceUnavailableException
If the REST API service is not available (possibly due to rate limiting or 500 Internal Server Error).
- SmartsheetException
If there is any other error during the operation.