booleans.io

Create, read, update and delete booleans at https://api.booleans.io.

Endpoints

Booleans

POST /

Creates a boolean (authenticated)

Parameter Required Example
value No true || false
label No "Hello world!"

Basic usage:

curl -X POST https://api.booleans.io --header "Authorization: Token [token]"

With an initial value and label:

curl -X POST https://api.booleans.io --header "Content-Type: application/json" --data '{"value": true, "label": "Hello world!"}' --header "Authorization: Token [token]

Responds with a boolean object.

GET /:id

Gets a boolean

curl https://api.booleans.io/[id]

Responds with a boolean object.

GET /

Gets authenticated user's booleans (authenticated)

curl https://api.booleans.io --header "Authorization: Token [token]"

Responds with an array of boolean objects.

PATCH /:id

Updates a boolean (authenticated)

Parameter Required Example
value No true || false
label No "Hello world!"
curl -X PATCH https://api.booleans.io/[id] --header "Content-Type: application/json" --data '{"value": true, "label": "Hello world!"}' --header "Authorization: Token [token]

Responds with a boolean object.

DELETE /:id

Deletes a boolean (authenticated)

curl -X DELETE https://api.booleans.io/[id] --header "Authorization: Token [token]

Responds with 204 No Content if successful.

Groups

POST /groups

Creates a boolean group (authenticated)

Parameter Required Example
booleans No ["4ee4b8f7-8d31-4ae2-93b0-554e19af740d", "ff983713-dbc6-4068-a7b8-37bb462d41c1"]
label No "My bools"

Basic usage:

curl -X POST https://api.booleans.io/groups --header "Authorization: Token [token]"

Populating with booleans and a label during initial creation:

curl -X POST https://api.booleans.io/groups --header "Content-Type: application/json" --data '{"label": "My bools", "booleans": ["4ee4b8f7-8d31-4ae2-93b0-554e19af740d", "ff983713-dbc6-4068-a7b8-37bb462d41c1"]}' --header "Authorization: Token [token]

Responds with a boolean group.

GET /groups/:group_id

Gets a group of booleans

curl https://api.booleans.io/groups/[group_id]

Responds with a boolean group.

GET /groups

Gets authenticated user's groups(authenticated)

curl https://api.booleans.io/groups

Responds with an array of boolean groups.

PUT /groups/:group_id/booleans/:boolean_id

Adds a boolean to a group (authenticated)

curl -X PUT https://api.booleans.io/groups/[group_id]/booleans/[boolean_id] --header "Authorization: Token [token]

Responds with a boolean group.

PATCH /groups/:group_id

Updates a group (authenticated)

Parameter Required Example
booleans No ["4ee4b8f7-8d31-4ae2-93b0-554e19af740d", "ff983713-dbc6-4068-a7b8-37bb462d41c1"]
label No "My bools"
curl -X PATCH https://api.booleans.io/groups/[group_id] --header "Content-Type: application/json" --data '{"label": "My bools", "booleans": ["4ee4b8f7-8d31-4ae2-93b0-554e19af740d", "ff983713-dbc6-4068-a7b8-37bb462d41c1"]}' --header "Authorization: Token [token]

Responds with a boolean group.

DELETE /groups/:group_id/booleans/:boolean_id

Deletes a boolean from a group (authenticated)

curl -X DELETE https://api.booleans.io/groups/[group_id]/booleans/[boolean_id] --header "Authorization: Token [token]

Responds with 204 No Content if successful.

DELETE /groups/:group_id

Deletes a group (authenticated)

curl -X DELETE https://api.booleans.io/groups/[group_id] --header "Authorization: Token [token]

Responds with 204 No Content if successful.

Tokens

POST /tokens

Creates a token

curl -X POST https://api.booleans.io/tokens

Responds with a token you can use to create, update and delete booleans.

{
  "token": "cd0820d0-27e6-4c89-ba38-60e6188fcb8c"
}

Treat this like a password and keep it in a safe place. It is recommended to use a single token for all your booleans.

Boolean object

{
  "id": "4ee4b8f7-8d31-4ae2-93b0-554e19af740d",
  "created_at": "2018-11-24 14:56:26",
  "updated_at": "2018-11-24 14:57:43",
  "value": true,
  "label": "Hello world!"
}

Boolean group

{
  "id": "9a2a3b95-bbf6-46ca-bb0d-892ae12d54d5",
  "label": "My bools",
  "created_at": "2018-11-24 14:56:26",
  "updated_at": "2018-11-24 14:57:43",
  "booleans": ["4ee4b8f7-8d31-4ae2-93b0-554e19af740d", "ff983713-dbc6-4068-a7b8-37bb462d41c1"]
}

Authentication

Authenticated endpoints require a token sent in the request headers: Authentication: Token [token]

curl -X POST https://api.booleans.io --header "Authorization: Token fb8c4450-52cb-4dbd-b725-14a0a5213834"