Applying to use the Flex API

To apply for API access, please email info@joinflex.tv.

Logo API Documentation

Flex offers a RESTful API hosted at https://api.joinflex.tv/v1. All API endpoints return JSON and must be used over HTTPS. Authentication is performed by passing an API key and API secret as the username/password combination of an HTTP Basic Authentication header.

GET /events Lists events
GET /events/:event_id Gets an event
GET /categories Lists categories

GET /events

Returns an array of event data. An event has the following fields:

Field name Type Description
id Integer Unique ID of the event.
name String Name of the event (limited to 50 characters).
url String URL of the event.
category String Category of the event (see GET /categories).
description String Description of the event (limited to 200 characters).
image_url String URL of the event image (16:9 aspect ratio).
start_date_time ISO8601 String ISO8601 time representation of the event start date/time. This is expressed as local time with a correct offset from UTC.
duration Integer Duration of the event in minutes.
price Decimal Price of the event in pounds sterling (0 if free).
channel Object Object containing information relating to channel responsible for event, as follows:
channel.name String Channel name.
channel.url String Channel URL.
created_at ISO8601 String ISO8601 timestamp of the date/time the event was created. This is expressed in UTC.

Only events that are active (start date/time in the future) will be returned.

A maximum of 50 events are returned per request. Use the since_id filter to paginate results.

Filters can be applied to narrow down the result set. Valid filters are as follows:

Name Type Description
since_id Integer Returns results with an ID greater than (that is, more recent than) the specified ID. Used primarily for paging through results.
category_id Integer Unique ID of a category (see GET /categories).

An empty array will be returned if no events match the filters set.

An example call to retrieve a list of events:

curl -X GET -H "Accept: application/json" -u API_KEY:API_SECRET https://api.joinflex.tv/v1/events?some_filters...

[
  {
    "id": 123,
    "name": "Pop Lock and Drop it",
    "url": "https://joinflex.tv/c/booty-like-beyonce/events/123",
    "category": "Dance",
    "description": "Pop lock and drop it to get a booty like Beyonce in this 30 min dance-based fitness class.",
    "image_url": "https://flex-production.s3.amazonaws.com/uploads/event/image/123/booty-like-beyonce.jpg",
    "start_date_time": "2016-07-11T15:00:00Z",
    "duration": 30,
    "price": 0,
    "channel": {
      "name": "Booty like Beyonce",
      "url": "https://joinflex.tv/c/booty-like-beyonce"
    },
    "created_at": "2016-04-10T19:48:02Z"
  },
  {
    "id": 124,
    "name": "Hulkamania Workout",
    "url": "https://joinflex.tv/c/hulk-hogan/events/124",
    "category": "HIIT",
    "description": "Quads, traps & tash workout.",
    "image_url": "https://flex-production.s3.amazonaws.com/uploads/event/image/124/hulkamania.jpg",
    "start_date_time": "2016-07-10T01:00:00+01:00",
    "duration": 60,
    "price": 3,
    "channel": {
      "name": "Hulk Hogan",
      "url": "https://joinflex.tv/c/hulk-hogan"
    },
    "created_at": "2016-04-10T19:47:52Z"
  },
  ...
]

GET /events/:event_id

Returns a single event which matches :event_id. See GET /events for event fields.

Returns a 404 if a matching event is not found.

An example call to retrieve an event:

curl -X GET -H "Accept: application/json" -u API_KEY:API_SECRET https://api.joinflex.tv/v1/events/123

{
  "id": 123,
  "name": "Pop Lock and Drop it",
  "url": "https://joinflex.tv/c/booty-like-beyonce/events/123",
  "category": "Dance",
  "description": "Pop lock and drop it to get a booty like Beyonce in this 30 min dance-based fitness class.",
  "image_url": "https://flex-production.s3.amazonaws.com/uploads/event/image/123/booty-like-beyonce.jpg",
  "start_date_time": "2016-07-11T15:00:00Z",
  "duration": 30,
  "price": 0,
  "channel": {
    "name": "Booty like Beyonce",
    "url": "https://joinflex.tv/c/booty-like-beyonce"
  },
  "created_at": "2016-04-10T19:48:02Z"
}

GET /categories

Returns an exhaustive list of categories used by Flex. A category has the following fields:

Field name Type Description
id Integer Unique ID of the category
name String Category name

An example call to retrieve the category list:

curl -X GET -H "Accept: application/json" -u API_KEY:API_SECRET https://api.joinflex.tv/v1/categories

[
  {
    "id": 1,
    "name": "Aerobics"
  },
  {
    "id": 2,
    "name": "Bodybuilding"
  },
  {
    "id": 3,
    "name": "Bootcamp"
  },
  ...
]