Example #1
0
        /// <summary>
        /// Change a playlist’s name and public/private state. (The user must, of course, own the playlist.)
        /// </summary>
        /// <param name="userId"></param>
        /// <param name="name"></param>
        /// <param name="isPublic"></param>
        /// <param name="token"></param>
        /// <returns></returns>
        public static async Task UpdateUsersPlaylist(string userId, string playlistId, string name, bool isPublic, AuthenticationToken token)
        {
            dynamic newObject = new System.Dynamic.ExpandoObject();

            newObject.name    = name;
            newObject.@public = isPublic;

            string jsonInput = JsonConvert.SerializeObject(newObject);
            var    json      = await HttpHelper.Put("https://api.spotify.com/v1/users/" + userId + "/playlists/" + playlistId, token, jsonInput);
        }
Example #2
0
 /// <summary>
 /// Save one or more tracks to the current user’s “Your Music” library.
 /// </summary>
 /// <param name="tracks"></param>
 /// <param name="token"></param>
 /// <returns></returns>
 public async Task SaveTracks(List <string> trackIds, AuthenticationToken token)
 {
     string tracksUri = CreateCommaSeperatedList(trackIds);
     var    json      = await HttpHelper.Put("https://api.spotify.com/v1/me/tracks?ids=" + tracksUri, token);
 }