diff --git a/SpotifyAPI/Web/SpotifyWebAPI.cs b/SpotifyAPI/Web/SpotifyWebAPI.cs index ecaadf4d..3520347d 100644 --- a/SpotifyAPI/Web/SpotifyWebAPI.cs +++ b/SpotifyAPI/Web/SpotifyWebAPI.cs @@ -1934,7 +1934,29 @@ namespace SpotifyAPI.Web if(uris != null) ob.Add("uris", new JArray(uris)); if(offset != null) - ob.Add("offset", offset); + ob.Add("offset", new JObject { { "position", offset } }); + return UploadData(_builder.ResumePlayback(deviceId), ob.ToString(Formatting.None), "PUT"); + } + + /// + /// Start a new context or resume current playback on the user’s active device. + /// + /// The id of the device this command is targeting. If not supplied, the user's currently active device is the target. + /// Spotify URI of the context to play. + /// A JSON array of the Spotify track URIs to play. + /// Indicates from where in the context playback should start. + /// Only available when context_uri corresponds to an album or playlist object, or when the uris parameter is used. + /// + public ErrorResponse ResumePlayback(string deviceId = "", string contextUri = "", List uris = null, + string offset = "") + { + JObject ob = new JObject(); + if (!string.IsNullOrEmpty(contextUri)) + ob.Add("context_uri", contextUri); + if (uris != null) + ob.Add("uris", new JArray(uris)); + if (!string.IsNullOrEmpty(offset)) + ob.Add("offset", new JObject {{"uri", offset}}); return UploadData(_builder.ResumePlayback(deviceId), ob.ToString(Formatting.None), "PUT"); }