Gets interesting info about the gate. If you send a &quot;Accept: application/json&quot; header, you'll get a status object, which is currently:

<pre class="json"> {

<pre class="json"> {

Line 32:

Line 38:

}</pre>

}</pre>

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.

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.

+

+

If you send a &quot;Accept: text/html&quot; header (as web browsers do), it will return with some useful gate web forms, including one for opening the door with a keycode, and another for getting a new keycode.

=== POST /gate/ ===

=== POST /gate/ ===

Line 44:

Line 52:

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.

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.

+

+

''Note: Jake asked me to (temporarily?) disable this, so I have''

+

+

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

+

+

Requires comment=[contact email address for new number]

+

+

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'

When you're ready to deploy, commit the code, then pull it out to the runningversion of api.py.

+

python api.py --debug

+

</source>

+

When you're ready to deploy, change the Debian changelog in debian/changelog (the [http://honk.sigxcpu.org/projects/git-buildpackage/manual-html/gbp.man.git.dch.html git-dch] program can help with this), and commit the code to the github repository..

+

+

Log onto minotaur, clone the git repository, and make a Debian package. Install it using dpkg -i

−

<source lang="bash"> cd /var/local/noise_api/

+

<source lang="bash">

−

sudo git pull [your cloned directory goes here]

+

git clone git://github.com/noisebridge/noise-api.git

−

sudo make install</source>

+

cd noise-api

+

make package

+

sudo dpkg -i ../noisebridge-api_0[whatever the version number is]*.deb

Gets interesting info about the gate. If you send a "Accept: application/json" header, you'll get a status object, which is 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.

If you send a "Accept: text/html" header (as web browsers do), it will return with some useful gate web forms, including one for opening the door with a keycode, and another for getting a new keycode.

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.