CS-Coursework/documentation/html/get_user_tests.html

61 lines
3.7 KiB
HTML

<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="github-markdown.css">
</head>
<body class="markdown-body">
<style>
.markdown-body {
box-sizing: border-box;
min-width: 200px;
max-width: 980px;
margin: 0 auto;
padding: 45px;
}
@media (max-width: 767px) {
.markdown-body {
padding: 15px;
}
}
</style>
<div class="markdown-heading"><h1 class="heading-element">Get User Tests</h1><a id="user-content-get-user-tests" class="anchor" aria-label="Permalink: Get User Tests" href="#get-user-tests"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
<div class="markdown-heading"><h2 class="heading-element">GET <code>/api/user/tests/&lt;user_id&gt;/&lt;secret&gt;</code>
</h2><a id="user-content-get-apiusertestsuser_idsecret" class="anchor" aria-label="Permalink: GET /api/user/tests/&lt;user_id&gt;/&lt;secret&gt;" href="#get-apiusertestsuser_idsecret"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
<p>Retrieves tests associated with a specific user from the database.</p>
<div class="markdown-heading"><h2 class="heading-element">Request Parameters</h2><a id="user-content-request-parameters" class="anchor" aria-label="Permalink: Request Parameters" href="#request-parameters"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
<ul>
<li>
<code>user_id</code> - User ID of the user whose tests need to be retrieved</li>
<li>
<code>secret</code> - Secret key for authentication</li>
</ul>
<div class="markdown-heading"><h2 class="heading-element">Example Request</h2><a id="user-content-example-request" class="anchor" aria-label="Permalink: Example Request" href="#example-request"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
<div class="highlight highlight-source-shell"><pre>curl -X GET <span class="pl-s"><span class="pl-pds">"</span>https://url/api/user/tests/123/your_secret_key_here<span class="pl-pds">"</span></span></pre></div>
<div class="markdown-heading"><h2 class="heading-element">Example Response</h2><a id="user-content-example-response" class="anchor" aria-label="Permalink: Example Response" href="#example-response"><span aria-hidden="true" class="octicon octicon-link"></span></a></div>
<div class="highlight highlight-source-json"><pre>[
{
<span class="pl-ent">"test_type"</span>: <span class="pl-s"><span class="pl-pds">"</span>words<span class="pl-pds">"</span></span>,
<span class="pl-ent">"test_length"</span>: <span class="pl-c1">300</span>,
<span class="pl-ent">"test_time"</span>: <span class="pl-c1">60</span>,
<span class="pl-ent">"test_seed"</span>: <span class="pl-c1">0</span>,
<span class="pl-ent">"quote_id"</span>: <span class="pl-c1">0</span>,
<span class="pl-ent">"wpm"</span>: <span class="pl-c1">60</span>,
<span class="pl-ent">"accuracy"</span>: <span class="pl-c1">100</span>
},
{
<span class="pl-ent">"test_type"</span>: <span class="pl-s"><span class="pl-pds">"</span>words<span class="pl-pds">"</span></span>,
<span class="pl-ent">"test_length"</span>: <span class="pl-c1">47</span>,
<span class="pl-ent">"test_time"</span>: <span class="pl-c1">15</span>,
<span class="pl-ent">"test_seed"</span>: <span class="pl-c1">0</span>,
<span class="pl-ent">"quote_id"</span>: <span class="pl-c1">0</span>,
<span class="pl-ent">"wpm"</span>: <span class="pl-c1">37</span>,
<span class="pl-ent">"accuracy"</span>: <span class="pl-c1">98</span>
},
<span class="pl-ii">...</span>
]</pre></div>
</body>
</html>