NAV Navbar
javascript shell

Introduction

The Ideea Public API is the API for the Ideea Platform.

const Ideea = require('ideea-js');

let ideea = new Ideea('YOUR API KEY');

Login

To get a new access token:

ideea.login('[email protected]', 'password').then(token => {

  console.log(token.access_token);

}).catch(err => console.error(err))
curl 'http://api.ideea.io/api/v1/auth/login' \
  -H 'Content-Type: application/json;charset=UTF-8' \
  --data-binary '{"email":"[email protected]","password":"password"}' --compressed

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.

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

Groups

Get Group

require 'kittn'

api = Kittn::APIClient.authorize!('meowmeowmeow')
api.kittens.get
curl "http://example.com/api/kittens"
  -H "Authorization: meowmeowmeow"

The above command returns JSON structured like this:

[
  {
    "id": 1,
    "name": "Fluffums",
    "breed": "calico",
    "fluffiness": 6,
    "cuteness": 7
  },
  ...
]

This endpoint retrieves all kittens.

HTTP Request

GET https://api.ideea.io/api/v1/groups/{group_id}

Request Payload

Parameter Required Description
name false Update the name of ths group

Update Group

const kittn = require('kittn');

let api = kittn.authorize('meowmeowmeow');
let max = api.kittens.get(2);
curl "http://example.com/api/kittens/2"
  -H "Authorization: meowmeowmeow"

The above command returns JSON structured like this:

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

This endpoint retrieves a specific kitten.

HTTP Request

POST https://api.ideea.io/api/v1/groups/{group_id}

URL Parameters

Parameter Description
ID The ID of the kitten to retrieve

Get Group Users

const kittn = require('kittn');

let api = kittn.authorize('meowmeowmeow');
let max = api.kittens.delete(2);
curl "http://example.com/api/kittens/2"
  -X DELETE
  -H "Authorization: meowmeowmeow"

The above command returns JSON structured like this:

{
  "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

Add User to Group

const kittn = require('kittn');

let api = kittn.authorize('meowmeowmeow');
let max = api.kittens.delete(2);
curl "http://example.com/api/kittens/2"
  -X DELETE
  -H "Authorization: meowmeowmeow"

The above command returns JSON structured like this:

{
  "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

Remove User from Group

const kittn = require('kittn');

let api = kittn.authorize('meowmeowmeow');
let max = api.kittens.delete(2);
curl "http://example.com/api/kittens/2"
  -X DELETE
  -H "Authorization: meowmeowmeow"

The above command returns JSON structured like this:

{
  "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

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.