How to create, read, update and delete booleans using https://api.booleans.io.
Create a token to get started.
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.
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.
View your new boolean at https://booleans.io/[id]
Gets authenticated user's booleans (authenticated)
curl https://api.booleans.io --header "Authorization: Token [token]"
Responds with an array of boolean objects.
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.
Deletes a boolean (authenticated)
curl -X DELETE https://api.booleans.io/[id] --header "Authorization: Token [token]
Responds with 204 No Content
if successful.
Use groups to organize related booleans together.
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.
View your new group at https://booleans.io/groups/[id]
Gets a group of booleans
curl https://api.booleans.io/groups/[group_id]
Responds with a boolean group.
Gets authenticated user's groups(authenticated)
curl https://api.booleans.io/groups
Responds with an array of boolean groups.
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.
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.
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.
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.
{ "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!" }
{ "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"] }
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"