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

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

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

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

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

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

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