Interface FavoriteResources
- Namespace
- Smartsheet.Api
- Assembly
- smartsheet-csharp-sdk.dll
This interface provides methods to access Favorite resources.
Thread Safety: Implementation of this interface must be thread safe.
public interface FavoriteResources
Methods
AddFavorites(IEnumerable<Favorite>)
Adds one or more items to the user’s list of Favorite items.
It mirrors to the following Smartsheet REST API method: POST /favorites
If called with a single Favorite object, and that favorite already exists, error code 1129 will be returned. If called with an array of Favorite objects, any objects specified in the array that are already marked as favorites will be ignored and omitted from the response.
IList<Favorite> AddFavorites(IEnumerable<Favorite> favorites)
Parameters
favorites
IEnumerable<Favorite>list of favorite objects
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
ListFavorites(PaginationParameters?)
Gets a list of all of the user’s Favorite items.
It mirrors to the following Smartsheet REST API method: GET /favorites
PaginatedResult<Favorite> ListFavorites(PaginationParameters? paging = null)
Parameters
paging
PaginationParametersthe pagination
Returns
- PaginatedResult<Favorite>
A list of all Favorites (note that an empty list will be returned if there are none).
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
RemoveFavorites(ObjectType, IList<long>)
Removes one or multiple objects from the user’s list of Favorite items.
It mirrors to the following Smartsheet REST API methods:
- DELETE /favorites/folder
- DELETE /favorites/report
- DELETE /favorites/sheet
- DELETE /favorites/template
- DELETE /favorites/workspace
void RemoveFavorites(ObjectType type, IList<long> objectIds)
Parameters
type
ObjectTypethe object type to remove
objectIds
IList<long>(required): object IDs representing the items to remove from Favorites. If type is "template", only private sheet-type template ID is allowed.
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