wanderer edited this page Jun 12, 2013 · 28 revisions

test

Event Timeline

The event timeline is a chronilogical list of events that can be filtered by varous methods.

Resource URL GET: api/events

returns JSON array of events

  • Example Gets 10 events modified after 2010-10-15T02:43:55.077Z starting at the 30th event before the current time api/events?n=10&offset=-30&modified=2010-10-15T02:43:55.077Z

  • Parameters

Parameter Format Description
start ISO 8601 The date time of where you like to start fecthing events. If start is not specified then the current time is used.
modified ISO 8601 Fetches events modified after the specified time. The the date time must be ISO 8601 format
offset integer The number of events to skip after start. Defaults to 0
n integer The number of events you would like. Defaults to 20
user string filter events by the user that posted them
group integer select only events in a certain group selected by its id
complete Boolean Select incomplete or complete events. Incomplete events sometime result from importing events from external datasources. Defaults to true
bbox select events within a bounding box. Format is [upper left latitude, upper left longitude, lower right latitude, lower right longitude]

Event

Resource URL GET: api/event/<id>

Finds a event by its id. Returns the event in the following format

  • Event Schema
Parameter Format Description
id integer the event's id
slug string the title of the event in a unique url safe slug
title string the title of the event
start_date ISO 8601 the date and time of the beginning of the event
end_date ISO 8601 the date and time of the end of the event
address string the address of the event
venue string the venue that the event is in
content string the description of the event
city string what city is the event in
link string a link to a page related to this event
location_point geoJson Point the longitude and latitude of the event
start_date_index Integer If there exists multiple events with the same start date and time this index will be used to indication what the event order should be. This way events ordered by date can stay constant across all platforms. It also take into account the end date
groups Array [{group_id:id,group_name:name}] a list of groups that the events is in

Resource URL POST: api/event

Creates a new event.

  • Parameters
Parameter Format Description
title required string the title of the event
start_date required ISO 8601 the date and time of the beginning of the event
end_date ISO 8601 the date and time of the end of the event
address string the address of the event
venue string the venue that the event is in
content required string the description of the event
city string what city is the event is in
latrequired float the latitude of the event
lngrequired float the longitude of the event

Resource URL PUT: api/event/<id>

Modifies an event. If successful returns the modified event schema.

Resource URL DELETE: api/event/<id>

Deletes an event.

Resource URL GET: api/event/slug/<slug>

Fetches an event given a slug. If successful returns an event.

Resource URL PUT: api/event/slug/<slug>

Modifies an event. If successful returns an event

Resource URL DELETE: api/event/slug/<slug>

Deletes an event.

Groups

Resource URL GET: api/group/<id>

  • Parameters
Parameter Format Description
id string the groups title
title string the groups title
description string the groups description
visibility string the groups visibility ["public", "private"]
group_type string the groups type ["usergroup", "eventgroup", "feedgroup"]
posting_permissions string ["open" (anyone can post events to this group), "closed" (only admins can post events to this group),"queue"(events go to admin queue)]
subscriptions string an array for groups that this group subscribes to
subscribed boolean is the current user subscribed to this group?

Resource URL POST: api/group

Creates a new group.

  • Parameters
Parameter Format Description
title required string the groups title
description required string the groups description
visibility string [public / private] the groups visibility
posting_permissions optional string ["open" (anyone can post events to this group), "closed" (only admins can post events to this group),"queue"(events go to admin queue)]

Resource URL PUT: api/group/<id>

Modify a group

Resource URL DELETE: api/group/<id>

Delete a group

Resource URL GET: api/group/slug/<slug>

Get an event by its slug

Resource URL PUT: api/group/slug/<slug>

modify an group by its slug

Resource URL DELETE: api/group/slug/<slug>

delete a group by its slug

User

Resource URL POST: api/user

Create a new user. Returns a new session

  • parameters
Parameter Format Description
username string
password required string
email required string

Session

Resource URL GET: api/session

check the users status and we need to send the csrf cookie.

  • Parameters
Parameter Format Description
id string the users id
username required string the username
admin_groups required string An array of groups that the users has admin permission to
authenticated required Boolean is the user authenticated?

Resource URL POST: api/session

create a new session returns the session if successful. Returns a new session

  • Parameter
Parameter Format Description
username string the users id
password required string the username

Resource URL DELETE: api/session

Logout

Subscription

Resource URL POST: api/subscription

create a new subscription

  • Parameters
Parameter Format Description
subscribee string the id of the group being subscribed too
subscriber required string the id of the group that is subscribing

Resource URL DELETE: api/subscription/<id>

delete an subscription

Save

Resource URL POST: api/save

Parameter Format Description
group string the group id that you are adding the event to
event string the event id

Permissions

Resource URL POST: api/permissions

create a permission for a user for a given group

Parameter Format Description
user string the group id that you are adding the event to
group string the group id that you are adding the event to
permission string the name of the permission granted ["group_admin", "write", "read"]

Resource URL DELETE: api/permissions/<group_id>/<user_id>

Delete a permission

Clone this wiki locally
You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.
Press h to open a hovercard with more details.