Table of Contents

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

userId long

the Id of the user

altEmails IEnumerable<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

userId long

the Id of the user

file string

path to the image file

fileType string

fileType content type of the image file

Returns

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

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

user User

the user

sendEmail bool?

flag indicating whether or not to send a welcome email. Defaults to false.

allowInviteAccountAdmin bool?

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

userId long

The 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

userId long

the Id of the user

altEmailId long

the alternate email Id

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

userId long

The ID of the user to downgrade.

planId long

The ID of the plan.

seatType DowngradeSeatType

The 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

userId long

the Id of the user

altEmailId long

the alternate email Id

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

includes IEnumerable<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

userId long

the 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

userId long

the Id of the user

pagination PaginationParameters

the 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

userId long

The ID of the user to fetch plans for.

lastKey string

The last key for pagination.

maxItems long?

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

emails IEnumerable<string>

list of email addresses on which to filter the results

includes IEnumerable<ListUserInclusion>

elements to include in response

paging PaginationParameters

the 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

emails IEnumerable<string>

list of email addresses on which to filter the results

planId long?

plan ID to filter users

seatType SeatType?

seat type to filter users

paging PaginationParameters

the 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

userId long

the Id of the user

altEmailId long

the alternate email Id

Returns

AlternateEmail

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

userId long

The 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).

This operation is only available to system administrators.

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

userId long

the Id of the user

transferTo long?

(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.

transferSheets bool?

If true, and transferTo is specified, the deleted user’s sheets will be transferred. Else, sheets will not be transferred. Defaults to false.

removeFromSharing bool?

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

userId long

The ID of the user to remove from the plan.

planId long

The 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

user User

the 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

userId long

The ID of the user to upgrade.

planId long

The ID of the plan.

seatType UpgradeSeatType?

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.