API Documentation

Events

/{iid}/events

GET

Retrieve a batched collection of events.

Sample Call

Get events:

>>> GET("/123/events?fields=title-url-issued-thumb_url&order=title&rpp=2")
{'items': [['Event 01 title',
            'https://api.metropublisher.com/123/content/d14d384f-008b-11e0-9c6f-001ec21bff9e',
            '2010-12-05T08:23:00',
            'https://api.metropublisher.com/123/files/f6294df8-9023-3687-865b-af22de234abf/download/1291309162'],
           ['Event 02 title',
            'https://api.metropublisher.com/123/content/d24d384f-008b-11e0-9c6f-001ec21bff9e',
            '2010-12-05T08:23:00',
            None]],
 'next': 'fields=title-url-issued-thumb_url&order=title&page=2&rpp=2'}

Get events issued before December 4th, 2010:

>>> GET("/123/events?fields=title-url-issued&issued=_2010-12-04&rpp=2")
{'items': [['Event 04 title',
            'https://api.metropublisher.com/123/content/799d6c73-fe75-11df-837b-001ec21bff9e',
            '2010-12-02T16:37:00']]}

Get events with occurrences within a specific period:

>>> GET("/123/events?fields=title-dtstart-dtend-rrule&occurring=2010-05-13_2010-05-18")
{'items': [['Event 03 title',
            '2010-05-14T10:00:00',
            '2010-05-14T14:00:00',
            None],
           ['Event 04 title',
            '2010-05-10T10:00:00',
            '2010-05-10T14:00:00',
            {'byday': None,
             'byhour': None,
             'byminute': None,
             'bymonth': None,
             'bymonthday': None,
             'bysecond': None,
             'bysetpos': None,
             'byweekno': None,
             'byyearday': None,
             'count': None,
             'freq': 'WEEKLY',
             'interval': 1,
             'until': None,
             'wkst': None}]]}

Even though the first occurrence of "Event 04" is outside the occurring period, the event is returned because it has an occurrence within the search period due to its recurrence rule.

Parameters

page:

The page number to retrieve.

optional

Default: 1

Values must not be lower than 1

rpp:

The number of results per page.

optional

Default: 20

Values must not be lower than 1 or higher than 100

state:

optional

Default: 'live' if the user is a public user else None.

Example value: "draft"

Values must be any of the following

live:

Only published content with issued dates in the past

published:

Only published

Access is restricted to users with these roles:

draft:

Only draft

Access is restricted to users with these roles:

fields:

A dash-separated list of fields to return.

optional

Default: ['url']

Example value: 'created-website'

Every element of the list must be any of the following

created:

The date/time that the content object was created.

Access is restricted to users with these roles:

description:

Description of the content object

dtend:

The end date/time of the event's first occurrence.

dtstart:

The start date/time of the event's first occurrence.

email:

The email for contacting the event organizer.

ical_uid:

The event's unique identifier, see RFC 5545.

Access is restricted to users with these roles:

issued:

The date/time that the content was issued.

location_uuid:

The UUID of the associated location.

media:

A list of dictionaries with media information for the event.

modified:

The date/time that the content object was last modified.

Access is restricted to users with these roles:

phone:

A phone number to contact the event organizer.

prices:

The event's prices.

rrule:

Recurrence rule of the event.

state:

The status of the content, i.e. 'draft' or 'published'.

thumb_url:

The API download url to an image for this content object, to be used outside the content object.

title:

The title

url:

URL to the content

urlname:

The urlname

user_email:

The email of the user that submitted the event.

uuid:

The UUID of the content

website:

Website of the event.

issued:

A date/time period within which the event was issued. First element is the start of the period, second element is the end of the period. Either start or end can be None.

optional

Default: None

Element 0 (dtstart):

optional

Default: None

Element 1 (dtend):

optional

Default: None

order:

A dash-separated list of orderings to apply

optional

Default: []

Example value: 'issued-urlname.desc'

Every element of the list must be any of the following

issued:Sort by issue date ascending
issued.asc:Sort by issue date ascending
issued.desc:Sort by issue date descending
sort_title:Sort by sort_title (if exists) or title ascending
sort_title.asc:Sort by sort_title (if exists) or title ascending
sort_title.desc:Sort by sort_title (if exists) or title descending
title:Sort by title ascending
title.asc:Sort by title ascending
title.desc:Sort by title descending
urlname:Sort by urlname ascending
urlname.asc:Sort by urlname ascending
urlname.desc:Sort by urlname descending
uuid:Sort by UUID ascending
uuid.asc:Sort by UUID ascending
uuid.desc:Sort by UUID descending
occurring:

A date/time period within which the event has occurrences. First element is the start of the period, second element is the end of the period. The elements are separated by an underscore (_).

Either start or end can be empty or the value 'now'.

Note

The icalendar specification RFC 5545 defines dtend as non-inclusive. The dtend value of occurring is also considered non-inclusive. See Filter by Period for more information.

optional

Default: None

Example value: '2015-01-01_2015-02-01'

Element 0 (dtstart):

A date/time defining the beginning of the period (see Dates and Times).

optional

Default: None

Element 1 (dtend):

A date/time defining the non-inclusive end of the period (see Dates and Times).

optional

Default: None

expand:

A dash-separated list of fields to return expanded.

optional

Default: None

Example value: 'location_uuid'

Every element of the list must be any of the following

location_uuid:Returns a dictionary of location data (instead of just the location uuid).

/{iid}/events/occurrences

GET

Retrieve a batched collection of event occurrences.

Sample Call

Get all events occurrences:

>>> GET("/123/events/occurrences?fields=event_uuid-dtstart-dtend")
{'items': [['11111111-1111-1111-1111-111111111111',
            '2015-01-01T10:00:00',
            '2015-01-01T18:00:00'],
           ['22222222-2222-2222-2222-222222222222',
            '2020-02-02T18:00:00',
            '2020-02-02T23:00:00'],
           ['33333333-3333-3333-3333-333333333333',
            '2015-01-05T10:00:00',
            '2015-01-05T18:00:00']]}

See Event Occurrences for more examples.

Parameters

page:

The page number to retrieve.

optional

Default: 1

Values must not be lower than 1

rpp:

The number of results per page.

optional

Default: 20

Values must not be lower than 1 or higher than 100

fields:

A dash-separated list of fields to return.

optional

Default: ['event_uuid', 'dtstart']

Example value: ['event_uuid-dtstart-dtend']

Every element of the list must be any of the following

dtend:The end date/time of the occurrence.
dtstart:The start date/time of the occurrence.
event_uuid:The UUID of the event
period:

A date/time period within which the occurrences happen. First element is the start of the period, second element is the end of the period. The elements are separated by an underscore (_).

Either start or end can be empty or the value 'now'.

Note

The icalendar specification RFC 5545 defines dtend as non-inclusive. The dtend value of period is also considered non-inclusive. See Filter by Period for more information.

optional

Default: None

Example value: '2015-01-01_2015-02-01'

Element 0 (dtstart):

A date/time defining the beginning of the period (see Dates and Times).

optional

Default: None

Element 1 (dtend):

A date/time defining the non-inclusive end of the period (see Dates and Times).

optional

Default: None

expand:

A dash-separated list of fields to return expanded.

optional

Default: None

Example value: 'event_uuid'

Every element of the list must be any of the following

event_uuid:Returns a dictionary of event data, instead of just the event uuid.
event_uuid.location_uuid:Returns a dictionary of location data (instead of just the location uuid) inside the individual event dictionary.
tag:

UUID of a tag

optional

Default: None

Example value: '123456578-1234-1234-1234-123456789abc'

Values must obey all the conditions

  • be existing tag UUID

  • be UUID or None

predicate:

optional

Default: None

Values must be any of the following

authored:

The tag is the author of the event.

describes:

The tag describes the event.

edited:

The tag is the editor of the event.

order:

See Order by Distance for more information.

optional

Default: None

Example value: 'distance'

Every element of the list must be any of the following

distance:distance ascending

Table Of Contents

Previous topic

Content

Next topic

Files