Spotify.NET/92bb876c.52fb17f7.js

2 lines
15 KiB
JavaScript
Raw Normal View History

/*! For license information please see 92bb876c.52fb17f7.js.LICENSE.txt */
(window.webpackJsonp=window.webpackJsonp||[]).push([[34],{166:function(e,t,a){"use strict";a.r(t),a.d(t,"frontMatter",(function(){return c})),a.d(t,"metadata",(function(){return l})),a.d(t,"rightToc",(function(){return s})),a.d(t,"default",(function(){return b}));var n=a(2),r=a(9),i=(a(0),a(187)),o=a(211),c={id:"getting_started",title:"Getting Started"},l={id:"getting_started",title:"Getting Started",description:"Adding SpotifyAPI-NET to your project",source:"@site/docs/getting_started.md",permalink:"/SpotifyAPI-NET/docs/next/getting_started",editUrl:"https://github.com/JohnnyCrazy/SpotifyAPI-NET/edit/master/SpotifyAPI.Docs/docs/getting_started.md",version:"next",lastUpdatedBy:"Jonas Dellinger",lastUpdatedAt:1604345241,sidebar:"docs",previous:{title:"Introduction",permalink:"/SpotifyAPI-NET/docs/next/introduction"},next:{title:"Error Handling",permalink:"/SpotifyAPI-NET/docs/next/error_handling"}},s=[{value:"Adding SpotifyAPI-NET to your project",id:"adding-spotifyapi-net-to-your-project",children:[{value:"Package Managers",id:"package-managers",children:[]},{value:"Add DLL Manually",id:"add-dll-manually",children:[]},{value:"Compile Yourself",id:"compile-yourself",children:[]}]},{value:"First API Calls",id:"first-api-calls",children:[]},{value:"Query/Body Parameters",id:"querybody-parameters",children:[]},{value:"Guides",id:"guides",children:[]}],u={rightToc:s};function b(e){var t=e.components,a=Object(r.a)(e,["components"]);return Object(i.b)("wrapper",Object(n.a)({},u,a,{components:t,mdxType:"MDXLayout"}),Object(i.b)("h2",{id:"adding-spotifyapi-net-to-your-project"},"Adding SpotifyAPI-NET to your project"),Object(i.b)("p",null,"The library can be added to your project via the following methods:"),Object(i.b)("h3",{id:"package-managers"},"Package Managers"),Object(i.b)(o.a,{mdxType:"InstallInstructions"}),Object(i.b)("h3",{id:"add-dll-manually"},"Add DLL Manually"),Object(i.b)("p",null,"You can also grab the latest compiled DLL from our ",Object(i.b)("a",Object(n.a)({parentName:"p"},{href:"https://github.com/johnnycrazy/spotifyapi-net/releases"}),"GitHub Releases Page"),". It can be added to your project via Visual Studio or directly in your ",Object(i.b)("inlineCode",{parentName:"p"},".csproj"),":"),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-xml"}),'<ItemGroup>\n <Reference Include="SpotifyAPI.Web">\n <HintPath>..\\Dlls\\SpotifyAPI.Web.dll</HintPath>\n </Reference>\n</ItemGroup>\n')),Object(i.b)("h3",{id:"compile-yourself"},"Compile Yourself"),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-sh"}),"git clone https://github.com/JohnnyCrazy/SpotifyAPI-NET.git\ncd SpotifyAPI-NET\ndotnet restore\ndotnet build\n\nls -la SpotifyAPI.Web/bin/Debug/netstandard2.1/SpotifyAPI.Web.dll\n")),Object(i.b)("h2",{id:"first-api-calls"},"First API Calls"),Object(i.b)("p",null,"You're now ready to issue your first calls to the Spotify API, a small console example:"),Object(i.b)("pre",null,Object(i.b)("code",Object(n.a)({parentName:"pre"},{className:"language-csharp"}),'using System;\nusing System.Threading.Tasks;\nusing SpotifyAPI.Web;\n\nclass Program\n{\n static async Task Main()\n {\n var spotify = new SpotifyClient("YourAccessToken");\n\n var track = await spotify.Tracks.Get("1s6ux0lNiTziSrd7iUAADH");\n Console.WriteLine(track.Name);\n }\n}\n')),Object(i.b)("div",{className:"admonition admonition-tip alert alert--success"},Object(i.b)("div",Object(n.a)({parentName:"div"},{className:"admonition-heading"}),Object(i.b)("h5",{parentName:"div"},Object(i.b)("span",Object(n.a)({parentName:"h5"},{className:"admonition-icon"}),Object(i.b)("svg",Object(n.a)({parentName:"span"},{xmlns:"http://www.w3.org/2000/svg",width:"12",height:"16",viewBox:"0 0 12 16"}),Object(i.b)("path",Object(n.a)({parentName:"svg"},{fillRule:"evenodd",d:"M6.5 0C3.48 0 1 2.19 1 5c0 .92.55 2.25 1 3 1.34 2.25 1.78 2.78 2 4v1h5v-1c.22-1.22.66-1.75 2-4 .45-.75 1-2.08 1-3 0-2.81-2.48-5-5.5-5zm3.64 7.48c-.25.44-.47.8-.67 1.11-.86 1.41-1.25 2.06-1.45 3.23