NAV Navbar
shell ruby python javascript

Introduction

Welcome to the Exein API! You can use our API to access Exein API endpoints, which can get information on various cats, exein, and breeds in our database.

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. Feel free to edit it and use it as a base for your own API's documentation.

Authentication

To authorize, use this code:

require 'exein'

api = Exein::APIClient.authorize!('meowmeowmeow')
import exein

api = exein.authorize('meowmeowmeow')
# With shell, you can just pass the correct header with each request
curl "api_endpoint_here"
  -H "Authorization: meowmeowmeow"
const exein = require('exein');

let api = exein.authorize('meowmeowmeow');

Make sure to replace meowmeowmeow with your API key.

Exein uses API keys to allow access to the API. You can register a new Exein API key at our developer portal.

Exein 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

Exein

Get All Exein

require 'exein'

api = Exein::APIClient.authorize!('meowmeowmeow')
api.exein.get
import exein

api = exein.authorize('meowmeowmeow')
api.exein.get()
curl "http://example.com/api/exein"
  -H "Authorization: meowmeowmeow"
const exein = require('exein');

let api = exein.authorize('meowmeowmeow');
let exein = api.exein.get();

The above command returns JSON structured like this:

[
  {
    "id": 1,
    "name": "Fluffums",
    "breed": "calico",
    "fluffiness": 6,
    "cuteness": 7
  },
  {
    "id": 2,
    "name": "Max",
    "breed": "unknown",
    "fluffiness": 5,
    "cuteness": 10
  }
]

This endpoint retrieves all exein.

HTTP Request

GET http://example.com/api/exein

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 exein that have already been adopted.

Get a Specific Exein

require 'exein'

api = Exein::APIClient.authorize!('meowmeowmeow')
api.exein.get(2)
import exein

api = exein.authorize('meowmeowmeow')
api.exein.get(2)
curl "http://example.com/api/exein/2"
  -H "Authorization: meowmeowmeow"
const exein = require('exein');

let api = exein.authorize('meowmeowmeow');
let max = api.exein.get(2);

The above command returns JSON structured like this:

{
  "id": 2,
  "name": "Max",
  "breed": "unknown",
  "fluffiness": 5,
  "cuteness": 10
}

This endpoint retrieves a specific exein.

HTTP Request

GET http://example.com/exein/<ID>

URL Parameters

Parameter Description
ID The ID of the exein to retrieve

Delete a Specific Exein

require 'exein'

api = Exein::APIClient.authorize!('meowmeowmeow')
api.exein.delete(2)
import exein

api = exein.authorize('meowmeowmeow')
api.exein.delete(2)
curl "http://example.com/api/exein/2"
  -X DELETE
  -H "Authorization: meowmeowmeow"
const exein = require('exein');

let api = exein.authorize('meowmeowmeow');
let max = api.exein.delete(2);

The above command returns JSON structured like this:

{
  "id": 2,
  "deleted" : ":("
}

This endpoint deletes a specific exein.

HTTP Request

DELETE http://example.com/exein/<ID>

URL Parameters

Parameter Description
ID The ID of the exein to delete

Errors

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.