airOut - Developers
To authenticate with LairOut API, you have to sign up with your user or create an account.
Once you are logged in LairOut, go under your user settings, and at the bottom of the page click 'Enable API'.
This will generate an authentication token (API authentication); on that page you will also have to fill in the website URL that you will use to display or insert events from.
LairOut API Terms of Service are available here: Terms of Service
Each API transaction is logged on LairOut system.
You can review your transaction on this page: API Transactions
The response format is based on the dot extension format. There are three possible response formats:
| Action | End Point | HTTP method |
| Download Events | /api/1/events.xml | GET |
| Upload Events | /api/1/events.xml | POST |
| Delete Events | /api/1/events.xml | DELETE |
End point "/api/1/events.xml", HTTP method GET.
The result events are ordered by start date; the first event starting will be the first one returned.
Note: the API only returns current events, past events are not available using the API.
Example of request: https://www.lairout.com/api/1/events.json?token=TOKEN&locality=wellington%20new%20zealand
You will need to provide at least one of these combination:
You can filter by start date and end date. If not provided, start date will be the current date, and end date will be 1 month from the start date.
This is the list of available categories:
User id of the creator of the event. You can check your user id under your api settings page.
You can specify the number of events to be returned: minimun is 1, maximum is 10; the default is 10.
Example:
<?xml version="1.0" encoding="UTF-8"?>
<events type="array">
<event>
<description>description...</description>
<url>http://www.lairout.com/events/10</url>
<starts-on>27 Feb 2013, 08:50pm</starts-on>
<ends-on>06 Mar 2013, 08:50pm</ends-on>
<photo></photo>
<small-photo></small-photo>
<id type="integer">10</id>
<category>Concert</category>
<name>one</name>
<address>address</address>
<latitude type="float">-41.2858276</latitude>
<longitude type="float">174.7297211</longitude>
</event>
<event>
<description>description</description>
<url>http://www.lairout.com/events/11</url>
<starts-on>27 Feb 2013, 08:50pm</starts-on>
<ends-on>06 Mar 2013, 08:50pm</ends-on>
<photo></photo>
<small-photo></small-photo>
<id type="integer">11</id>
<category>FLASH MOB</category>
<name>name event</name>
<address>somehwre</address>
<latitude type="float">-41.2858276</latitude>
<longitude type="float">174.7297211</longitude>
</event>
</events>
End point "/api/1/events.xml" , HTTP method POST, Content Type: application/xml
Be aware that you cannot upload more than 10 events per HTTP call, otherwise an error will be returned.
Note: you can only upload current or future events, the API does not allow to upload past events.
Additional parameters for recurring events:
This is the list of available categories:
You can only upload current or future events.
Different categories have different duration limitations. If the event is out of range, you will receive a validation error in the response.
The address where the event will occur.
If you do not provide latitude and longitude, those will be calculated by the provided address using an external webservice. If the coordinates cannot be calculated,
you will receive a validation error and you will have to provide the coordinates manually.
Long description of the event. It doesn't have any restriction in terms of length/number of characters.
A string or an unique reference that you might want to specify to identify your events uploaded on LairOut.
This field is not compolsury, but we recommend you set.
If you upload twice the event with this same reference, the event will be updated.
Also this reference allows you to delete events if you have to.
We strongly recommend that you set this parameter.
If serie is specified, the event will be marked as recurring, and all recurring events will be created.
The response will include all the events created for the serie.
Serie takes 2 parameters: ends_on and frequency.
The list of supported frequency is the follow:
Example of request:
<?xml version="1.0"?>
<events>
<event>
<name>Api 1</name>
<category>conference</category>
<starts_on>01/01/2016</starts_on>
<ends_on>05/01/2016</ends_on>
<description>Api 1</description>
<address>via test germany</address>
<serie>
<frequency>yearly</frequency>
<ends_on>01/01/2020</ends_on>
</serie>
</event>
</events>
Example:
<?xml version="1.0" encoding="UTF-8"?> <events type="array"> <event> <description>Api description</description> <url>http://www.lairout.com/events/12</url> <starts-on>21 Feb 2013, 08:43am</starts-on> <ends-on>28 Feb 2013, 08:43am</ends-on> <photo></photo> <small-photo></small-photo> <id type="integer">12</id> <category>Conference</category> <name>Api 1</name> <address>test street germany</address> <latitude type="float">45.70572621000001</latitude> <longitude type="float">9.686958250000002</longitude> <serie-id type="integer">19</serie-id> <api-transaction-id type="integer">69</api-transaction-id> <errors type="array"/> <reference>my reference</reference> </event> </events>
End point "/api/1/events.xml", HTTP method DELETE, Content Type: application/xml
Be aware that you cannot delete more than 10 events per HTTP call, otherwise an error will be returned.
Note: you can only delete current or future events, the API does not allow to delete past events.
A string or an unique reference that you might want to specify to identify your events uploaded on LairOut.
Example of request:
<?xml version="1.0"?>
<events>
<event>
<reference>my reference</reference>
</event>
</events>
Example:
<?xml version="1.0" encoding="UTF-8"?> <events type="array"> <event> <reference>my reference</reference> </event> </events>
The map widget allows you to 'iframe' LairOut map with locality specified and some extra parameters (start date and end date of the events).
You can click the top right controller on the map on the home page to try out the simple version of the widget; the url generated reflects the actual bounding box of the map and the date filters.
The widget offers also extra more advanced options, explained here (see sections below).
<iframe width="425" height="350" frameborder="0" scrolling="no" marginheight="0" marginwidth="0" src="http://www.lairout.com/embed/?bbox=40.14318974292438,-75.135498046875,41.261291493919884,-72.18292236328125&starts_on=07-02-2013&ends_on=08-03-2013"></iframe><br/><small><a href="http://www.lairout.com" style="color:#970000;text-align:left" target="_blank">View LairOut Fullsite</a></small>
You can pass 'locality' parameter to the map widget url; in this case the server will do an external webservice to a third party service geocoding request, matching the first result of the string passed as locality.
We cannot guarantee that the response if exactly what you were looking for.
Example: http://www.lairout.com/embed/?locality=New%20York
Alternatevely, you can pass the coordinates of the point of interest. The widget uses a default zoom level for this kind of request.
The parameters in this case are: lat / lon
Example: http://www.lairout.com/embed/?lat=40.14318974292438&lon=-75.135498046875
You can alternatevely pass a bounding box parameter.
Example: http://www.lairout.com/embed/40.14318974292438,-75.135498046875,41.261291493919884,-72.18292236328125
You can also specify two extra parameters: starts_on and ends_on.
Those will apply filtering on the event, selecting only the ones that happen in this range of dates selected.
If not specified, the start date will be the current day, and the end date will be +1 month.
If you specify a range that is not at least 1 month, this will be overriden with the default +1 month from the starts_on parameter.