1
0
mirror of https://gitlab.com/2-chainz/2-chainz-rest-site.git synced 2025-06-15 22:56:45 +00:00

added more detailed usage instructions

This commit is contained in:
Anson 2020-04-23 22:26:45 -07:00
parent b79d8a71e6
commit b5676962d4

View File

@ -105,35 +105,63 @@
<h2>Usage</h2>
</header>
<details open>
<summary>Getting Quotes</summary>
<summary>Quote</summary>
<p>
The <code>quotes</code> endpoint can be accessed here:
<code
><a href="https://api.chainz.rest/quote"
>https://api.chainz.rest/quote</a
></code
>
Returns a random 2 Chainz Quote in <code>json</code> format like the
following example:
</p>
<p>
This endpoint returns a 2 Chainz quote, and can optionally take the
<code>batch</code> parameter which allows requesting more than one
quote at a time.
</p></details
>
<p>send a <code>get</code> request to <code></code></p>
<pre><code>{
"quote": "I got a pocket full of money, it got me walking all slew-foot"
}</code></pre>
<details style="margin-left: 5%;">
<summary>Parameters</summary>
<p>
This endpoint also supports an optional <code>batch</code> parameter
to get more than one quote per request. Maximum quotes that the
endpoint will return is the amount of quotes in
<a
href="https://gitlab.com/2-chainz/2-chainz-rest/-/blob/master/quote/quotes.py"
>quotes.py</a
>
and is subject to change. An example return from
<a href="https://api.chainz.rest/quote?batch=2"
>https://api.chainz.rest/quote?batch=2</a
>:
</p>
<pre><code class="json">{
&emsp;&emsp;"quotes": [
&emsp;&emsp;&emsp;&emsp;"I'm in the kitchen. Yams errrrrwhere.",
&emsp;&emsp;&emsp;&emsp;"Started from the trap, now I rap"
&emsp;&emsp;]
}</code></pre>
</details>
</details>
<details
><summary>Aliases</summary>
><summary>Alias</summary>
<p>
2 Chainz has gone by many different names throughout his career and
this endpoint lets you request a random <code>alias</code> that Tity
Boi has used over the years. Can be accessed here:
<code
><a href="https://api.chainz.rest/alias"
>https://api.chainz.rest/alias</a
></code
>
</p></details
>
Returns a random 2 Chainz alias in <code>json</code> format. The
return values are weighted and a full list can be seen in
<a
href="https://gitlab.com/2-chainz/2-chainz-rest/-/blob/master/alias/aliases.py"
>aliases.py</a
>.
</p>
<p>
send a <code>get</code> request to
<code>https://api.chainz.rest/alias</code>
</p>
<pre><code>{
"alias": "Dos Cadenas"
}</code></pre>
</details>
<hr />
<section>
<header>