AddFavorites() public method

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.

if any argument is null or empty string if there is any problem with the REST API request if there is any problem with the REST API authorization (access token) if the resource cannot be found if the REST API service is not available (possibly due To rate limiting) if there is any other error during the operation
public AddFavorites ( IEnumerable favorites ) : IList
favorites IEnumerable list of favorite objects
return IList
Example #1
0
        public virtual void TestAddFavorites()
        {
            server.setResponseBody("../../../TestSDK/resources/addFavorites.json");

            Favorite         fav1      = new Favorite.AddFavoriteBuilder(ObjectType.SHEET, 8400677765441412).Build();
            IList <Favorite> favorites = favoriteResource.AddFavorites(new Favorite[] { fav1 });

            Assert.IsTrue(favorites[0].Type == ObjectType.SHEET);
            Assert.IsTrue(favorites[0].ObjectId == 8400677765441412);
        }