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

{% block title %}Reviews{% endblock %}

{% block content %}
					<div class="row justify-content-center">
						<div class="col-lg-7">
							<div class="content">
								<h1 class="content-title">
									Reviews
                                </h1>
                                
                                <div class="card" id="get">
                                    <h2 class="card-title">Get Review</h2>
                                    <p>Gets the users review of a song.</p>

                                    <table class="table table-bordered">
                                        <tr>
                                            <th>Method</th>
                                            <td>GET</td>
                                        </tr>
                                        <tr>
                                            <th>Endpoint</th>
                                            <td>/connect/reviews/<code class="code">songID</code>/get</td>
                                        </tr>
                                        <tr>
                                            <th>Query Parameters</th>
                                            <td>(string) connectToken</td>
                                        </tr>
                                    </table>

                                    <br /><br />

                                    <strong>Output Body (Success)</strong>
<pre class="code">
{
   "version":1,
   "status":200,
   "data":{
      "id":23,
      "song":{
         "id":138,
         "title":"Tendril",
         "subtitle":"",
         "artist":"Collin McLoughlin \u0026 Au5",
         "charter":"Halflite",
         "uploader":1,
         "fileReference":"spinshare_5ea59e04df800",
         "tags":[
            "test",
            "awesome",
            "nice"
         ],
         "views":536,
         "downloads":2,
         "isExplicit":false,
         "isTournament":false,
         "hasEasyDifficulty":false,
         "hasNormalDifficulty":false,
         "hasHardDifficulty":false,
         "hasExtremeDifficulty":false,
         "hasXDDifficulty":true,
         "uploadDate":{
            "date":"2020-04-26 16:43:16.000000",
            "timezone_type":3,
            "timezone":"Europe\/Berlin"
         },
         "description":"I\u0027m very proud of this chart!"
      },
      "user":{
         "id":1,
         "username":"taw",
         "coverReference":"5f4147b117c7b.png",
         "isVerified":true,
         "isPatreon":true,
         "pronouns": "they/them"
      },
      "recommended":true,
      "comment":"Nice1337",
      "reviewDate":{
         "date":"2020-09-09 19:25:29.000000",
         "timezone_type":3,
         "timezone":"Europe\/Berlin"
      }
   }
}
</pre>
<br /><br />

                                    <strong>Responses</strong>
                                    <br /><br />
                                    <table class="table table-bordered">
                                        <thead>
                                            <tr>
                                                <th>Code</th>
                                                <th>Explaination</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td>200</td>
                                                <td>The review exists.</td>
                                            </tr>
                                            <tr>
                                                <td>422</td>
                                                <td>Some parameters were missing.</td>
                                            </tr>
                                            <tr>
                                                <td>403</td>
                                                <td>Your connectToken is missing or wrong.</td>
                                            </tr>
                                            <tr>
                                                <td>404</td>
                                                <td>This song does not exist or there is no review from this user.</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </div>
                                
                                <div class="card" id="add">
                                    <h2 class="card-title">Add Review</h2>
                                    <p>Adds or updates a review of a song.</p>

                                    <table class="table table-bordered">
                                        <tr>
                                            <th>Method</th>
                                            <td>POST</td>
                                        </tr>
                                        <tr>
                                            <th>Endpoint</th>
                                            <td>/connect/reviews/<code class="code">songID</code>/add</td>
                                        </tr>
                                        <tr>
                                            <th>Query Parameters</th>
                                            <td>(string) connectToken</td>
                                        </tr>
                                        <tr>
                                            <th>POST Form-Data</th>
                                            <td>(int) recommend<br />
                                                (string) comment</td>
                                        </tr>
                                    </table>

                                    <br /><br />

                                    <strong>Responses</strong>
                                    <br /><br />
                                    <table class="table table-bordered">
                                        <thead>
                                            <tr>
                                                <th>Code</th>
                                                <th>Explaination</th>
                                            </tr>
                                        </thead>
                                        <tbody>
                                            <tr>
                                                <td>200</td>
                                                <td>The review was posted successfully.</td>
                                            </tr>
                                            <tr>
                                                <td>201</td>
                                                <td>The review was updated successfully.</td>
                                            </tr>
                                            <tr>
                                                <td>422</td>
                                                <td>Some parameters were missing.</td>
                                            </tr>
                                            <tr>
                                                <td>403</td>
                                                <td>Your connectToken is missing or wrong.</td>
                                            </tr>
                                            <tr>
                                                <td>404</td>
                                                <td>This song does not exist.</td>
                                            </tr>
                                        </tbody>
                                    </table>
                                </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="#get">Get Review</a>
									<a href="#add">Add Review</a>
								</div>
							</div>
						</div>
					</div>
{% endblock %}