.

We're ready

The first (read-only) functions are here!

Take the events you inserted on encaleo, show them on your website, export them to your own events-portal (read here about the open event-exchange format, we created) or roll out a newsfeed for your visitors.
All this can be accomplished using the, according to our developers, most easy to use standards like REST and JSON.
For now, we only offer basic functionality (but will expand), and the sdk is only available for Php, but you can make the requests in any language that supports http-requests and sha256 hmac-hashing.
Later on, we will offer a Javascript-Sdk for embedding maps and probably server-sdk's in other languages as well.
So, here are some steps for getting started:

  1. First, grab the Sdk for Php from our Server
  2. Create an Api-Key for the Channel you want to use (in the administration, select a Channel, then, at the bottom left, you will see a button labeled "Api")
  3. Include / import the Encaleo.php file in your project and instanciate the Encaleo-class
  4. Use the setter methods for setting the appid and the app-secret (setAppid & setSecret)
  5. Set the locale you want to use (for the moment, three are available: en_us, it_it and de_de)
  6. Use the get()-method to make calls to our api, you can also use the helper-methods (for now: getChannelEvents() and getEvent() to faciliate the process.
  7. You will get a Php-Array (converted from json) wich is compatible to our exchange-format

Requests

Requests can be made with any serverside language of your choice wich supports sha256 hmac-hashing, but at the moment we offer only a Php-Sdk.
Each request consists of:

All requests have to be signed using sha256 hmac-hashing with your secret app-key to verify that you are the owner of this channel.
Parameters are, if it is a GET-request, always passed as query string.


Api

Here you can find the description of the common options as well as all the functions we offer.

Common options

These are common settings, wich can be used in most of our functions, since they are global settings wich affect all areas of encaleo, mainly these are language settings and similar options.

appid
The App-Id you find in the application management inside the encaleo administration. [Mandatory parameter!]
sign
The signature of the current request. This is calculated through the current request address and the secret app-key. [Mandatory parameter!]
locale
This is the locale that will be used, at the moment only three languages are supported: en_us, de_de and it_it, more languages will be added soon. Default: none
useFallbackLocales
If set to 1, events that are not available in the selected language will return the next translation available, if set to 0, only events in the current language are returned. Default: 1
fallbackLocale
Set this to one of the available locales if you have for instance a cms, wich contains languages that are not supported by encaleo, so if the current language is not supported, this locale will be used instead. Default: none

Api-methods

These are the methods you can call

events/channelEvents

Description: This method gets the events from the channel, wich is identified by the appid. You will get a php-array containing all the events that match your query.

Possible parameters:

start
Filter events by setting a start-date, Datetime-format: yyyy-mm-dd hh:ii
end
Filter events with an end-date, Datetime-format: yyyy-mm-dd hh:ii
category
You can filter the events by one or multiple categories, you need to pass the categories divided with semicolons. If you want to get all the categories, you can call the events/categories function.

Code example (with helper method):
<?php
    $events = $encaleo->getChannelEvents(array(
        'start' => date('Y-m-d H:i'),
        'end' => date('Y-m-d H:i', strtotime('+30 days')),
        'category' => 'parties;education'
    ));
?>
Code example (no helper method):
<?php
    $events = $encaleo->get('events/channelEvents', array(
        'start' => date('Y-m-d H:i'),
        'end' => date('Y-m-d H:i', strtotime('+30 days')),
        'category' => 'parties;education'
    ));
?>

events/view/$id

Description: This method gets a single event from a channel. The $id is the unique id of the event you like to query. If you want to read more about how to generate the id, continue here.

Code example (with helper method):
<?php
    $events = $encaleo->getEvent($eventId);
?>
Code example (no helper method):
<?php
    $events = $encaleo->get('events/view/'.$eventId);
?>

events/categories

Description: This method returns all the available event categories, only the locale parameter is available. Note that the alias (wich is the field you need to pass when filtering events) is not multilingual.

Code example (with helper method):
<?php
    $categories = $encaleo->getEventCategories();
?>
Code example (no helper method):
<?php
    $categories = $encaleo->get('events/categories');
?>

channels/view

Description: This method gets the channel, wich is tied to the current appid.

Code example (with helper method):
<?php
    $events = $encaleo->getChannel();
?>
Code example (no helper method):
<?php
    $events = $encaleo->get('channels/view);
?>

events/eventlist/$id

Description: This method gets events that are on a event-list (the owner must be the owner of the channel, the api-key is bound to). The $id is the eventlist-id, you can see it in the eventlist-index page (ID: $id before the delete-button).
Note that you can only get event-lists from management-users (with a valid api-key from one of his channels).

Possible parameters:

start
Filter events by setting a start-date, Datetime-format: yyyy-mm-dd hh:ii
end
Filter events with an end-date, Datetime-format: yyyy-mm-dd hh:ii
selected
In the eventlist administration you can select events that will be exported via api, if you set this option to 1, only those events will be returned, otherwise you get all events.

Code example (with helper method):
<?php
    $events = $encaleo->getEventlist($id);
?>
Code example (no helper method):
<?php
    $events = $encaleo->get('events/eventlist/$id');
?>