blinKNlights backend API (0.0.1)

Download OpenAPI specification:Download

Controlling the blinKNlights backend

Authentication

slot_token

Security scheme type: API Key
query parameter name: token

godmode_token

Security scheme type: API Key
query parameter name: godmode

player_token

Security scheme type: API Key
query parameter name: playertoken

recaptcha_token

Security scheme type: API Key
query parameter name: recaptcha

godmode

These functions are only available in god mode

slot

Timeslot control

Next free slot

Returns the next free slot start time

Responses

200

successful operation

get /slot
https://api.blinknlights.de/api/slot

Response samples

application/json
Copy
Expand all Collapse all
"2018-12-15T15:17:56Z"

Empty or delete a slot

A previously claimed slot can be emptied or purged (a purged slot can be claimed again)

Authorizations:
query Parameters
start
required
string <date-time> (SlotStart)

Timeslot start. Will be truncated to the time slot interval.

purge
string
Example: "yes"

If set to "yes", the slot is purged, not emptied

Responses

200

successful operation returns "OK"

delete /slot
https://api.blinknlights.de/api/slot

Response samples

application/json
Copy
Expand all Collapse all
"OK"

Get a list of all claimed slots

Return an array of time strings of all claimed slots within the next 48 hours.

Responses

200

successful operation

get /claim
https://api.blinknlights.de/api/claim

Response samples

application/json
Copy
Expand all Collapse all
[
  • "2018-12-15T15:17:56Z"
]

Claim a slot

If the slot is free, claim it. The method then returns a token string

Authorizations:
query Parameters
start
required
string <date-time> (SlotStart)

Timeslot start. Will be truncated to the time slot interval.

Request Body schema: application/json
type
string

Type of the slot, "static" or "interaction"

Responses

200

successful operation

post /claim
https://api.blinknlights.de/api/claim

Request samples

application/json
Copy
Expand all Collapse all
{
  • "type": "static"
}

Response samples

application/json
Copy
Expand all Collapse all
"string"

Time slot contents

Return the contents of the time slot (optionally including the actual data)

Authorizations:
query Parameters
start
required
string <date-time> (SlotStart)

Timeslot start. Will be truncated to the time slot interval.

data
string

If "yes" also return the actual data of static slots

Responses

200

successful operation

get /content
https://api.blinknlights.de/api/content

Response samples

application/json
Copy
Expand all Collapse all
{
  • "start": "2018-12-15T15:17:56Z",
  • "approved": true,
  • "token": "string",
  • "slot_datas":
    [
    ],
  • "sources":
    [
    ]
}

Get pending approvals

Get a list of pending approvals (only start times)

Authorizations:

Responses

200

successful operation

get /approve
https://api.blinknlights.de/api/approve

Response samples

application/json
Copy
Expand all Collapse all
[
  • "2018-12-15T15:17:56Z"
]

Approve a time slot

Approve a time slot, this is only required for custom time slots

Authorizations:
query Parameters
start
required
string <date-time> (SlotStart)

Timeslot start. Will be truncated to the time slot interval.

Request Body schema: application/json
approve
boolean

Responses

200

successful operation

post /approve
https://api.blinknlights.de/api/approve

Request samples

application/json
Copy
Expand all Collapse all
{
  • "approve": true
}

Response samples

application/json
Copy
Expand all Collapse all
"string"

static

Handling static slots

Animation list

List all available animations

Responses

200

successful operation

get /animation
https://api.blinknlights.de/api/animation

Response samples

application/json
Copy
Expand all Collapse all
[
  • "string"
]

Animation

Add an animation to the slot

Authorizations:
query Parameters
start
required
string <date-time> (SlotStart)

Timeslot start. Will be truncated to the time slot interval.

limit
number <integer>

Time limit for animated gifs in seconds

Request Body schema: application/json
name
string

Name of the gif, blm or bml animation

Responses

200

successful operation returns "OK"

post /animation
https://api.blinknlights.de/api/animation

Request samples

application/json
Copy
Expand all Collapse all
{
  • "name": "heart.blm"
}

Response samples

application/json
Copy
Expand all Collapse all
"string"

custom

Handing custom slots

Set single frame image

Add a single frame with an optional delay to the slot. This implies a custom time slot which needs to be approved.

Authorizations:
query Parameters
start
required
string <date-time> (SlotStart)

Timeslot start. Will be truncated to the time slot interval.

delay
number <integer>

Delay in ms, defaults to 0

Request Body schema: image/*
string <binary>

Responses

200

Succeccful operation

post /frame
https://api.blinknlights.de/api/frame

Response samples

application/json
Copy
Expand all Collapse all
"string"

Set video sequence

Add a video sequence to the slot. This implies a custom time slot which needs to be approved.

Authorizations:
query Parameters
start
required
string <date-time> (SlotStart)

Timeslot start. Will be truncated to the time slot interval.

limit
number <integer>

Time limit for animated gifs in seconds

Request Body schema:
string <binary>

Responses

200

Successful operation

post /sequence
https://api.blinknlights.de/api/sequence

Response samples

application/json
Copy
Expand all Collapse all
"string"

Set text

Add a text sequence to the slot. This implies a custom time slot which needs to be approved.

Authorizations:
query Parameters
start
required
string <date-time> (SlotStart)

Timeslot start. Will be truncated to the time slot interval.

Request Body schema: application/json
content
Array of string

Array of text lines

lines
number <integer>

Number of lines visible

scrolling
number <integer>

0 means no scrolling (all text on one frame), 1 means left-to-right

delay
number <integer>

Delay between frames in ms

font
string

Font face name, some fonts that are available: hellovetica, cubicfive{10,11,12,18}, Liberation{Mono,Sans,SansNarrow,Serif}-{Regular,Bold,BoldItalic,Italic}, pixelsix00, squaredance{00,01,03,10}

color
Array of number <integer>

r,g,b byte values (0-255) for the text color

background
Array of number <integer>

r,g,b byte values (0-255) for the background

Responses

200

Successful operation

post /text
https://api.blinknlights.de/api/text

Request samples

application/json
Copy
Expand all Collapse all
{
  • "content":
    [
    ],
  • "lines": 0,
  • "scrolling": 0,
  • "delay": 0,
  • "font": "string",
  • "color":
    [
    ],
  • "background":
    [
    ]
}

Response samples

application/json
Copy
Expand all Collapse all
"string"

Set tweet search terms

Add a text sequence to the slot which show tweets for the set search terms (at the time of submitting). This implies a custom time slot which needs to be approved.

Authorizations:
query Parameters
start
required
string <date-time> (SlotStart)

Timeslot start. Will be truncated to the time slot interval.

Request Body schema: application/json
hashtags
Array of string

Array of search terms

delay
number <integer>

Delay between frames in ms

font
string

Font face name, some fonts that are available: hellovetica, cubicfive{10,11,12,18}, Liberation{Mono,Sans,SansNarrow,Serif}-{Regular,Bold,BoldItalic,Italic}, pixelsix00, squaredance{00,01,03,10}

color
Array of number <integer>

r,g,b byte values (0-255) for the text color

background
Array of number <integer>

r,g,b byte values (0-255) for the background

language
string

Preferred language, only de or en.

Responses

200

Successful operation

post /tweet
https://api.blinknlights.de/api/tweet

Request samples

application/json
Copy
Expand all Collapse all
{
  • "hashtags":
    [
    ],
  • "delay": 0,
  • "font": "string",
  • "color":
    [
    ],
  • "background":
    [
    ],
  • "language": "string"
}

Response samples

application/json
Copy
Expand all Collapse all
"string"

interaction

Handling interactions

Set an interaction slot

Define the type of the interaction by name. Currently, the following interactions are supported: "pong", "tetris", "pacman", "spectrum", and, requiring godmode, "doodle" and "tweet"

Authorizations:
query Parameters
start
required
string <date-time> (SlotStart)

Timeslot start. Will be truncated to the time slot interval.

Request Body schema: application/json
name
string

Name of the interaction to be used

Responses

200

successful operation returns a player token

post /interaction
https://api.blinknlights.de/api/interaction

Request samples

application/json
Copy
Expand all Collapse all
{
  • "name": "pong"
}

Response samples

application/json
Copy
Expand all Collapse all
"string"

Join interaction

This request will be upgraded to a websocket connection

path Parameters
interactionName
required
string

The name of the interaction

query Parameters
start
required
string <date-time> (SlotStart)

Timeslot start. Will be truncated to the time slot interval.

Responses

200

Connection is upgraded to a websocket connection

get /interaction/{interactionName}
https://api.blinknlights.de/api/interaction/{interactionName}