{% extends 'apidocs/base.html.twig' %}

{% block title %}Songs{% endblock %}

{% block content %}
					<div class="row justify-content-center">
						<div class="col-lg-7">
							<div class="content">
								<h1 class="content-title">
									Songs
                                </h1>
                                
                                <div class="card" id="detail">
                                    <h2 class="card-title">Detail</h2>
                                    <p>Returns more detailled information about a song.</p>

                                    <table class="table table-bordered">
                                        <tr>
                                            <th>Method</th>
                                            <td>GET</td>
                                        </tr>
                                        <tr>
                                            <th>Endpoint</th>
                                            <td>/song/<code class="code">songID</code></td>
                                        </tr>
                                    </table>

                                    <br />

                                    <div class="alert alert-primary" role="alert">
                                        <h4 class="alert-heading">Information</h4>
                                        Instead of a <code class="code">songID</code> you can also provide a <code class="code">fileReference</code>, which start with <code class="code">spinshare_</code>.
                                    </div>

                                    <br />

                                    <strong>Output Body</strong>
<pre class="code">
{
    "version":1,
    "status":200,
    "data":{
        "id":3,
        "title":"Isabelle Singing",
        "subtitle":"K.K. Bubblegum",
        "artist":"K.K. Slider",
        "charter":"Ellite",
        "uploader":3,
        "fileReference":"spinshare_5e8df6fb90bd7",
        "tags":[
            "isabelle",
            "singing",
            "easy",
            "cute",
            "animal",
            "crossing",
            "acnh",
            "new",
            "horizons"
        ],
        "views":774,
        "downloads":98,
        "isExplicit":false,
        "isTournament":false,
        "hasEasyDifficulty":false,
        "hasNormalDifficulty":false,
        "hasHardDifficulty":true,
        "hasExtremeDifficulty":false,
        "hasXDDifficulty":false,
        "uploadDate":{
            "date":"2020-05-01 00:00:00.000000",
            "timezone_type":3,
            "timezone":"Europe\/Berlin"
        },
        "description":null,
        "paths":{
            "ogg":"https:\/\/spinsha.re\/uploads\/audio\/spinshare_5e8df6fb90bd7_0.ogg",
            "cover":"https:\/\/spinsha.re\/uploads\/thumbnail\/spinshare_5e8df6fb90bd7.jpg",
            "zip":"https:\/\/spinsha.re\/api\/song\/3\/download"
        }
    }
}
</pre>

                                    <br />

                                    <strong>Output Body (Not Found)</strong>
<pre class="code">
{
    "version":1,
    "status":404,
    "data":[]
}
</pre>
                                </div>
                                
                                <div class="card" id="reviews">
                                    <h2 class="card-title">Reviews</h2>
                                    <p>Returns all active reviews of a song.</p>

                                    <table class="table table-bordered">
                                        <tr>
                                            <th>Method</th>
                                            <td>GET</td>
                                        </tr>
                                        <tr>
                                            <th>Endpoint</th>
                                            <td>/song/<code class="code">songID</code>/reviews</td>
                                        </tr>
                                    </table>

                                    <br />

                                    <div class="alert alert-primary" role="alert">
                                        <h4 class="alert-heading">Information</h4>
                                        Instead of a <code class="code">songID</code> you can also provide a <code class="code">fileReference</code>, which start with <code class="code">spinshare_</code>.
                                    </div>

                                    <br />

                                    <strong>Output Body</strong>
<pre class="code">
{
    "version":1,
    "status":200,
    "data":{
        "average":91.7,
        "reviews":[
            {
                "id":632,
                "user":{
                    "id":47,
                    "username":"NicolasPL",
                    "coverReference":"5e98e02997f6c.png",
                    "isVerified":null,
                    "isPatreon":null
                },
                "recommended":true,
                "comment":"Really good. I played it on Expert, really fun.",
                "reviewDate":{
                    "date":"2020-08-03 01:19:43.000000",
                    "timezone_type":3,
                    "timezone":"Europe\/Berlin"
                }
            },
            ...
        ]
    }
}
</pre>
                                </div>
                                
                                <div class="card" id="spinplays">
                                    <h2 class="card-title">SpinPlays</h2>
                                    <p>Returns all active SpinPlays of a song.</p>

                                    <table class="table table-bordered">
                                        <tr>
                                            <th>Method</th>
                                            <td>GET</td>
                                        </tr>
                                        <tr>
                                            <th>Endpoint</th>
                                            <td>/song/<code class="code">songID</code>/spinplays</td>
                                        </tr>
                                    </table>

                                    <br />

                                    <div class="alert alert-primary" role="alert">
                                        <h4 class="alert-heading">Information</h4>
                                        Instead of a <code class="code">songID</code> you can also provide a <code class="code">fileReference</code>, which start with <code class="code">spinshare_</code>.
                                    </div>

                                    <br />

                                    <strong>Output Body</strong>
<pre class="code">
{
    "version":1,
    "status":200,
    "data":{
        "spinPlays":[
            {
                "id":150,
                "user":{
                    "id":20,
                    "username":"Zick407",
                    "coverReference":"5e9935a0afa55.png",
                    "isVerified":false,
                    "isPatreon":null
                },
                "videoUrl":"https:\/\/www.youtube.com\/watch?v=bEVdyM5_qxA",
                "videoThumbnail":"https:\/\/i.ytimg.com\/vi\/bEVdyM5_qxA\/maxresdefault.jpg",
                "submitDate":{
                    "date":"2020-07-01 02:10:39.000000",
                    "timezone_type":3,
                    "timezone":"Europe\/Berlin"
                },
                "isActive":true
            }
        ]
    }
    }
</pre>
                                </div>
                                
                                <div class="card" id="download">
                                    <h2 class="card-title">Download</h2>
                                    <p>Generates a download zip and returns it.</p>

                                    <table class="table table-bordered">
                                        <tr>
                                            <th>Method</th>
                                            <td>GET</td>
                                        </tr>
                                        <tr>
                                            <th>Endpoint</th>
                                            <td>/song/<code class="code">songID</code>/download</td>
                                        </tr>
                                    </table>

                                    <br />

                                    <div class="alert alert-primary" role="alert">
                                        <h4 class="alert-heading">Information</h4>
                                        Instead of a <code class="code">songID</code> you can also provide a <code class="code">fileReference</code>, which start with <code class="code">spinshare_</code>.
                                    </div>

                                    <br />

                                    <div class="alert alert-primary" role="alert">
                                        <h4 class="alert-heading">Information</h4>
                                        This API endpoint returns a zip attachment as a Spin Rhythm XD backup.
                                    </div>
                                </div>
							</div>
						</div>
						<div class="col-lg-3">
							<div class="content">
								<div class="on-this-page-nav">
									<div class="title">On this page</div>
									<a href="#detail">Detail</a>
									<a href="#reviews">Reviews</a>
									<a href="#spinplays">SpinPlays</a>
									<a href="#download">Download</a>
								</div>
							</div>
						</div>
					</div>
{% endblock %}