mirror of
https://github.com/idanoo/GoScrobble.git
synced 2024-12-26 16:49:01 +00:00
532 lines
14 KiB
HTML
532 lines
14 KiB
HTML
|
|
<!doctype html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta content="IE=edge,chrome=1" http-equiv="X-UA-Compatible">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
|
<meta
|
|
name="description"
|
|
content="Documentation for the GoScrobble API"
|
|
>
|
|
<title>GoScrobble API Documentation</title>
|
|
|
|
<style media="screen">
|
|
.highlight table td { padding: 5px; }
|
|
.highlight table pre { margin: 0; }
|
|
.highlight .gh {
|
|
color: #999999;
|
|
}
|
|
.highlight .sr {
|
|
color: #f6aa11;
|
|
}
|
|
.highlight .go {
|
|
color: #888888;
|
|
}
|
|
.highlight .gp {
|
|
color: #555555;
|
|
}
|
|
.highlight .gs {
|
|
}
|
|
.highlight .gu {
|
|
color: #aaaaaa;
|
|
}
|
|
.highlight .nb {
|
|
color: #f6aa11;
|
|
}
|
|
.highlight .cm {
|
|
color: #75715e;
|
|
}
|
|
.highlight .cp {
|
|
color: #75715e;
|
|
}
|
|
.highlight .c1 {
|
|
color: #75715e;
|
|
}
|
|
.highlight .cs {
|
|
color: #75715e;
|
|
}
|
|
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cpf {
|
|
color: #75715e;
|
|
}
|
|
.highlight .err {
|
|
color: #960050;
|
|
}
|
|
.highlight .gr {
|
|
color: #960050;
|
|
}
|
|
.highlight .gt {
|
|
color: #960050;
|
|
}
|
|
.highlight .gd {
|
|
color: #49483e;
|
|
}
|
|
.highlight .gi {
|
|
color: #49483e;
|
|
}
|
|
.highlight .ge {
|
|
color: #49483e;
|
|
}
|
|
.highlight .kc {
|
|
color: #66d9ef;
|
|
}
|
|
.highlight .kd {
|
|
color: #66d9ef;
|
|
}
|
|
.highlight .kr {
|
|
color: #66d9ef;
|
|
}
|
|
.highlight .no {
|
|
color: #66d9ef;
|
|
}
|
|
.highlight .kt {
|
|
color: #66d9ef;
|
|
}
|
|
.highlight .mf {
|
|
color: #ae81ff;
|
|
}
|
|
.highlight .mh {
|
|
color: #ae81ff;
|
|
}
|
|
.highlight .il {
|
|
color: #ae81ff;
|
|
}
|
|
.highlight .mi {
|
|
color: #ae81ff;
|
|
}
|
|
.highlight .mo {
|
|
color: #ae81ff;
|
|
}
|
|
.highlight .m, .highlight .mb, .highlight .mx {
|
|
color: #ae81ff;
|
|
}
|
|
.highlight .sc {
|
|
color: #ae81ff;
|
|
}
|
|
.highlight .se {
|
|
color: #ae81ff;
|
|
}
|
|
.highlight .ss {
|
|
color: #ae81ff;
|
|
}
|
|
.highlight .sd {
|
|
color: #e6db74;
|
|
}
|
|
.highlight .s2 {
|
|
color: #e6db74;
|
|
}
|
|
.highlight .sb {
|
|
color: #e6db74;
|
|
}
|
|
.highlight .sh {
|
|
color: #e6db74;
|
|
}
|
|
.highlight .si {
|
|
color: #e6db74;
|
|
}
|
|
.highlight .sx {
|
|
color: #e6db74;
|
|
}
|
|
.highlight .s1 {
|
|
color: #e6db74;
|
|
}
|
|
.highlight .s, .highlight .sa, .highlight .dl {
|
|
color: #e6db74;
|
|
}
|
|
.highlight .na {
|
|
color: #a6e22e;
|
|
}
|
|
.highlight .nc {
|
|
color: #a6e22e;
|
|
}
|
|
.highlight .nd {
|
|
color: #a6e22e;
|
|
}
|
|
.highlight .ne {
|
|
color: #a6e22e;
|
|
}
|
|
.highlight .nf, .highlight .fm {
|
|
color: #a6e22e;
|
|
}
|
|
.highlight .vc {
|
|
color: #ffffff;
|
|
}
|
|
.highlight .nn {
|
|
color: #ffffff;
|
|
}
|
|
.highlight .ni {
|
|
color: #ffffff;
|
|
}
|
|
.highlight .bp {
|
|
color: #ffffff;
|
|
}
|
|
.highlight .vg {
|
|
color: #ffffff;
|
|
}
|
|
.highlight .vi {
|
|
color: #ffffff;
|
|
}
|
|
.highlight .nv, .highlight .vm {
|
|
color: #ffffff;
|
|
}
|
|
.highlight .w {
|
|
color: #ffffff;
|
|
}
|
|
.highlight {
|
|
color: #ffffff;
|
|
}
|
|
.highlight .n, .highlight .py, .highlight .nx {
|
|
color: #ffffff;
|
|
}
|
|
.highlight .nl {
|
|
color: #f92672;
|
|
}
|
|
.highlight .ow {
|
|
color: #f92672;
|
|
}
|
|
.highlight .nt {
|
|
color: #f92672;
|
|
}
|
|
.highlight .k, .highlight .kv {
|
|
color: #f92672;
|
|
}
|
|
.highlight .kn {
|
|
color: #f92672;
|
|
}
|
|
.highlight .kp {
|
|
color: #f92672;
|
|
}
|
|
.highlight .o {
|
|
color: #f92672;
|
|
}
|
|
</style>
|
|
<style media="print">
|
|
* {
|
|
-webkit-transition:none!important;
|
|
transition:none!important;
|
|
}
|
|
.highlight table td { padding: 5px; }
|
|
.highlight table pre { margin: 0; }
|
|
.highlight, .highlight .w {
|
|
color: #586e75;
|
|
}
|
|
.highlight .err {
|
|
color: #002b36;
|
|
background-color: #dc322f;
|
|
}
|
|
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cm, .highlight .cpf, .highlight .c1, .highlight .cs {
|
|
color: #657b83;
|
|
}
|
|
.highlight .cp {
|
|
color: #b58900;
|
|
}
|
|
.highlight .nt {
|
|
color: #b58900;
|
|
}
|
|
.highlight .o, .highlight .ow {
|
|
color: #93a1a1;
|
|
}
|
|
.highlight .p, .highlight .pi {
|
|
color: #93a1a1;
|
|
}
|
|
.highlight .gi {
|
|
color: #859900;
|
|
}
|
|
.highlight .gd {
|
|
color: #dc322f;
|
|
}
|
|
.highlight .gh {
|
|
color: #268bd2;
|
|
background-color: #002b36;
|
|
font-weight: bold;
|
|
}
|
|
.highlight .k, .highlight .kn, .highlight .kp, .highlight .kr, .highlight .kv {
|
|
color: #6c71c4;
|
|
}
|
|
.highlight .kc {
|
|
color: #cb4b16;
|
|
}
|
|
.highlight .kt {
|
|
color: #cb4b16;
|
|
}
|
|
.highlight .kd {
|
|
color: #cb4b16;
|
|
}
|
|
.highlight .s, .highlight .sb, .highlight .sc, .highlight .dl, .highlight .sd, .highlight .s2, .highlight .sh, .highlight .sx, .highlight .s1 {
|
|
color: #859900;
|
|
}
|
|
.highlight .sa {
|
|
color: #6c71c4;
|
|
}
|
|
.highlight .sr {
|
|
color: #2aa198;
|
|
}
|
|
.highlight .si {
|
|
color: #d33682;
|
|
}
|
|
.highlight .se {
|
|
color: #d33682;
|
|
}
|
|
.highlight .nn {
|
|
color: #b58900;
|
|
}
|
|
.highlight .nc {
|
|
color: #b58900;
|
|
}
|
|
.highlight .no {
|
|
color: #b58900;
|
|
}
|
|
.highlight .na {
|
|
color: #268bd2;
|
|
}
|
|
.highlight .m, .highlight .mb, .highlight .mf, .highlight .mh, .highlight .mi, .highlight .il, .highlight .mo, .highlight .mx {
|
|
color: #859900;
|
|
}
|
|
.highlight .ss {
|
|
color: #859900;
|
|
}
|
|
</style>
|
|
<link href="stylesheets/screen-cfdc3565.css" rel="stylesheet" media="screen" />
|
|
<link href="stylesheets/print-953e3353.css" rel="stylesheet" media="print" />
|
|
<script src="javascripts/all-b12a2749.js"></script>
|
|
|
|
<script>
|
|
$(function() { setupCodeCopy(); });
|
|
</script>
|
|
</head>
|
|
|
|
<body class="index" data-languages="["shell"]">
|
|
<a href="#" id="nav-button">
|
|
<span>
|
|
NAV
|
|
<img src="images/navbar-cad8cdcb.png" alt="" />
|
|
</span>
|
|
</a>
|
|
<div class="toc-wrapper">
|
|
<img src="images/logo-7aa55c75.png" class="logo" alt="" />
|
|
<div class="lang-selector">
|
|
<a href="#" data-language-name="shell">shell</a>
|
|
</div>
|
|
<div class="search">
|
|
<input type="text" class="search" id="input-search" placeholder="Search">
|
|
</div>
|
|
<ul class="search-results"></ul>
|
|
<ul id="toc" class="toc-list-h1">
|
|
<li>
|
|
<a href="#introduction" class="toc-h1 toc-link" data-title="Introduction">Introduction</a>
|
|
</li>
|
|
<li>
|
|
<a href="#server-info" class="toc-h1 toc-link" data-title="Server Info">Server Info</a>
|
|
<ul class="toc-list-h2">
|
|
<li>
|
|
<a href="#v1-serverinfo" class="toc-h2 toc-link" data-title="v1/serverinfo">v1/serverinfo</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
<li>
|
|
<a href="#authentication" class="toc-h1 toc-link" data-title="Authentication">Authentication</a>
|
|
<ul class="toc-list-h2">
|
|
<li>
|
|
<a href="#v1-login" class="toc-h2 toc-link" data-title="v1/login">v1/login</a>
|
|
</li>
|
|
<li>
|
|
<a href="#v1-register" class="toc-h2 toc-link" data-title="v1/register">v1/register</a>
|
|
</li>
|
|
<li>
|
|
<a href="#v1-sendreset" class="toc-h2 toc-link" data-title="v1/sendreset">v1/sendreset</a>
|
|
</li>
|
|
<li>
|
|
<a href="#v1-resetpassword" class="toc-h2 toc-link" data-title="v1/resetpassword">v1/resetpassword</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
<ul class="toc-footer">
|
|
<li><a href='https://goscrobble.com'>GoScrobble website</a></li>
|
|
<li><a href='https://gitlab.com/goscrobble/goscrobble-api'>Backend Repository</a></li>
|
|
<li><a href='https://gitlab.com/goscrobble/goscrobble-web'>Frontend Repository</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="page-wrapper">
|
|
<div class="dark-box"></div>
|
|
<div class="content">
|
|
<h1 id='introduction'>Introduction</h1>
|
|
<p>Welcome to the GoScrobble API documentation.</p>
|
|
|
|
<p>The majority of these API endpoints are public with reasonable rate limits.</p>
|
|
<h1 id='server-info'>Server Info</h1><h2 id='v1-serverinfo'>v1/serverinfo</h2>
|
|
<blockquote>
|
|
<p>Check server version and registration status:</p>
|
|
</blockquote>
|
|
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="s2">"https://goscrobble.com/api/v1/serverinfo"</span>
|
|
</code></pre></div>
|
|
<blockquote>
|
|
<p>Response:</p>
|
|
</blockquote>
|
|
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
|
</span><span class="nl">"version"</span><span class="p">:</span><span class="s2">"0.1.1"</span><span class="p">,</span><span class="w">
|
|
</span><span class="nl">"registration_enabled"</span><span class="p">:</span><span class="s2">"1"</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span></code></pre></div>
|
|
<p>This endpoint is used to get server API version and registration status.</p>
|
|
<h3 id='http-request'>HTTP Request</h3>
|
|
<p><code>GET https://goscrobble.com/api/v1/serverstatus</code></p>
|
|
<h1 id='authentication'>Authentication</h1><h2 id='v1-login'>v1/login</h2>
|
|
<blockquote>
|
|
<p>To obtain a JWT token (Replace default credentials):</p>
|
|
</blockquote>
|
|
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="s2">"https://goscrobble.com/api/v1/login"</span> <span class="se">\</span>
|
|
<span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
|
|
<span class="nt">--data</span> <span class="s1">'{"username":"abc","password":"def"}'</span>
|
|
</code></pre></div>
|
|
<blockquote>
|
|
<p>Response:</p>
|
|
</blockquote>
|
|
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
|
</span><span class="nl">"token"</span><span class="p">:</span><span class="w"> </span><span class="s2">"eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9.eyJhZG1pbiI6ZmFsc2UsImVtYWlsIjoidGVzdEB0ZXN0LmNvbSIsImV4cCI6MTY0MTAwMjUxOSwiaWF0IjoxNjQwMzk3NzE5LCJtb2QiOnRydWUsInJlZnJlc2hfZXhwIjoxNjQxMDAyNTE5LCJyZWZyZXNoX3Rva2VuIjoiYWJjZGVmZ2hqaWtsbW5vcHF3ZXJ0dXZ3eHl6Iiwic3ViIjoiNDE4ZmRkZmItOGIxYi01MWFiLTliZHMtNGZnMDhjYTYzY2ZmIiwidXNlcm5hbWUiOiJ0ZXN0In0.fuPXjQ7IzNyttgIKpdS4-KBQ-QeHTl-BfgYkSnMCmpVrBunzMrSwr1RzxI7Xg2WWF-FHtW3Bnv9RpSqLDN4F2g"</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span></code></pre></div>
|
|
<p>This endpoint is used to authenticate and retrieve a JWT token.</p>
|
|
<h3 id='http-request'>HTTP Request</h3>
|
|
<p><code>POST https://goscrobble.com/api/v1/login</code></p>
|
|
<h3 id='query-parameters'>Query Parameters</h3>
|
|
<table><thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead><tbody>
|
|
<tr>
|
|
<td>username</td>
|
|
<td>true</td>
|
|
<td>Account username</td>
|
|
</tr>
|
|
<tr>
|
|
<td>password</td>
|
|
<td>true</td>
|
|
<td>Account password</td>
|
|
</tr>
|
|
</tbody></table>
|
|
<h2 id='v1-register'>v1/register</h2>
|
|
<blockquote>
|
|
<p>Create a new account (Replace default credentials):</p>
|
|
</blockquote>
|
|
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="s2">"https://goscrobble.com/api/v1/register"</span> <span class="se">\</span>
|
|
<span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
|
|
<span class="nt">--data</span> <span class="s1">'{"email": "test@test.com", "username":"abc","password":"def"}'</span>
|
|
</code></pre></div>
|
|
<blockquote>
|
|
<p>Response:</p>
|
|
</blockquote>
|
|
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
|
</span><span class="nl">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"User created succesfully. You may now login"</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span></code></pre></div>
|
|
<p>If the server has REGISTRATION_ENABLED=true set, this endpoint will allow you to create a new account. Password must be at least 8 characters long.</p>
|
|
<h3 id='http-request-2'>HTTP Request</h3>
|
|
<p><code>POST https://goscrobble.com/api/v1/register</code></p>
|
|
<h3 id='query-parameters-2'>Query Parameters</h3>
|
|
<table><thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead><tbody>
|
|
<tr>
|
|
<td>email</td>
|
|
<td>true</td>
|
|
<td>Account email</td>
|
|
</tr>
|
|
<tr>
|
|
<td>username</td>
|
|
<td>true</td>
|
|
<td>Account username</td>
|
|
</tr>
|
|
<tr>
|
|
<td>password</td>
|
|
<td>true</td>
|
|
<td>Account password</td>
|
|
</tr>
|
|
</tbody></table>
|
|
<h2 id='v1-sendreset'>v1/sendreset</h2>
|
|
<blockquote>
|
|
<p>Trigger a password reset email:</p>
|
|
</blockquote>
|
|
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="s2">"https://goscrobble.com/api/v1/sendreset"</span> <span class="se">\</span>
|
|
<span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
|
|
<span class="nt">--data</span> <span class="s1">'{"email":"test@test.com"}'</span>
|
|
</code></pre></div>
|
|
<blockquote>
|
|
<p>Response:</p>
|
|
</blockquote>
|
|
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
|
</span><span class="nl">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Password reset email sent"</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span></code></pre></div>
|
|
<p>This endpoint triggers a password reset email to be sent to the email on an account.</p>
|
|
<h3 id='http-request-3'>HTTP Request</h3>
|
|
<p><code>POST https://goscrobble.com/api/v1/sendreset</code></p>
|
|
<h3 id='query-parameters-3'>Query Parameters</h3>
|
|
<table><thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead><tbody>
|
|
<tr>
|
|
<td>email</td>
|
|
<td>true</td>
|
|
<td>Account username</td>
|
|
</tr>
|
|
</tbody></table>
|
|
<h2 id='v1-resetpassword'>v1/resetpassword</h2>
|
|
<blockquote>
|
|
<p>Trigger a password reset email:</p>
|
|
</blockquote>
|
|
<div class="highlight"><pre class="highlight shell tab-shell"><code>curl <span class="s2">"https://goscrobble.com/api/v1/resetpassword"</span> <span class="se">\</span>
|
|
<span class="nt">-H</span> <span class="s2">"Content-Type: application/json"</span> <span class="se">\</span>
|
|
<span class="nt">--data</span> <span class="s1">'{"token":"abcdefghijklmnopqrstuvwxyz", "password": "Hunter1"}'</span>
|
|
</code></pre></div>
|
|
<blockquote>
|
|
<p>Response:</p>
|
|
</blockquote>
|
|
<div class="highlight"><pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
|
</span><span class="nl">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Password updated successfully!"</span><span class="w">
|
|
</span><span class="p">}</span><span class="w">
|
|
</span></code></pre></div>
|
|
<p>This endpoint confirms a password reset with a valid hash from the reset email. You must call v1/sendreset first and obtain the hash.</p>
|
|
<h3 id='http-request-4'>HTTP Request</h3>
|
|
<p><code>POST https://goscrobble.com/api/v1/resetpassword</code></p>
|
|
<h3 id='query-parameters-4'>Query Parameters</h3>
|
|
<table><thead>
|
|
<tr>
|
|
<th>Parameter</th>
|
|
<th>Required</th>
|
|
<th>Description</th>
|
|
</tr>
|
|
</thead><tbody>
|
|
<tr>
|
|
<td>token</td>
|
|
<td>true</td>
|
|
<td>Reset token from the password reset email</td>
|
|
</tr>
|
|
<tr>
|
|
<td>password</td>
|
|
<td>true</td>
|
|
<td>New account password</td>
|
|
</tr>
|
|
</tbody></table>
|
|
|
|
</div>
|
|
<div class="dark-box">
|
|
<div class="lang-selector">
|
|
<a href="#" data-language-name="shell">shell</a>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</body>
|
|
</html>
|