Spotify.NET/assets/js/bbb8f1f8.3697ef02.js
2022-01-25 19:34:48 +00:00

1 line
15 KiB
JavaScript

"use strict";(self.webpackChunkspotify_api_docs=self.webpackChunkspotify_api_docs||[]).push([[5643],{3905:function(e,t,n){n.d(t,{Zo:function(){return m},kt:function(){return k}});var r=n(7294);function a(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?l(Object(n),!0).forEach((function(t){a(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):l(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function i(e,t){if(null==e)return{};var n,r,a=function(e,t){if(null==e)return{};var n,r,a={},l=Object.keys(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||(a[n]=e[n]);return a}(e,t);if(Object.getOwnPropertySymbols){var l=Object.getOwnPropertySymbols(e);for(r=0;r<l.length;r++)n=l[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(a[n]=e[n])}return a}var p=r.createContext({}),s=function(e){var t=r.useContext(p),n=t;return e&&(n="function"==typeof e?e(t):o(o({},t),e)),n},m=function(e){var t=s(e.components);return r.createElement(p.Provider,{value:t},e.children)},u={inlineCode:"code",wrapper:function(e){var t=e.children;return r.createElement(r.Fragment,{},t)}},d=r.forwardRef((function(e,t){var n=e.components,a=e.mdxType,l=e.originalType,p=e.parentName,m=i(e,["components","mdxType","originalType","parentName"]),d=s(n),k=a,N=d["".concat(p,".").concat(k)]||d[k]||u[k]||l;return n?r.createElement(N,o(o({ref:t},m),{},{components:n})):r.createElement(N,o({ref:t},m))}));function k(e,t){var n=arguments,a=t&&t.mdxType;if("string"==typeof e||a){var l=n.length,o=new Array(l);o[0]=d;var i={};for(var p in t)hasOwnProperty.call(t,p)&&(i[p]=t[p]);i.originalType=e,i.mdxType="string"==typeof e?e:a,o[1]=i;for(var s=2;s<l;s++)o[s]=n[s];return r.createElement.apply(null,o)}return r.createElement.apply(null,n)}d.displayName="MDXCreateElement"},5562:function(e,t,n){n.r(t),n.d(t,{frontMatter:function(){return o},contentTitle:function(){return i},metadata:function(){return p},toc:function(){return s},default:function(){return u}});var r=n(3117),a=n(102),l=(n(7294),n(3905)),o={id:"follow",title:"Follow",sidebar_label:"Follow"},i=void 0,p={unversionedId:"web/follow",id:"version-5.1.1/web/follow",isDocsHomePage:!1,title:"Follow",description:"Follow",source:"@site/versioned_docs/version-5.1.1/web/follow.md",sourceDirName:"web",slug:"/web/follow",permalink:"/SpotifyAPI-NET/docs/5.1.1/web/follow",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/versioned_docs/version-5.1.1/web/follow.md",version:"5.1.1",lastUpdatedBy:"dependabot[bot]",lastUpdatedAt:1643139178,formattedLastUpdatedAt:"1/25/2022",frontMatter:{id:"follow",title:"Follow",sidebar_label:"Follow"},sidebar:"version-5.1.1/someSidebar",previous:{title:"Browse",permalink:"/SpotifyAPI-NET/docs/5.1.1/web/browse"},next:{title:"Library",permalink:"/SpotifyAPI-NET/docs/5.1.1/web/library"}},s=[{value:"Follow",id:"follow",children:[]},{value:"Unfollow",id:"unfollow",children:[]},{value:"IsFollowing",id:"isfollowing",children:[]},{value:"FollowPlaylist",id:"followplaylist",children:[]},{value:"UnfollowPlaylist",id:"unfollowplaylist",children:[]},{value:"IsFollowingPlaylist",id:"isfollowingplaylist",children:[]}],m={toc:s};function u(e){var t=e.components,n=(0,a.Z)(e,["components"]);return(0,l.kt)("wrapper",(0,r.Z)({},m,n,{components:t,mdxType:"MDXLayout"}),(0,l.kt)("h2",{id:"follow"},"Follow"),(0,l.kt)("blockquote",null,(0,l.kt)("p",{parentName:"blockquote"},"Add the current user as a follower of one or more artists or other Spotify users.")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Parameters")),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"Name"),(0,l.kt)("th",{parentName:"tr",align:null},"Description"),(0,l.kt)("th",{parentName:"tr",align:null},"Example"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"followType"),(0,l.kt)("td",{parentName:"tr",align:null},"The ID type: either artist or user."),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"FollowType.Artist"))),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"ids or id"),(0,l.kt)("td",{parentName:"tr",align:null},"A list of the artist or the user Spotify IDs or just a Spotify ID"),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},'new List<String> { "1KpCi9BOfviCVhmpI4G2sY" }')," or ",(0,l.kt)("inlineCode",{parentName:"td"},'"1KpCi9BOfviCVhmpI4G2sY"'))))),(0,l.kt)("p",null,"Returns a ",(0,l.kt)("inlineCode",{parentName:"p"},"ErrorResponse")," which just contains a possible error. (",(0,l.kt)("inlineCode",{parentName:"p"},"response.HasError()")," and ",(0,l.kt)("inlineCode",{parentName:"p"},"response.Error"),")"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Usage")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-csharp"},'ErrorResponse response = _spotify.Follow(FollowType.Artist, "1KpCi9BOfviCVhmpI4G2sY");\n//or if it\'s a User\nErrorResponse response = _spotify.Follow(FollowType.User, "1122095781");\n')),(0,l.kt)("hr",null),(0,l.kt)("h2",{id:"unfollow"},"Unfollow"),(0,l.kt)("blockquote",null,(0,l.kt)("p",{parentName:"blockquote"},"Remove the current user as a follower of one or more artists or other Spotify users.")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Parameters")),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"Name"),(0,l.kt)("th",{parentName:"tr",align:null},"Description"),(0,l.kt)("th",{parentName:"tr",align:null},"Example"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"followType"),(0,l.kt)("td",{parentName:"tr",align:null},"The ID type: either artist or user."),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"FollowType.Artist"))),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"ids or id"),(0,l.kt)("td",{parentName:"tr",align:null},"A list of the artist or the user Spotify IDs or just a Spotify ID"),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},'new List<String> { "1KpCi9BOfviCVhmpI4G2sY" }')," or ",(0,l.kt)("inlineCode",{parentName:"td"},'"1KpCi9BOfviCVhmpI4G2sY"'))))),(0,l.kt)("p",null,"Returns a ",(0,l.kt)("inlineCode",{parentName:"p"},"ErrorResponse")," which just contains a possible error. (",(0,l.kt)("inlineCode",{parentName:"p"},"response.HasError()")," and ",(0,l.kt)("inlineCode",{parentName:"p"},"response.Error"),")"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Usage")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-csharp"},'ErrorResponse response = _spotify.Unfollow(FollowType.Artist, "1KpCi9BOfviCVhmpI4G2sY");\n//or if it\'s a User\nErrorResponse response = _spotify.Unfollow(FollowType.User, "1122095781");\n')),(0,l.kt)("hr",null),(0,l.kt)("h2",{id:"isfollowing"},"IsFollowing"),(0,l.kt)("blockquote",null,(0,l.kt)("p",{parentName:"blockquote"},"Check to see if the current user is following one or more artists or other Spotify users.")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Parameters")),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"Name"),(0,l.kt)("th",{parentName:"tr",align:null},"Description"),(0,l.kt)("th",{parentName:"tr",align:null},"Example"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"followType"),(0,l.kt)("td",{parentName:"tr",align:null},"The ID type: either artist or user."),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"FollowType.Artist"))),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"ids or id"),(0,l.kt)("td",{parentName:"tr",align:null},"A list of the artist or the user Spotify IDs or just a Spotify ID"),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},'new List<String> { "1KpCi9BOfviCVhmpI4G2sY" }')," or ",(0,l.kt)("inlineCode",{parentName:"td"},'"1KpCi9BOfviCVhmpI4G2sY"'))))),(0,l.kt)("p",null,"Returns a ",(0,l.kt)("inlineCode",{parentName:"p"},"ListResponse<Boolean>")," which contains the property ",(0,l.kt)("inlineCode",{parentName:"p"},"List<Boolean> List")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Usage")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-csharp"},'//Are you one of my Followers? :P\nListResponse<Boolean> response = _spotify.IsFollowing(FollowType.User, "1122095781");\nConsole.WriteLine(response.List[0] ? "Yis!" : "No :(");\n')),(0,l.kt)("hr",null),(0,l.kt)("h2",{id:"followplaylist"},"FollowPlaylist"),(0,l.kt)("blockquote",null,(0,l.kt)("p",{parentName:"blockquote"},"Add the current user as a follower of a playlist.")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Parameters")),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"Name"),(0,l.kt)("th",{parentName:"tr",align:null},"Description"),(0,l.kt)("th",{parentName:"tr",align:null},"Example"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"ownerId"),(0,l.kt)("td",{parentName:"tr",align:null},"The Spotify user ID of the person who owns the playlist."),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},'"maxloermans"'))),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"playlistId"),(0,l.kt)("td",{parentName:"tr",align:null},"The Spotify ID of the playlist. Any playlist can be followed, regardless of its public/private status, as long as you know its playlist ID."),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},'"3SIp2VAsKI03mReF0dFBmI"'))),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"[showPublic]"),(0,l.kt)("td",{parentName:"tr",align:null},"If true the playlist will be included in user's public playlists, if false it will remain private."),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},"true"))))),(0,l.kt)("p",null,"Returns a ",(0,l.kt)("inlineCode",{parentName:"p"},"ErrorResponse")," which just contains a possible error. (",(0,l.kt)("inlineCode",{parentName:"p"},"response.HasError()")," and ",(0,l.kt)("inlineCode",{parentName:"p"},"response.Error"),")"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Usage")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-csharp"},'ErrorResponse response = _spotify.FollowPlaylist("maxloermans", "3SIp2VAsKI03mReF0dFBmI");\nif(!response.HasError())\n Console.WriteLine("success");\n')),(0,l.kt)("hr",null),(0,l.kt)("h2",{id:"unfollowplaylist"},"UnfollowPlaylist"),(0,l.kt)("blockquote",null,(0,l.kt)("p",{parentName:"blockquote"},"Remove the current user as a follower of a playlist.")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Parameters")),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"Name"),(0,l.kt)("th",{parentName:"tr",align:null},"Description"),(0,l.kt)("th",{parentName:"tr",align:null},"Example"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"ownerId"),(0,l.kt)("td",{parentName:"tr",align:null},"The Spotify user ID of the person who owns the playlist."),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},'"maxloermans"'))),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"playlistId"),(0,l.kt)("td",{parentName:"tr",align:null},"The Spotify ID of the playlist that is to be no longer followed."),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},'"3SIp2VAsKI03mReF0dFBmI"'))))),(0,l.kt)("p",null,"Returns a ",(0,l.kt)("inlineCode",{parentName:"p"},"ErrorResponse")," which just contains a possible error. (",(0,l.kt)("inlineCode",{parentName:"p"},"response.HasError()")," and ",(0,l.kt)("inlineCode",{parentName:"p"},"response.Error"),")"),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Usage")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-csharp"},'ErrorResponse response = _spotify.UnfollowPlaylist("maxloermans", "3SIp2VAsKI03mReF0dFBmI");\nif(!response.HasError())\n Console.WriteLine("success");\n')),(0,l.kt)("hr",null),(0,l.kt)("h2",{id:"isfollowingplaylist"},"IsFollowingPlaylist"),(0,l.kt)("blockquote",null,(0,l.kt)("p",{parentName:"blockquote"},"Check to see if one or more Spotify users are following a specified playlist.")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Parameters")),(0,l.kt)("table",null,(0,l.kt)("thead",{parentName:"table"},(0,l.kt)("tr",{parentName:"thead"},(0,l.kt)("th",{parentName:"tr",align:null},"Name"),(0,l.kt)("th",{parentName:"tr",align:null},"Description"),(0,l.kt)("th",{parentName:"tr",align:null},"Example"))),(0,l.kt)("tbody",{parentName:"table"},(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"ownerId"),(0,l.kt)("td",{parentName:"tr",align:null},"The Spotify user ID of the person who owns the playlist."),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},'"maxloermans"'))),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"playlistId"),(0,l.kt)("td",{parentName:"tr",align:null},"The Spotify ID of the playlist."),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},'"3SIp2VAsKI03mReF0dFBmI"'))),(0,l.kt)("tr",{parentName:"tbody"},(0,l.kt)("td",{parentName:"tr",align:null},"ids or id"),(0,l.kt)("td",{parentName:"tr",align:null},"A list of the artist or the user Spotify IDs or just a Spotify ID"),(0,l.kt)("td",{parentName:"tr",align:null},(0,l.kt)("inlineCode",{parentName:"td"},'new List<String> { "1KpCi9BOfviCVhmpI4G2sY" }')," or ",(0,l.kt)("inlineCode",{parentName:"td"},'"1KpCi9BOfviCVhmpI4G2sY"'))))),(0,l.kt)("p",null,"Returns a ",(0,l.kt)("inlineCode",{parentName:"p"},"ListResponse<Boolean>")," which contains the property ",(0,l.kt)("inlineCode",{parentName:"p"},"List<Boolean> List")),(0,l.kt)("p",null,(0,l.kt)("strong",{parentName:"p"},"Usage")),(0,l.kt)("pre",null,(0,l.kt)("code",{parentName:"pre",className:"language-csharp"},'//Am I following the playlist?\nListResponse<Boolean> response = _spotify.IsFollowing("maxloermans", "3SIp2VAsKI03mReF0dFBmI", "1122095781");\nConsole.WriteLine(response.List[0] ? "Yis!" : "No :(");\n')),(0,l.kt)("hr",null))}u.isMDXComponent=!0}}]);