mirror of
https://github.com/danbulant/api_docs
synced 2026-05-19 20:28:52 +00:00
Compare commits
10 commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f1e221ea5c | ||
|
|
aa03936b5a | ||
|
|
108a8ac5b2 | ||
|
|
9204be36c2 | ||
|
|
24cccd5dae | ||
|
|
af6dc62525 | ||
|
|
9936125675 | ||
|
|
e098899319 | ||
|
|
4cfdcc3f2c | ||
|
|
274949c002 |
22 changed files with 1397 additions and 360 deletions
|
|
@ -23,6 +23,7 @@ GEM
|
||||||
fast_blank (1.0.0)
|
fast_blank (1.0.0)
|
||||||
fastimage (2.1.5)
|
fastimage (2.1.5)
|
||||||
ffi (1.11.1)
|
ffi (1.11.1)
|
||||||
|
ffi (1.11.1-x64-mingw32)
|
||||||
haml (5.1.1)
|
haml (5.1.1)
|
||||||
temple (>= 0.8.0)
|
temple (>= 0.8.0)
|
||||||
tilt
|
tilt
|
||||||
|
|
@ -80,6 +81,8 @@ GEM
|
||||||
minitest (5.11.3)
|
minitest (5.11.3)
|
||||||
nokogiri (1.10.4)
|
nokogiri (1.10.4)
|
||||||
mini_portile2 (~> 2.4.0)
|
mini_portile2 (~> 2.4.0)
|
||||||
|
nokogiri (1.10.4-x64-mingw32)
|
||||||
|
mini_portile2 (~> 2.4.0)
|
||||||
padrino-helpers (0.13.3.4)
|
padrino-helpers (0.13.3.4)
|
||||||
i18n (~> 0.6, >= 0.6.7)
|
i18n (~> 0.6, >= 0.6.7)
|
||||||
padrino-support (= 0.13.3.4)
|
padrino-support (= 0.13.3.4)
|
||||||
|
|
@ -118,6 +121,7 @@ GEM
|
||||||
|
|
||||||
PLATFORMS
|
PLATFORMS
|
||||||
ruby
|
ruby
|
||||||
|
x64-mingw32
|
||||||
|
|
||||||
DEPENDENCIES
|
DEPENDENCIES
|
||||||
middleman (~> 4.3)
|
middleman (~> 4.3)
|
||||||
|
|
@ -133,4 +137,4 @@ RUBY VERSION
|
||||||
ruby 2.3.3p222
|
ruby 2.3.3p222
|
||||||
|
|
||||||
BUNDLED WITH
|
BUNDLED WITH
|
||||||
2.0.2
|
2.1.4
|
||||||
|
|
|
||||||
116
README.md
116
README.md
|
|
@ -1,115 +1,3 @@
|
||||||
<p align="center">
|
# Docs
|
||||||
<img src="https://raw.githubusercontent.com/lord/img/master/logo-slate.png" alt="Slate: API Documentation Generator" width="226">
|
|
||||||
<br>
|
|
||||||
<a href="https://travis-ci.com/slatedocs/slate"><img src="https://travis-ci.com/slatedocs/slate.svg?branch=master" alt="Build Status"></a>
|
|
||||||
</p>
|
|
||||||
|
|
||||||
<p align="center">Slate helps you create beautiful, intelligent, responsive API documentation.</p>
|
This is a repository for API docs. See `danbulant.github.io/api_docs`.
|
||||||
|
|
||||||
<p align="center"><img src="https://raw.githubusercontent.com/lord/img/master/screenshot-slate.png" width=700 alt="Screenshot of Example Documentation created with Slate"></p>
|
|
||||||
|
|
||||||
<p align="center"><em>The example above was created with Slate. Check it out at <a href="https://slatedocs.github.io/slate">slatedocs.github.io/slate</a>.</em></p>
|
|
||||||
|
|
||||||
Features
|
|
||||||
------------
|
|
||||||
|
|
||||||
* **Clean, intuitive design** — With Slate, the description of your API is on the left side of your documentation, and all the code examples are on the right side. Inspired by [Stripe's](https://stripe.com/docs/api) and [PayPal's](https://developer.paypal.com/webapps/developer/docs/api/) API docs. Slate is responsive, so it looks great on tablets, phones, and even in print.
|
|
||||||
|
|
||||||
* **Everything on a single page** — Gone are the days when your users had to search through a million pages to find what they wanted. Slate puts the entire documentation on a single page. We haven't sacrificed linkability, though. As you scroll, your browser's hash will update to the nearest header, so linking to a particular point in the documentation is still natural and easy.
|
|
||||||
|
|
||||||
* **Slate is just Markdown** — When you write docs with Slate, you're just writing Markdown, which makes it simple to edit and understand. Everything is written in Markdown — even the code samples are just Markdown code blocks.
|
|
||||||
|
|
||||||
* **Write code samples in multiple languages** — If your API has bindings in multiple programming languages, you can easily put in tabs to switch between them. In your document, you'll distinguish different languages by specifying the language name at the top of each code block, just like with GitHub Flavored Markdown.
|
|
||||||
|
|
||||||
* **Out-of-the-box syntax highlighting** for [over 100 languages](https://github.com/jneen/rouge/wiki/List-of-supported-languages-and-lexers), no configuration required.
|
|
||||||
|
|
||||||
* **Automatic, smoothly scrolling table of contents** on the far left of the page. As you scroll, it displays your current position in the document. It's fast, too. We're using Slate at TripIt to build documentation for our new API, where our table of contents has over 180 entries. We've made sure that the performance remains excellent, even for larger documents.
|
|
||||||
|
|
||||||
* **Let your users update your documentation for you** — By default, your Slate-generated documentation is hosted in a public GitHub repository. Not only does this mean you get free hosting for your docs with GitHub Pages, but it also makes it simple for other developers to make pull requests to your docs if they find typos or other problems. Of course, if you don't want to use GitHub, you're also welcome to host your docs elsewhere.
|
|
||||||
|
|
||||||
* **RTL Support** Full right-to-left layout for RTL languages such as Arabic, Persian (Farsi), Hebrew etc.
|
|
||||||
|
|
||||||
Getting started with Slate is super easy! Simply fork this repository and follow the instructions below. Or, if you'd like to check out what Slate is capable of, take a look at the [sample docs](https://slatedocs.github.io/slate/).
|
|
||||||
|
|
||||||
Getting Started with Slate
|
|
||||||
------------------------------
|
|
||||||
|
|
||||||
### Prerequisites
|
|
||||||
|
|
||||||
You're going to need:
|
|
||||||
|
|
||||||
- **Linux or macOS** — Windows may work, but is unsupported.
|
|
||||||
- **Ruby, version 2.3.1 or newer**
|
|
||||||
- **Bundler** — If Ruby is already installed, but the `bundle` command doesn't work, just run `gem install bundler` in a terminal.
|
|
||||||
|
|
||||||
### Getting Set Up
|
|
||||||
|
|
||||||
1. Fork this repository on GitHub.
|
|
||||||
2. Clone *your forked repository* (not our original one) to your hard drive with `git clone https://github.com/YOURUSERNAME/slate.git`
|
|
||||||
3. `cd slate`
|
|
||||||
4. Initialize and start Slate. You can either do this locally, or with Vagrant:
|
|
||||||
|
|
||||||
```shell
|
|
||||||
# either run this to run locally
|
|
||||||
bundle install
|
|
||||||
bundle exec middleman server
|
|
||||||
|
|
||||||
# OR run this to run with vagrant
|
|
||||||
vagrant up
|
|
||||||
```
|
|
||||||
|
|
||||||
You can now see the docs at http://localhost:4567. Whoa! That was fast!
|
|
||||||
|
|
||||||
Now that Slate is all set up on your machine, you'll probably want to learn more about [editing Slate markdown](https://github.com/slatedocs/slate/wiki/Markdown-Syntax), or [how to publish your docs](https://github.com/slatedocs/slate/wiki/Deploying-Slate).
|
|
||||||
|
|
||||||
If you'd prefer to use Docker, instructions are available [in the wiki](https://github.com/slatedocs/slate/wiki/Docker).
|
|
||||||
|
|
||||||
### Note on JavaScript Runtime
|
|
||||||
|
|
||||||
For those who don't have JavaScript runtime or are experiencing JavaScript runtime issues with ExecJS, it is recommended to add the [rubyracer gem](https://github.com/cowboyd/therubyracer) to your gemfile and run `bundle` again.
|
|
||||||
|
|
||||||
Companies Using Slate
|
|
||||||
---------------------------------
|
|
||||||
|
|
||||||
* [NASA](https://api.nasa.gov)
|
|
||||||
* [Sony](http://developers.cimediacloud.com)
|
|
||||||
* [Best Buy](https://bestbuyapis.github.io/api-documentation/)
|
|
||||||
* [Travis-CI](https://docs.travis-ci.com/api/)
|
|
||||||
* [Greenhouse](https://developers.greenhouse.io/harvest.html)
|
|
||||||
* [WooCommerce](http://woocommerce.github.io/woocommerce-rest-api-docs/)
|
|
||||||
* [Dwolla](https://docs.dwolla.com/)
|
|
||||||
* [Clearbit](https://clearbit.com/docs)
|
|
||||||
* [Coinbase](https://developers.coinbase.com/api)
|
|
||||||
* [Parrot Drones](http://developer.parrot.com/docs/bebop/)
|
|
||||||
* [Scale](https://docs.scaleapi.com/)
|
|
||||||
|
|
||||||
You can view more in [the list on the wiki](https://github.com/slatedocs/slate/wiki/Slate-in-the-Wild).
|
|
||||||
|
|
||||||
Questions? Need Help? Found a bug?
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
If you've got questions about setup, deploying, special feature implementation in your fork, or just want to chat with the developer, please feel free to [start a thread in our Spectrum community](https://spectrum.chat/slate)!
|
|
||||||
|
|
||||||
Found a bug with upstream Slate? Go ahead and [submit an issue](https://github.com/slatedocs/slate/issues). And, of course, feel free to submit pull requests with bug fixes or changes to the `dev` branch.
|
|
||||||
|
|
||||||
Contributors
|
|
||||||
--------------------
|
|
||||||
|
|
||||||
Slate was built by [Robert Lord](https://lord.io) while interning at [TripIt](https://www.tripit.com/).
|
|
||||||
|
|
||||||
Thanks to the following people who have submitted major pull requests:
|
|
||||||
|
|
||||||
- [@chrissrogers](https://github.com/chrissrogers)
|
|
||||||
- [@bootstraponline](https://github.com/bootstraponline)
|
|
||||||
- [@realityking](https://github.com/realityking)
|
|
||||||
- [@cvkef](https://github.com/cvkef)
|
|
||||||
|
|
||||||
Also, thanks to [Sauce Labs](http://saucelabs.com) for sponsoring the development of the responsive styles.
|
|
||||||
|
|
||||||
Special Thanks
|
|
||||||
--------------------
|
|
||||||
- [Middleman](https://github.com/middleman/middleman)
|
|
||||||
- [jquery.tocify.js](https://github.com/gfranko/jquery.tocify.js)
|
|
||||||
- [middleman-syntax](https://github.com/middleman/middleman-syntax)
|
|
||||||
- [middleman-gh-pages](https://github.com/edgecase/middleman-gh-pages)
|
|
||||||
- [Font Awesome](http://fortawesome.github.io/Font-Awesome/)
|
|
||||||
BIN
docs/fonts/slate-33847ce5.woff
Normal file
BIN
docs/fonts/slate-33847ce5.woff
Normal file
Binary file not shown.
BIN
docs/fonts/slate-7b7da4fe.ttf
Normal file
BIN
docs/fonts/slate-7b7da4fe.ttf
Normal file
Binary file not shown.
BIN
docs/fonts/slate-cfc9d06b.eot
Normal file
BIN
docs/fonts/slate-cfc9d06b.eot
Normal file
Binary file not shown.
BIN
docs/fonts/slate-ddd488db.woff2
Normal file
BIN
docs/fonts/slate-ddd488db.woff2
Normal file
Binary file not shown.
14
docs/fonts/slate-e55b8307.svg
Normal file
14
docs/fonts/slate-e55b8307.svg
Normal file
|
|
@ -0,0 +1,14 @@
|
||||||
|
<?xml version="1.0" standalone="no"?>
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd" >
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg">
|
||||||
|
<metadata>Generated by IcoMoon</metadata>
|
||||||
|
<defs>
|
||||||
|
<font id="slate" horiz-adv-x="1024">
|
||||||
|
<font-face units-per-em="1024" ascent="960" descent="-64" />
|
||||||
|
<missing-glyph horiz-adv-x="1024" />
|
||||||
|
<glyph unicode=" " d="" horiz-adv-x="512" />
|
||||||
|
<glyph unicode="" d="M438.857 877.714q119.429 0 220.286-58.857t159.714-159.714 58.857-220.286-58.857-220.286-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857zM512 165.143v108.571q0 8-5.143 13.429t-12.571 5.429h-109.714q-7.429 0-13.143-5.714t-5.714-13.143v-108.571q0-7.429 5.714-13.143t13.143-5.714h109.714q7.429 0 12.571 5.429t5.143 13.429zM510.857 361.714l10.286 354.857q0 6.857-5.714 10.286-5.714 4.571-13.714 4.571h-125.714q-8 0-13.714-4.571-5.714-3.429-5.714-10.286l9.714-354.857q0-5.714 5.714-10t13.714-4.286h105.714q8 0 13.429 4.286t6 10z" />
|
||||||
|
<glyph unicode="" d="M585.143 164.571v91.429q0 8-5.143 13.143t-13.143 5.143h-54.857v292.571q0 8-5.143 13.143t-13.143 5.143h-182.857q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h54.857v-182.857h-54.857q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h256q8 0 13.143 5.143t5.143 13.143zM512 676.571v91.429q0 8-5.143 13.143t-13.143 5.143h-109.714q-8 0-13.143-5.143t-5.143-13.143v-91.429q0-8 5.143-13.143t13.143-5.143h109.714q8 0 13.143 5.143t5.143 13.143zM877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
|
||||||
|
<glyph unicode="" d="M733.714 531.428q0 16-10.286 26.286l-52 51.429q-10.857 10.857-25.714 10.857t-25.714-10.857l-233.143-232.571-129.143 129.143q-10.857 10.857-25.714 10.857t-25.714-10.857l-52-51.429q-10.286-10.286-10.286-26.286 0-15.429 10.286-25.714l206.857-206.857q10.857-10.857 25.714-10.857 15.429 0 26.286 10.857l310.286 310.286q10.286 10.286 10.286 25.714zM877.714 438.857q0-119.429-58.857-220.286t-159.714-159.714-220.286-58.857-220.286 58.857-159.714 159.714-58.857 220.286 58.857 220.286 159.714 159.714 220.286 58.857 220.286-58.857 159.714-159.714 58.857-220.286z" />
|
||||||
|
<glyph unicode="" d="M658.286 475.428q0 105.714-75.143 180.857t-180.857 75.143-180.857-75.143-75.143-180.857 75.143-180.857 180.857-75.143 180.857 75.143 75.143 180.857zM950.857 0q0-29.714-21.714-51.429t-51.429-21.714q-30.857 0-51.429 21.714l-196 195.429q-102.286-70.857-228-70.857-81.714 0-156.286 31.714t-128.571 85.714-85.714 128.571-31.714 156.286 31.714 156.286 85.714 128.571 128.571 85.714 156.286 31.714 156.286-31.714 128.571-85.714 85.714-128.571 31.714-156.286q0-125.714-70.857-228l196-196q21.143-21.143 21.143-51.429z" horiz-adv-x="951" />
|
||||||
|
</font></defs></svg>
|
||||||
|
After Width: | Height: | Size: 2.9 KiB |
BIN
docs/images/logo-1e815a84.png
Normal file
BIN
docs/images/logo-1e815a84.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 22 KiB |
BIN
docs/images/navbar-cad8cdcb.png
Normal file
BIN
docs/images/navbar-cad8cdcb.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 96 B |
7
docs/includes/endpoints
Normal file
7
docs/includes/endpoints
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
<h1 id='endpoints'>Endpoints</h1><h2 id='bakalari'>Bakalari</h2>
|
||||||
|
<blockquote>
|
||||||
|
<p>Example request</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight shell tab-shell"><code>curl <span class="s2">"https://api.danbulant.eu/v1/bakalari/rozvrh/user/domain.tld/SecretPassword123"</span>
|
||||||
|
</code></pre>
|
||||||
|
<p>Tries getting the info from Bakalari API.</p>
|
||||||
4
docs/includes/libraries
Normal file
4
docs/includes/libraries
Normal file
|
|
@ -0,0 +1,4 @@
|
||||||
|
<h1 id='libraries'>Libraries</h1><h2 id='js'>JS</h2>
|
||||||
|
<p><em>Currently unavailable, but planned.</em>
|
||||||
|
This library simplifies usage. It uses <code>got</code> under the hood for simplified request handling, and always returns promise.
|
||||||
|
Responses are just parsed JSON (as of now, but classes may be implemented in future).</p>
|
||||||
288
docs/includes/responses
Normal file
288
docs/includes/responses
Normal file
|
|
@ -0,0 +1,288 @@
|
||||||
|
<h1 id='response-format'>Response format</h1><h2 id='fields'>Fields</h2>
|
||||||
|
<p>Response is currently always in JSON (but we might support XML and JSONP if there will be someone who might use it). Response always has these fields:</p>
|
||||||
|
|
||||||
|
<table><thead>
|
||||||
|
<tr>
|
||||||
|
<th>Field</th>
|
||||||
|
<th>Purpose</th>
|
||||||
|
<th>example content</th>
|
||||||
|
</tr>
|
||||||
|
</thead><tbody>
|
||||||
|
<tr>
|
||||||
|
<td>code</td>
|
||||||
|
<td>Contains the HTTP code</td>
|
||||||
|
<td><code>200</code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>message</td>
|
||||||
|
<td>A string containing sample message.</td>
|
||||||
|
<td><code>Success, see type.</code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>type</td>
|
||||||
|
<td>A string with the type of returned data</td>
|
||||||
|
<td><code>ping_response</code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
<p>Response may have additional fields, such as <code>url</code> or <code>data</code>. These depends on the type.</p>
|
||||||
|
<h2 id='types'>Types</h2>
|
||||||
|
<p>Types that start with <code>e_</code> are <em>always</em> errors. The following type can be retrieved:</p>
|
||||||
|
<h3 id='e_invalid_key-key-only-endpoints'><code>e_invalid_key</code> | Key-only endpoints</h3>
|
||||||
|
<p>The key given is invalid and cannot be used.</p>
|
||||||
|
<h3 id='e_missing_query'><code>e_missing_query</code> | *</h3>
|
||||||
|
<p>Request lacks GET query string, which is required by the endpoint.</p>
|
||||||
|
<h3 id='e_invalid_query'><code>e_invalid_query</code> | *</h3>
|
||||||
|
<p>Request has invalid fields/missing fields/invalid values. See <code>message</code> in the response for more information.</p>
|
||||||
|
<h3 id='e_empty_response'><code>e_empty_response</code> | *</h3>
|
||||||
|
<p>Request succeeded, but the response provided by the endpoint was empty.</p>
|
||||||
|
<h3 id='e_cannot_get'><code>e_cannot_get</code> | *</h3>
|
||||||
|
<p>Request failed while trying to fetch external data.</p>
|
||||||
|
<h3 id='e_generic'><code>e_generic</code> | *</h3>
|
||||||
|
<p>Unknown error.</p>
|
||||||
|
<h3 id='e_ester_error-ester'><code>e_ester_error</code> | Ester</h3>
|
||||||
|
<p>An error occured inside Ester API. See <code>data</code> field (contains response from Ester API).</p>
|
||||||
|
<h3 id='e_bakalari_missing_school-bakalari'><code>e_bakalari_missing_school</code> | Bakalari</h3>
|
||||||
|
<p>Error occured during fetching data from the given domain, which usually means the schoold doesn't exists or has private API (currently no known school has private API).</p>
|
||||||
|
<h3 id='e_bakalari_missing_user-bakalari'><code>e_bakalari_missing_user</code> | Bakalari</h3>
|
||||||
|
<p>Request to school succeeded, but the user doesn't exists.</p>
|
||||||
|
<h3 id='e_missing_subreddit-reddit'><code>e_missing_subreddit</code> | Reddit</h3>
|
||||||
|
<p>Couldn't fetch subreddit. Subreddit may be NSFW (which are currently unsupported) or private or just simply doesn't exists.</p>
|
||||||
|
<h3 id='e_reddit_failed-reddit'><code>e_reddit_failed</code> | Reddit</h3>
|
||||||
|
<p>Reddit returned invalid response and/or error response.</p>
|
||||||
|
<h3 id='e_neko_type-nekos'><code>e_neko_type</code> | Nekos</h3>
|
||||||
|
<p>Unknown neko type.</p>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, nothing to do"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"generic"</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='generic'><code>generic</code> | *</h3>
|
||||||
|
<p>A response containing only the default 3 fields.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see types"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"neko_list"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"types"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="s2">"..."</span><span class="w"> </span><span class="p">]</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='neko_list-nekos'><code>neko_list</code> | Nekos</h3>
|
||||||
|
<p>List of available <code>neko</code> endpoints.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">404</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ICe API in development, see later"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ice_response"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{}</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='ice_response-ice'><code>ice_response</code> | Ice</h3>
|
||||||
|
<p>A generic bot response.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ice_http_code_response"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"http"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"standart"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"OK"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request, the response will contain an entity describing or containing the result of the action."</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"choices"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
|
||||||
|
</span><span class="p">},</span><span class="w">
|
||||||
|
</span><span class="s2">"source"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Wikipedia"</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='ice_http_code_response-http'><code>ice_http_code_response</code> | Http</h3>
|
||||||
|
<p>A response containing information about given http code.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">400</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Missing parameter code. Use it as /http/:code"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"e_ice_http_missing_code"</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='ice_http_code_list-ice'><code>ice_http_code_list</code> | Ice</h3>
|
||||||
|
<p>A <em>planned</em> response to list all available HTTP codes.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
<h3 id='pushr_response-pushr'><code>pushr_response</code> | Pushr</h3>
|
||||||
|
<p>A response from Pushr API (danbulant.eu API acts as pass-through for this).</p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see reddit"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"reddit_response"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"reddit"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"I really ininterested"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"image"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://imgur.com/tLBzS1h.jpg"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="s2">"nickjayr"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"authorIcon"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://www.redditstatic.com/avatars/avatar_default_17_0DD3BB.png"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"link"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://reddit.com/r/memes/comments/ey2hkb/i_really_ininterested/"</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='redddit_response-reddit'><code>redddit_response</code> | Reddit</h3>
|
||||||
|
<p>Response from reddit API containing <code>reddit</code> object.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see response"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"path"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ester_response"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Čau!"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"user"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Daniel"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="w">
|
||||||
|
</span><span class="p">},</span><span class="w">
|
||||||
|
</span><span class="s2">"text"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Čau!"</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='ester_response-ester'><code>ester_response</code> | Ester</h3>
|
||||||
|
<p>A generic response from Ester API.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"bakalari_response"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"verze"</span><span class="p">:</span><span class="w"> </span><span class="s2">"17/18.20191219"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"jmeno"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[NAME HIDDEN]"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"typ"</span><span class="p">:</span><span class="w"> </span><span class="s2">"R"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"strtyp"</span><span class="p">:</span><span class="w"> </span><span class="s2">"rodič"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"skola"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[SCHOOL REDACTED]"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"typskoly"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"trida"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.A"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"rocnik"</span><span class="p">:</span><span class="w"> </span><span class="mi">-1</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"moduly"</span><span class="p">:</span><span class="w"> </span><span class="s2">"*znamky*predvidac*rozvrh*predmety*vyuka*ukoly*akce*suplovani*absence*pololetni*prijate*odeslane*nastenka*setread*setok*komsend*komenslisty*komdel*"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"params"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"newmarkdays"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
|
||||||
|
</span><span class="p">},</span><span class="w">
|
||||||
|
</span><span class="s2">"result"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='bakalari_response-bakalari'><code>bakalari_response</code> | Bakalari</h3>
|
||||||
|
<p>Response from the <code>bakalari</code> API. Format depends on the bakalari response (e.g., try the desired info in browser to see, as danbulant.eu only converts xml to json).</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see url"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"image"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://i.imgur.com/wVUpmao.jpg"</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='image'><code>image</code> | *</h3>
|
||||||
|
<p>Generic image response. The actual image is on adress inside the provided <code>url</code> field.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
572
docs/index.html
Normal file
572
docs/index.html
Normal file
|
|
@ -0,0 +1,572 @@
|
||||||
|
|
||||||
|
<!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">
|
||||||
|
<title>API Reference</title>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
.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 .cd {
|
||||||
|
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 {
|
||||||
|
color: #e6db74;
|
||||||
|
}
|
||||||
|
.highlight .na {
|
||||||
|
color: #a6e22e;
|
||||||
|
}
|
||||||
|
.highlight .nc {
|
||||||
|
color: #a6e22e;
|
||||||
|
}
|
||||||
|
.highlight .nd {
|
||||||
|
color: #a6e22e;
|
||||||
|
}
|
||||||
|
.highlight .ne {
|
||||||
|
color: #a6e22e;
|
||||||
|
}
|
||||||
|
.highlight .nf {
|
||||||
|
color: #a6e22e;
|
||||||
|
}
|
||||||
|
.highlight .vc {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.highlight .nn {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.highlight .nl {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.highlight .ni {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.highlight .bp {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.highlight .vg {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.highlight .vi {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.highlight .nv {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.highlight .w {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.highlight {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.highlight .n, .highlight .py, .highlight .nx {
|
||||||
|
color: #ffffff;
|
||||||
|
}
|
||||||
|
.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>
|
||||||
|
<link href="stylesheets/screen-a1ce949a.css" rel="stylesheet" media="screen" />
|
||||||
|
<link href="stylesheets/print-bccf8c07.css" rel="stylesheet" media="print" />
|
||||||
|
<script src="javascripts/all-c5541673.js"></script>
|
||||||
|
</head>
|
||||||
|
|
||||||
|
<body class="index" data-languages="["shell","javascript"]">
|
||||||
|
<a href="#" id="nav-button">
|
||||||
|
<span>
|
||||||
|
NAV
|
||||||
|
<img src="images/navbar-cad8cdcb.png" alt="Navbar" />
|
||||||
|
</span>
|
||||||
|
</a>
|
||||||
|
<div class="toc-wrapper">
|
||||||
|
<img src="images/logo-1e815a84.png" class="logo" alt="Logo" />
|
||||||
|
<div class="lang-selector">
|
||||||
|
<a href="#" data-language-name="shell">shell</a>
|
||||||
|
<a href="#" data-language-name="javascript">javascript</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="#response-format" class="toc-h1 toc-link" data-title="Response format">Response format</a>
|
||||||
|
<ul class="toc-list-h2">
|
||||||
|
<li>
|
||||||
|
<a href="#fields" class="toc-h2 toc-link" data-title="Fields">Fields</a>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#types" class="toc-h2 toc-link" data-title="Types">Types</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#libraries" class="toc-h1 toc-link" data-title="Libraries">Libraries</a>
|
||||||
|
<ul class="toc-list-h2">
|
||||||
|
<li>
|
||||||
|
<a href="#js" class="toc-h2 toc-link" data-title="JS">JS</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<a href="#endpoints" class="toc-h1 toc-link" data-title="Endpoints">Endpoints</a>
|
||||||
|
<ul class="toc-list-h2">
|
||||||
|
<li>
|
||||||
|
<a href="#bakalari" class="toc-h2 toc-link" data-title="Bakalari">Bakalari</a>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
<ul class="toc-footer">
|
||||||
|
<li><a href='https://discord.gg/dZtq4Qu'>Contact us for a Developer Key</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="page-wrapper">
|
||||||
|
<div class="dark-box"></div>
|
||||||
|
<div class="content">
|
||||||
|
<h1 id='introduction'>Introduction</h1>
|
||||||
|
<p>Danbulant API is a wrapper around all of APIs available at danbulant.eu.
|
||||||
|
Most of endpoints currently don't require developer key, but for future use, we suggest still getting one. You won't do anything bad if you try to reach a free endpoint with developer key. You can contact us <a href="https://discord.gg/dZtq4Qu">here</a> on our discord server to get information about getting one.</p>
|
||||||
|
<h1 id='response-format'>Response format</h1><h2 id='fields'>Fields</h2>
|
||||||
|
<p>Response is currently always in JSON (but we might support XML and JSONP if there will be someone who might use it). Response always has these fields:</p>
|
||||||
|
|
||||||
|
<table><thead>
|
||||||
|
<tr>
|
||||||
|
<th>Field</th>
|
||||||
|
<th>Purpose</th>
|
||||||
|
<th>example content</th>
|
||||||
|
</tr>
|
||||||
|
</thead><tbody>
|
||||||
|
<tr>
|
||||||
|
<td>code</td>
|
||||||
|
<td>Contains the HTTP code</td>
|
||||||
|
<td><code>200</code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>message</td>
|
||||||
|
<td>A string containing sample message.</td>
|
||||||
|
<td><code>Success, see type.</code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>type</td>
|
||||||
|
<td>A string with the type of returned data</td>
|
||||||
|
<td><code>ping_response</code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody></table>
|
||||||
|
|
||||||
|
<p>Response may have additional fields, such as <code>url</code> or <code>data</code>. These depends on the type.</p>
|
||||||
|
<h2 id='types'>Types</h2>
|
||||||
|
<p>Types that start with <code>e_</code> are <em>always</em> errors. The following type can be retrieved:</p>
|
||||||
|
<h3 id='e_invalid_key-key-only-endpoints'><code>e_invalid_key</code> | Key-only endpoints</h3>
|
||||||
|
<p>The key given is invalid and cannot be used.</p>
|
||||||
|
<h3 id='e_missing_query'><code>e_missing_query</code> | *</h3>
|
||||||
|
<p>Request lacks GET query string, which is required by the endpoint.</p>
|
||||||
|
<h3 id='e_invalid_query'><code>e_invalid_query</code> | *</h3>
|
||||||
|
<p>Request has invalid fields/missing fields/invalid values. See <code>message</code> in the response for more information.</p>
|
||||||
|
<h3 id='e_empty_response'><code>e_empty_response</code> | *</h3>
|
||||||
|
<p>Request succeeded, but the response provided by the endpoint was empty.</p>
|
||||||
|
<h3 id='e_cannot_get'><code>e_cannot_get</code> | *</h3>
|
||||||
|
<p>Request failed while trying to fetch external data.</p>
|
||||||
|
<h3 id='e_generic'><code>e_generic</code> | *</h3>
|
||||||
|
<p>Unknown error.</p>
|
||||||
|
<h3 id='e_ester_error-ester'><code>e_ester_error</code> | Ester</h3>
|
||||||
|
<p>An error occured inside Ester API. See <code>data</code> field (contains response from Ester API).</p>
|
||||||
|
<h3 id='e_bakalari_missing_school-bakalari'><code>e_bakalari_missing_school</code> | Bakalari</h3>
|
||||||
|
<p>Error occured during fetching data from the given domain, which usually means the schoold doesn't exists or has private API (currently no known school has private API).</p>
|
||||||
|
<h3 id='e_bakalari_missing_user-bakalari'><code>e_bakalari_missing_user</code> | Bakalari</h3>
|
||||||
|
<p>Request to school succeeded, but the user doesn't exists.</p>
|
||||||
|
<h3 id='e_missing_subreddit-reddit'><code>e_missing_subreddit</code> | Reddit</h3>
|
||||||
|
<p>Couldn't fetch subreddit. Subreddit may be NSFW (which are currently unsupported) or private or just simply doesn't exists.</p>
|
||||||
|
<h3 id='e_reddit_failed-reddit'><code>e_reddit_failed</code> | Reddit</h3>
|
||||||
|
<p>Reddit returned invalid response and/or error response.</p>
|
||||||
|
<h3 id='e_neko_type-nekos'><code>e_neko_type</code> | Nekos</h3>
|
||||||
|
<p>Unknown neko type.</p>
|
||||||
|
|
||||||
|
<hr>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, nothing to do"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"generic"</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='generic'><code>generic</code> | *</h3>
|
||||||
|
<p>A response containing only the default 3 fields.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see types"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"neko_list"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"types"</span><span class="p">:</span><span class="w"> </span><span class="p">[</span><span class="w"> </span><span class="s2">"..."</span><span class="w"> </span><span class="p">]</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='neko_list-nekos'><code>neko_list</code> | Nekos</h3>
|
||||||
|
<p>List of available <code>neko</code> endpoints.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">404</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ICe API in development, see later"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ice_response"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{}</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='ice_response-ice'><code>ice_response</code> | Ice</h3>
|
||||||
|
<p>A generic bot response.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ice_http_code_response"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"http"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"standart"</span><span class="p">:</span><span class="w"> </span><span class="kc">true</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"OK"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"description"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request, the response will contain an entity describing or containing the result of the action."</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"choices"</span><span class="p">:</span><span class="w"> </span><span class="p">[]</span><span class="w">
|
||||||
|
</span><span class="p">},</span><span class="w">
|
||||||
|
</span><span class="s2">"source"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Wikipedia"</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='ice_http_code_response-http'><code>ice_http_code_response</code> | Http</h3>
|
||||||
|
<p>A response containing information about given http code.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">400</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Missing parameter code. Use it as /http/:code"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"e_ice_http_missing_code"</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='ice_http_code_list-ice'><code>ice_http_code_list</code> | Ice</h3>
|
||||||
|
<p>A <em>planned</em> response to list all available HTTP codes.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
<h3 id='pushr_response-pushr'><code>pushr_response</code> | Pushr</h3>
|
||||||
|
<p>A response from Pushr API (danbulant.eu API acts as pass-through for this).</p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see reddit"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"reddit_response"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"reddit"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"title"</span><span class="p">:</span><span class="w"> </span><span class="s2">"I really ininterested"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"image"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://imgur.com/tLBzS1h.jpg"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"author"</span><span class="p">:</span><span class="w"> </span><span class="s2">"nickjayr"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"authorIcon"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://www.redditstatic.com/avatars/avatar_default_17_0DD3BB.png"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"link"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://reddit.com/r/memes/comments/ey2hkb/i_really_ininterested/"</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='redddit_response-reddit'><code>redddit_response</code> | Reddit</h3>
|
||||||
|
<p>Response from reddit API containing <code>reddit</code> object.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see response"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"path"</span><span class="p">:</span><span class="w"> </span><span class="s2">"/"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"ester_response"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Čau!"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"user"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"name"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Daniel"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"id"</span><span class="p">:</span><span class="w"> </span><span class="s2">"1"</span><span class="w">
|
||||||
|
</span><span class="p">},</span><span class="w">
|
||||||
|
</span><span class="s2">"text"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Čau!"</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='ester_response-ester'><code>ester_response</code> | Ester</h3>
|
||||||
|
<p>A generic response from Ester API.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"bakalari_response"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"data"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"verze"</span><span class="p">:</span><span class="w"> </span><span class="s2">"17/18.20191219"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"jmeno"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[NAME HIDDEN]"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"typ"</span><span class="p">:</span><span class="w"> </span><span class="s2">"R"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"strtyp"</span><span class="p">:</span><span class="w"> </span><span class="s2">"rodič"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"skola"</span><span class="p">:</span><span class="w"> </span><span class="s2">"[SCHOOL REDACTED]"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"typskoly"</span><span class="p">:</span><span class="w"> </span><span class="s2">""</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"trida"</span><span class="p">:</span><span class="w"> </span><span class="s2">"0.A"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"rocnik"</span><span class="p">:</span><span class="w"> </span><span class="mi">-1</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"moduly"</span><span class="p">:</span><span class="w"> </span><span class="s2">"*znamky*predvidac*rozvrh*predmety*vyuka*ukoly*akce*suplovani*absence*pololetni*prijate*odeslane*nastenka*setread*setok*komsend*komenslisty*komdel*"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"params"</span><span class="p">:</span><span class="w"> </span><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"newmarkdays"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
|
||||||
|
</span><span class="p">},</span><span class="w">
|
||||||
|
</span><span class="s2">"result"</span><span class="p">:</span><span class="w"> </span><span class="mi">1</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='bakalari_response-bakalari'><code>bakalari_response</code> | Bakalari</h3>
|
||||||
|
<p>Response from the <code>bakalari</code> API. Format depends on the bakalari response (e.g., try the desired info in browser to see, as danbulant.eu only converts xml to json).</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
|
||||||
|
<blockquote>
|
||||||
|
<p>Example response:</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight json tab-json"><code><span class="p">{</span><span class="w">
|
||||||
|
</span><span class="s2">"code"</span><span class="p">:</span><span class="w"> </span><span class="mi">200</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"message"</span><span class="p">:</span><span class="w"> </span><span class="s2">"Success, see url"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"type"</span><span class="p">:</span><span class="w"> </span><span class="s2">"image"</span><span class="p">,</span><span class="w">
|
||||||
|
</span><span class="s2">"url"</span><span class="p">:</span><span class="w"> </span><span class="s2">"https://i.imgur.com/wVUpmao.jpg"</span><span class="w">
|
||||||
|
</span><span class="p">}</span><span class="w">
|
||||||
|
</span></code></pre><h3 id='image'><code>image</code> | *</h3>
|
||||||
|
<p>Generic image response. The actual image is on adress inside the provided <code>url</code> field.</p>
|
||||||
|
|
||||||
|
<p><br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br></p>
|
||||||
|
<h1 id='libraries'>Libraries</h1><h2 id='js'>JS</h2>
|
||||||
|
<p><em>Currently unavailable, but planned.</em>
|
||||||
|
This library simplifies usage. It uses <code>got</code> under the hood for simplified request handling, and always returns promise.
|
||||||
|
Responses are just parsed JSON (as of now, but classes may be implemented in future).</p>
|
||||||
|
<h1 id='endpoints'>Endpoints</h1><h2 id='bakalari'>Bakalari</h2>
|
||||||
|
<blockquote>
|
||||||
|
<p>Example request</p>
|
||||||
|
</blockquote>
|
||||||
|
<pre class="highlight shell tab-shell"><code>curl <span class="s2">"https://api.danbulant.eu/v1/bakalari/rozvrh/user/domain.tld/SecretPassword123"</span>
|
||||||
|
</code></pre>
|
||||||
|
<p>Tries getting the info from Bakalari API.</p>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
<div class="dark-box">
|
||||||
|
<div class="lang-selector">
|
||||||
|
<a href="#" data-language-name="shell">shell</a>
|
||||||
|
<a href="#" data-language-name="javascript">javascript</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
131
docs/javascripts/all-c5541673.js
Normal file
131
docs/javascripts/all-c5541673.js
Normal file
File diff suppressed because one or more lines are too long
31
docs/javascripts/all_nosearch-c275c2f6.js
Normal file
31
docs/javascripts/all_nosearch-c275c2f6.js
Normal file
File diff suppressed because one or more lines are too long
1
docs/stylesheets/print-bccf8c07.css
Normal file
1
docs/stylesheets/print-bccf8c07.css
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
/*! normalize.css v3.0.2 | MIT License | git.io/normalize */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}h1{font-size:2em;margin:0.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{-webkit-box-sizing:content-box;box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace, monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type="button"],input[type="reset"],input[type="submit"]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type="checkbox"],input[type="radio"]{-webkit-box-sizing:border-box;box-sizing:border-box;padding:0}input[type="number"]::-webkit-inner-spin-button,input[type="number"]::-webkit-outer-spin-button{height:auto}input[type="search"]{-webkit-appearance:textfield;-webkit-box-sizing:content-box;box-sizing:content-box}input[type="search"]::-webkit-search-cancel-button,input[type="search"]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:0.35em 0.625em 0.75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:bold}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}.content h1,.content h2,.content h3,.content h4,body{font-family:-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";font-size:14px}.content h1,.content h2,.content h3,.content h4{font-weight:bold}.content pre,.content code{font-family:Consolas, Menlo, Monaco, "Lucida Console", "Liberation Mono", "DejaVu Sans Mono", "Bitstream Vera Sans Mono", "Courier New", monospace, serif;font-size:12px;line-height:1.5}.content pre,.content code{word-break:break-all;-webkit-hyphens:auto;-ms-hyphens:auto;hyphens:auto}@font-face{font-family:'slate';src:url(../fonts/slate-cfc9d06b.eot?-syv14m);src:url(../fonts/slate-cfc9d06b.eot?#iefix-syv14m) format("embedded-opentype"),url(../fonts/slate-ddd488db.woff2?-syv14m) format("woff2"),url(../fonts/slate-33847ce5.woff?-syv14m) format("woff"),url(../fonts/slate-7b7da4fe.ttf?-syv14m) format("truetype"),url(../fonts/slate-e55b8307.svg?-syv14m#slate) format("svg");font-weight:normal;font-style:normal}.content aside.warning:before,.content aside.notice:before,.content aside.success:before{font-family:'slate';speak:none;font-style:normal;font-weight:normal;font-variant:normal;text-transform:none;line-height:1}.content aside.warning:before{content:"\e600"}.content aside.notice:before{content:"\e602"}.content aside.success:before{content:"\e606"}.tocify,.toc-footer,.lang-selector,.search,#nav-button{display:none}.tocify-wrapper>img{margin:0 auto;display:block}.content{font-size:12px}.content pre,.content code{border:1px solid #999;border-radius:5px;font-size:0.8em}.content pre code{border:0}.content pre{padding:1.3em}.content code{padding:0.2em}.content table{border:1px solid #999}.content table tr{border-bottom:1px solid #999}.content table td,.content table th{padding:0.7em}.content p{line-height:1.5}.content a{text-decoration:none;color:#000}.content h1{font-size:2.5em;padding-top:0.5em;padding-bottom:0.5em;margin-top:1em;margin-bottom:21px;border:2px solid #ccc;border-width:2px 0;text-align:center}.content h2{font-size:1.8em;margin-top:2em;border-top:2px solid #ccc;padding-top:0.8em}.content h1+h2,.content h1+div+h2{border-top:none;padding-top:0;margin-top:0}.content h3,.content h4{font-size:0.8em;margin-top:1.5em;margin-bottom:0.8em;text-transform:uppercase}.content h5,.content h6{text-transform:uppercase}.content aside{padding:1em;border:1px solid #ccc;border-radius:5px;margin-top:1.5em;margin-bottom:1.5em;line-height:1.6}.content aside:before{vertical-align:middle;padding-right:0.5em;font-size:14px}
|
||||||
1
docs/stylesheets/screen-a1ce949a.css
Normal file
1
docs/stylesheets/screen-a1ce949a.css
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -1,22 +0,0 @@
|
||||||
# Errors
|
|
||||||
|
|
||||||
<aside class="notice">
|
|
||||||
This error section is stored in a separate file in <code>includes/_errors.md</code>. Slate allows you to optionally separate out your docs into many files...just save them to the <code>includes</code> folder and add them to the top of your <code>index.md</code>'s frontmatter. Files are included in the order listed.
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
The Kittn API uses the following error codes:
|
|
||||||
|
|
||||||
|
|
||||||
Error Code | Meaning
|
|
||||||
---------- | -------
|
|
||||||
400 | Bad Request -- Your request is invalid.
|
|
||||||
401 | Unauthorized -- Your API key is wrong.
|
|
||||||
403 | Forbidden -- The kitten requested is hidden for administrators only.
|
|
||||||
404 | Not Found -- The specified kitten could not be found.
|
|
||||||
405 | Method Not Allowed -- You tried to access a kitten with an invalid method.
|
|
||||||
406 | Not Acceptable -- You requested a format that isn't json.
|
|
||||||
410 | Gone -- The kitten requested has been removed from our servers.
|
|
||||||
418 | I'm a teapot.
|
|
||||||
429 | Too Many Requests -- You're requesting too many kittens! Slow down!
|
|
||||||
500 | Internal Server Error -- We had a problem with our server. Try again later.
|
|
||||||
503 | Service Unavailable -- We're temporarily offline for maintenance. Please try again later.
|
|
||||||
12
source/includes/endpoints.md
Normal file
12
source/includes/endpoints.md
Normal file
|
|
@ -0,0 +1,12 @@
|
||||||
|
# Endpoints
|
||||||
|
|
||||||
|
All endpoints can be found on [https://api.danbulant.eu/v1/](https://api.danbulant.eu/v1/)
|
||||||
|
## Bakalari
|
||||||
|
|
||||||
|
> Example request
|
||||||
|
|
||||||
|
```shell
|
||||||
|
curl "https://api.danbulant.eu/v1/bakalari/rozvrh/user/domain.tld/SecretPassword123"
|
||||||
|
```
|
||||||
|
|
||||||
|
Tries getting the info from Bakalari API.
|
||||||
7
source/includes/libraries.md
Normal file
7
source/includes/libraries.md
Normal file
|
|
@ -0,0 +1,7 @@
|
||||||
|
# Libraries
|
||||||
|
|
||||||
|
## JS
|
||||||
|
|
||||||
|
*Currently unavailable, but planned.*
|
||||||
|
This library simplifies usage. It uses `got` under the hood for simplified request handling, and always returns promise.
|
||||||
|
Responses are just parsed JSON (as of now, but classes may be implemented in future).
|
||||||
316
source/includes/responses.md
Normal file
316
source/includes/responses.md
Normal file
|
|
@ -0,0 +1,316 @@
|
||||||
|
# Response format
|
||||||
|
|
||||||
|
## Fields
|
||||||
|
Response is currently always in JSON (but we might support XML and JSONP if there will be someone who might use it). Response always has these fields:
|
||||||
|
|
||||||
|
| Field | Purpose | example content |
|
||||||
|
|---------|------------------------------------------|----------------------|
|
||||||
|
| code | Contains the HTTP code | `200` |
|
||||||
|
| message | A string containing sample message. | `Success, see type.` |
|
||||||
|
| type | A string with the type of returned data | `ping_response` |
|
||||||
|
|
||||||
|
Response may have additional fields, such as `url` or `data`. These depends on the type.
|
||||||
|
|
||||||
|
## Types
|
||||||
|
|
||||||
|
Types that start with `e_` are *always* errors. The following type can be retrieved:
|
||||||
|
|
||||||
|
|
||||||
|
### `e_invalid_key` | Key-only endpoints
|
||||||
|
The key given is invalid and cannot be used.
|
||||||
|
|
||||||
|
### `e_missing_query` | *
|
||||||
|
Request lacks GET query string, which is required by the endpoint.
|
||||||
|
|
||||||
|
### `e_invalid_query` | *
|
||||||
|
Request has invalid fields/missing fields/invalid values. See `message` in the response for more information.
|
||||||
|
|
||||||
|
### `e_empty_response` | *
|
||||||
|
Request succeeded, but the response provided by the endpoint was empty.
|
||||||
|
|
||||||
|
### `e_cannot_get` | *
|
||||||
|
Request failed while trying to fetch external data.
|
||||||
|
|
||||||
|
### `e_generic` | *
|
||||||
|
Unknown error.
|
||||||
|
|
||||||
|
### `e_ester_error` | Ester
|
||||||
|
An error occured inside Ester API. See `data` field (contains response from Ester API).
|
||||||
|
|
||||||
|
### `e_bakalari_missing_school` | Bakalari
|
||||||
|
Error occured during fetching data from the given domain, which usually means the schoold doesn't exists or has private API (currently no known school has private API).
|
||||||
|
|
||||||
|
### `e_bakalari_missing_user` | Bakalari
|
||||||
|
Request to school succeeded, but the user doesn't exists.
|
||||||
|
|
||||||
|
### `e_missing_subreddit` | Reddit
|
||||||
|
Couldn't fetch subreddit. Subreddit may be NSFW (which are currently unsupported) or private or just simply doesn't exists.
|
||||||
|
|
||||||
|
### `e_reddit_failed` | Reddit
|
||||||
|
Reddit returned invalid response and/or error response.
|
||||||
|
|
||||||
|
### `e_neko_type` | Nekos
|
||||||
|
Unknown neko type.
|
||||||
|
|
||||||
|
-----
|
||||||
|
|
||||||
|
> Example response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 200,
|
||||||
|
"message": "Success, nothing to do",
|
||||||
|
"type": "generic"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `generic` | *
|
||||||
|
|
||||||
|
A response containing only the default 3 fields.
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
> Example response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 200,
|
||||||
|
"message": "Success, see types",
|
||||||
|
"type": "neko_list",
|
||||||
|
"types": [ "..." ]
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `neko_list` | Nekos
|
||||||
|
|
||||||
|
List of available `neko` endpoints.
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
> Example response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 404,
|
||||||
|
"message": "ICe API in development, see later",
|
||||||
|
"type": "ice_response",
|
||||||
|
"data": {}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `ice_response` | Ice
|
||||||
|
|
||||||
|
A generic bot response.
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
> Example response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 200,
|
||||||
|
"type": "ice_http_code_response",
|
||||||
|
"http": {
|
||||||
|
"standart": true,
|
||||||
|
"title": "OK",
|
||||||
|
"description": "Standard response for successful HTTP requests. The actual response will depend on the request method used. In a GET request, the response will contain an entity corresponding to the requested resource. In a POST request, the response will contain an entity describing or containing the result of the action.",
|
||||||
|
"choices": []
|
||||||
|
},
|
||||||
|
"source": "Wikipedia"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `ice_http_code_response` | Http
|
||||||
|
|
||||||
|
A response containing information about given http code.
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
|
||||||
|
> Example response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 400,
|
||||||
|
"message": "Missing parameter code. Use it as /http/:code",
|
||||||
|
"type": "e_ice_http_missing_code"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `ice_http_code_list` | Ice
|
||||||
|
|
||||||
|
A *planned* response to list all available HTTP codes.
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
### `pushr_response` | Pushr
|
||||||
|
A response from Pushr API (danbulant.eu API acts as pass-through for this).
|
||||||
|
|
||||||
|
> Example response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 200,
|
||||||
|
"message": "Success, see reddit",
|
||||||
|
"type": "reddit_response",
|
||||||
|
"reddit": {
|
||||||
|
"title": "I really ininterested",
|
||||||
|
"image": "https://imgur.com/tLBzS1h.jpg",
|
||||||
|
"author": "nickjayr",
|
||||||
|
"authorIcon": "https://www.redditstatic.com/avatars/avatar_default_17_0DD3BB.png",
|
||||||
|
"link": "https://reddit.com/r/memes/comments/ey2hkb/i_really_ininterested/"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `redddit_response` | Reddit
|
||||||
|
|
||||||
|
Response from reddit API containing `reddit` object.
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
> Example response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 200,
|
||||||
|
"message": "Success, see response",
|
||||||
|
"path": "/",
|
||||||
|
"type": "ester_response",
|
||||||
|
"data": {
|
||||||
|
"code": 200,
|
||||||
|
"message": "Čau!",
|
||||||
|
"user": {
|
||||||
|
"name": "Daniel",
|
||||||
|
"id": "1"
|
||||||
|
},
|
||||||
|
"text": "Čau!"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `ester_response` | Ester
|
||||||
|
|
||||||
|
A generic response from Ester API.
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
> Example response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 200,
|
||||||
|
"message": "Success",
|
||||||
|
"type": "bakalari_response",
|
||||||
|
"data": {
|
||||||
|
"verze": "17/18.20191219",
|
||||||
|
"jmeno": "[NAME HIDDEN]",
|
||||||
|
"typ": "R",
|
||||||
|
"strtyp": "rodič",
|
||||||
|
"skola": "[SCHOOL REDACTED]",
|
||||||
|
"typskoly": "",
|
||||||
|
"trida": "0.A",
|
||||||
|
"rocnik": -1,
|
||||||
|
"moduly": "*znamky*predvidac*rozvrh*predmety*vyuka*ukoly*akce*suplovani*absence*pololetni*prijate*odeslane*nastenka*setread*setok*komsend*komenslisty*komdel*",
|
||||||
|
"params": {
|
||||||
|
"newmarkdays": 1
|
||||||
|
},
|
||||||
|
"result": 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `bakalari_response` | Bakalari
|
||||||
|
|
||||||
|
Response from the `bakalari` API. Format depends on the bakalari response (e.g., try the desired info in browser to see, as danbulant.eu only converts xml to json).
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
||||||
|
> Example response:
|
||||||
|
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"code": 200,
|
||||||
|
"message": "Success, see url",
|
||||||
|
"type": "image",
|
||||||
|
"url": "https://i.imgur.com/wVUpmao.jpg"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
### `image` | *
|
||||||
|
|
||||||
|
Generic image response. The actual image is on adress inside the provided `url` field.
|
||||||
|
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
<br>
|
||||||
|
|
@ -3,237 +3,20 @@ title: API Reference
|
||||||
|
|
||||||
language_tabs: # must be one of https://git.io/vQNgJ
|
language_tabs: # must be one of https://git.io/vQNgJ
|
||||||
- shell
|
- shell
|
||||||
- ruby
|
|
||||||
- python
|
|
||||||
- javascript
|
- javascript
|
||||||
|
|
||||||
toc_footers:
|
toc_footers:
|
||||||
- <a href='#'>Sign Up for a Developer Key</a>
|
- <a href='https://discord.gg/dZtq4Qu'>Contact us for a Developer Key</a>
|
||||||
- <a href='https://github.com/lord/slate'>Documentation Powered by Slate</a>
|
|
||||||
|
|
||||||
includes:
|
includes:
|
||||||
- errors
|
- responses
|
||||||
|
- libraries
|
||||||
|
- endpoints
|
||||||
|
|
||||||
search: true
|
search: true
|
||||||
---
|
---
|
||||||
|
|
||||||
# Introduction
|
# Introduction
|
||||||
|
|
||||||
Welcome to the Kittn API! You can use our API to access Kittn API endpoints, which can get information on various cats, kittens, and breeds in our database.
|
Danbulant API is a wrapper around all of APIs available at danbulant.eu.
|
||||||
|
Most of endpoints currently don't require developer key, but for future use, we suggest still getting one. You won't do anything bad if you try to reach a free endpoint with developer key. You can contact us [here](https://discord.gg/dZtq4Qu) on our discord server to get information about getting one.
|
||||||
We have language bindings in Shell, Ruby, Python, and JavaScript! You can view code examples in the dark area to the right, and you can switch the programming language of the examples with the tabs in the top right.
|
|
||||||
|
|
||||||
This example API documentation page was created with [Slate](https://github.com/lord/slate). Feel free to edit it and use it as a base for your own API's documentation.
|
|
||||||
|
|
||||||
# Authentication
|
|
||||||
|
|
||||||
> To authorize, use this code:
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
require 'kittn'
|
|
||||||
|
|
||||||
api = Kittn::APIClient.authorize!('meowmeowmeow')
|
|
||||||
```
|
|
||||||
|
|
||||||
```python
|
|
||||||
import kittn
|
|
||||||
|
|
||||||
api = kittn.authorize('meowmeowmeow')
|
|
||||||
```
|
|
||||||
|
|
||||||
```shell
|
|
||||||
# With shell, you can just pass the correct header with each request
|
|
||||||
curl "api_endpoint_here"
|
|
||||||
-H "Authorization: meowmeowmeow"
|
|
||||||
```
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
const kittn = require('kittn');
|
|
||||||
|
|
||||||
let api = kittn.authorize('meowmeowmeow');
|
|
||||||
```
|
|
||||||
|
|
||||||
> Make sure to replace `meowmeowmeow` with your API key.
|
|
||||||
|
|
||||||
Kittn uses API keys to allow access to the API. You can register a new Kittn API key at our [developer portal](http://example.com/developers).
|
|
||||||
|
|
||||||
Kittn expects for the API key to be included in all API requests to the server in a header that looks like the following:
|
|
||||||
|
|
||||||
`Authorization: meowmeowmeow`
|
|
||||||
|
|
||||||
<aside class="notice">
|
|
||||||
You must replace <code>meowmeowmeow</code> with your personal API key.
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
# Kittens
|
|
||||||
|
|
||||||
## Get All Kittens
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
require 'kittn'
|
|
||||||
|
|
||||||
api = Kittn::APIClient.authorize!('meowmeowmeow')
|
|
||||||
api.kittens.get
|
|
||||||
```
|
|
||||||
|
|
||||||
```python
|
|
||||||
import kittn
|
|
||||||
|
|
||||||
api = kittn.authorize('meowmeowmeow')
|
|
||||||
api.kittens.get()
|
|
||||||
```
|
|
||||||
|
|
||||||
```shell
|
|
||||||
curl "http://example.com/api/kittens"
|
|
||||||
-H "Authorization: meowmeowmeow"
|
|
||||||
```
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
const kittn = require('kittn');
|
|
||||||
|
|
||||||
let api = kittn.authorize('meowmeowmeow');
|
|
||||||
let kittens = api.kittens.get();
|
|
||||||
```
|
|
||||||
|
|
||||||
> The above command returns JSON structured like this:
|
|
||||||
|
|
||||||
```json
|
|
||||||
[
|
|
||||||
{
|
|
||||||
"id": 1,
|
|
||||||
"name": "Fluffums",
|
|
||||||
"breed": "calico",
|
|
||||||
"fluffiness": 6,
|
|
||||||
"cuteness": 7
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"name": "Max",
|
|
||||||
"breed": "unknown",
|
|
||||||
"fluffiness": 5,
|
|
||||||
"cuteness": 10
|
|
||||||
}
|
|
||||||
]
|
|
||||||
```
|
|
||||||
|
|
||||||
This endpoint retrieves all kittens.
|
|
||||||
|
|
||||||
### HTTP Request
|
|
||||||
|
|
||||||
`GET http://example.com/api/kittens`
|
|
||||||
|
|
||||||
### Query Parameters
|
|
||||||
|
|
||||||
Parameter | Default | Description
|
|
||||||
--------- | ------- | -----------
|
|
||||||
include_cats | false | If set to true, the result will also include cats.
|
|
||||||
available | true | If set to false, the result will include kittens that have already been adopted.
|
|
||||||
|
|
||||||
<aside class="success">
|
|
||||||
Remember — a happy kitten is an authenticated kitten!
|
|
||||||
</aside>
|
|
||||||
|
|
||||||
## Get a Specific Kitten
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
require 'kittn'
|
|
||||||
|
|
||||||
api = Kittn::APIClient.authorize!('meowmeowmeow')
|
|
||||||
api.kittens.get(2)
|
|
||||||
```
|
|
||||||
|
|
||||||
```python
|
|
||||||
import kittn
|
|
||||||
|
|
||||||
api = kittn.authorize('meowmeowmeow')
|
|
||||||
api.kittens.get(2)
|
|
||||||
```
|
|
||||||
|
|
||||||
```shell
|
|
||||||
curl "http://example.com/api/kittens/2"
|
|
||||||
-H "Authorization: meowmeowmeow"
|
|
||||||
```
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
const kittn = require('kittn');
|
|
||||||
|
|
||||||
let api = kittn.authorize('meowmeowmeow');
|
|
||||||
let max = api.kittens.get(2);
|
|
||||||
```
|
|
||||||
|
|
||||||
> The above command returns JSON structured like this:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"name": "Max",
|
|
||||||
"breed": "unknown",
|
|
||||||
"fluffiness": 5,
|
|
||||||
"cuteness": 10
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
This endpoint retrieves a specific kitten.
|
|
||||||
|
|
||||||
<aside class="warning">Inside HTML code blocks like this one, you can't use Markdown, so use <code><code></code> blocks to denote code.</aside>
|
|
||||||
|
|
||||||
### HTTP Request
|
|
||||||
|
|
||||||
`GET http://example.com/kittens/<ID>`
|
|
||||||
|
|
||||||
### URL Parameters
|
|
||||||
|
|
||||||
Parameter | Description
|
|
||||||
--------- | -----------
|
|
||||||
ID | The ID of the kitten to retrieve
|
|
||||||
|
|
||||||
## Delete a Specific Kitten
|
|
||||||
|
|
||||||
```ruby
|
|
||||||
require 'kittn'
|
|
||||||
|
|
||||||
api = Kittn::APIClient.authorize!('meowmeowmeow')
|
|
||||||
api.kittens.delete(2)
|
|
||||||
```
|
|
||||||
|
|
||||||
```python
|
|
||||||
import kittn
|
|
||||||
|
|
||||||
api = kittn.authorize('meowmeowmeow')
|
|
||||||
api.kittens.delete(2)
|
|
||||||
```
|
|
||||||
|
|
||||||
```shell
|
|
||||||
curl "http://example.com/api/kittens/2"
|
|
||||||
-X DELETE
|
|
||||||
-H "Authorization: meowmeowmeow"
|
|
||||||
```
|
|
||||||
|
|
||||||
```javascript
|
|
||||||
const kittn = require('kittn');
|
|
||||||
|
|
||||||
let api = kittn.authorize('meowmeowmeow');
|
|
||||||
let max = api.kittens.delete(2);
|
|
||||||
```
|
|
||||||
|
|
||||||
> The above command returns JSON structured like this:
|
|
||||||
|
|
||||||
```json
|
|
||||||
{
|
|
||||||
"id": 2,
|
|
||||||
"deleted" : ":("
|
|
||||||
}
|
|
||||||
```
|
|
||||||
|
|
||||||
This endpoint deletes a specific kitten.
|
|
||||||
|
|
||||||
### HTTP Request
|
|
||||||
|
|
||||||
`DELETE http://example.com/kittens/<ID>`
|
|
||||||
|
|
||||||
### URL Parameters
|
|
||||||
|
|
||||||
Parameter | Description
|
|
||||||
--------- | -----------
|
|
||||||
ID | The ID of the kitten to delete
|
|
||||||
|
|
||||||
Loading…
Reference in a new issue