If you'd like things to use your hardware in the space in a fairly consistent way, consider exposing them to Noisebridge's awesome, semi-stable API. You can ask [[User:Malaclyps Danny]] to implement you a call or two by mailing him at [mailto:danny@spesh.com]

+

= API for Noisebridge =

+

This is a very simple Python WSGI App that provides a RESTful API for fun things in the Noisebridge space.

−

== Current API ==

+

In the Noisebridge tradition, it's not stable! It will, however try to break in as noisy a way as possible if things change.

−

=== POST http://api.noisebridge.net/gate/open ===

+

== Using the API ==

−

Buzzes open the gate at 2169 Mission (only available within the space).

+

The API is currently only available within the space. Once we have authorisation running, this will change.

Where 'ringing' is true if the gate buzzer is ringing at that moment, or in the last few seconds, as users may push the button for a very short time. The amount of time that this state is cached is totally up to the Gateman daemon that runs to interact with the gate hardware.

+

+

=== POST /gate/ ===

+

+

With open=True, opens the door. Returns a 300 error if unsuccessful, and the following additions to the /gate/ stats if successful:

+

+

<pre class="json"> {

+

open : True

+

message: string

+

}</pre>

+

With key=XXXX, will optionally check the key against the door code list.

+

+

Note that this isn't a required field. Currently if you omit the key field, the door will always open. It's intended to optionally allow other apps to offer the same door code authentication that we use for the phone booth entry.

+

+

=== POST /gate/key/[doorcode] ===

+

+

With create=True and an existing, valid doorcode, redirects to a URL of the form /gate/key/[newdoorcode] which gives a valid new doorcode to open the door.

+

+

With preferred=[number] you can suggest a doorcode you'd like to use. It's not guaranteed that the preferred option will be returned.

+

+

Suppose you have a doorcode 8499146, and you'd like to give a friend a new doorcode. She asks if she can have the number '7895473'

GET /hello/[name]

GET /spaceapi/

GET /gate/

Gets interesting stats about the gate. Currently:

{
ringing: boolean
}

Where 'ringing' is true if the gate buzzer is ringing at that moment, or in the last few seconds, as users may push the button for a very short time. The amount of time that this state is cached is totally up to the Gateman daemon that runs to interact with the gate hardware.

POST /gate/

With open=True, opens the door. Returns a 300 error if unsuccessful, and the following additions to the /gate/ stats if successful:

{
open : True
message: string
}

With key=XXXX, will optionally check the key against the door code list.

Note that this isn't a required field. Currently if you omit the key field, the door will always open. It's intended to optionally allow other apps to offer the same door code authentication that we use for the phone booth entry.

POST /gate/key/[doorcode]

With create=True and an existing, valid doorcode, redirects to a URL of the form /gate/key/[newdoorcode] which gives a valid new doorcode to open the door.

With preferred=[number] you can suggest a doorcode you'd like to use. It's not guaranteed that the preferred option will be returned.

Suppose you have a doorcode 8499146, and you'd like to give a friend a new doorcode. She asks if she can have the number '7895473'