MFML Rest API

Videos methods
GET /videos/demo
GET /videos/demos
GET /videos/classes
GET /videos/recommendations
GET /videos/{id}
GET /videos/{id}/related
POST /videos/{id}/stats
POST /videos/{id}/download/{quality}/completed
POST /videos/{id}/download/{quality}/removed
GET demo
GET /videos/demo

Responses

200 OK (Video Single)
GET demos
GET /videos/demos

Request array of video for landing page. User can request this method without login.

Notes

Methods return demo videos for landing page.

Responses

200 OK (Video Single)
GET classes
GET /videos/classes

Get latest videos. User can filter this list.

Request parameters

offset
integer optional

Bypass number of items

limit
integer optional

Limit max number of items.

since
integer optional

Timestamp. Use to filter items that were updated_at since this time.

before
integer optional

Timestamp. Use to filter items that were updated_at before this time.

teacher
number optional

teacher id

filters
string optional

array of filter ids

searchterm
string optional

keyword search (only valid if filters and teacher are NOT present)

Example:
breathing+methods

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Videos Array)

Array of videos, newest on top. video count included.

Body
Array
Object
GET recommendations
GET /videos/recommendations

Request parameters

offset
integer optional

Bypass number of items

limit
integer optional

Limit max number of items.

before
integer optional

Timestamp. Use to filter items that were updated_at before this time.

since
integer optional

Timestamp. Use to filter items that were updated_at since this time.

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Video Single)
GET video
GET /videos/{id}

Path variables

id
string required

Request parameters

downloadlinks
string optional

use this to get the vimeo download links

Example:
1

Request headers

token
string optional

User get this token after login. Client will send this token in header

GET /videos/{id}/related

Path variables

id
string required

Request parameters

offset
integer optional

Bypass number of items

limit
integer optional

Limit max number of items.

since
integer optional

Timestamp. Use to filter items that were updated_at since this time.

before
integer optional

Timestamp. Use to filter items that were updated_at before this time.

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Video Single)
POST video play stats
POST /videos/{id}/stats

Path variables

id
string required

Request parameters

date_created
integer optional

timestamp

engagement
integer optional

percent of total duration played

offline
boolean optional

Whether the video is played offline (i.e. downloaded) or not

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Bool Response)

Result of operation.

POST completed download
POST /videos/{id}/download/{quality}/completed

Path variables

id
string required
quality
string required

mobile,sd,hd

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Bool Response)

Result of operation.

POST removed download
POST /videos/{id}/download/{quality}/removed

Path variables

id
string required
quality
string required

mobile,sd,hd

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Bool Response)

Result of operation.

User methods
POST /user/login
POST /user/logout
GET /levels
GET /benefits
POST /user/preferences
GET /user/preferences
GET /styles
GET /user/favorites
GET /user/favorites/ids
POST /user/favorite/video/{id}
DELETE /user/favorite/video/{id}
GET /user/movelists
GET /user/movelists/{id}
POST /user/movelist
POST /user/movelist
POST /user/movelist/video
DELETE /user/movelist/{id}
DELETE /user/movelist/{movelistid}/video/{id}
GET /events
POST /schedule/create
DELETE /schedule/{id}
POST /register
POST /deregister
POST login
POST /user/login

Request parameters

email
string required
password
string required

verysecuredpassword

type
integer required

0

Enumeration:
0

email

1

facebook

token
string optional

gM5lXAyS5vfj6PgRLcHAhNMgSvI= Optional value. If present and login type is facebook - then login user via facebook.

Request headers

fbid
number optional

facebook id

Responses

200 OK
Body
Object
id
string

Unique identifier

Example:
/80BpCSpM6ENgQ==
token
string

Unique token

Example:
A6VLPRQFI6Eud1j9+9JDNPHc4gw=
first_name
string

User`s first name

Example:
John
last_name
string

User`s last name

Example:
Galt
email
string

User`s email

Example:
johngalt@apple.com
subscription_end_date
integer

User`s subscription end date. If no date present - return 0.

Example:
1487209973
level
integer

User’s level preference (if set)

benefits
Array of integer

User’s benefits preferences (if set)

styles
Array of integer

User’s styles preferences (if set)

POST logout
POST /user/logout

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Bool Response)

Result of operation.

GET levels
GET /levels

Only use this call for recommendation questions

Notes

Method to get available levels.

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK

Returns an array of objects.

Body
Object
id
string
Example:
lBJ7CD63j7aEwA==
name
string
Example:
A Beginner
GET benefits
GET /benefits

Only use this call for recommendation questions

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK

Returns an array of objects.

Body
Object
id
string

Unique identifier

Example:
l1Qyq4Xh+7boIw==
name
string

Name of benefit

Example:
Low energy
POST preferences
POST /user/preferences

Request headers

token
string optional

User get this token after login. Client will send this token in header

Request body

Object
level
integer

Unique identifier of level

benefits
Array of number

Array of benefit ids

styles
Array of number

Array of style ids

Responses

200 OK (Bool Response)

Result of operation.

GET preferences
GET /user/preferences

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK

Returns an array of objects.

GET styles
GET /styles

Only use this call for recommendation questions

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK

Returns an array of objects.

Body
Object
id
string

Unique identifier

Example:
l1Qyq4Xh+7boIw==
name
string

Name of benefit

Example:
Low energy
GET favorite videos
GET /user/favorites

Request parameters

offset
integer optional

Bypass number of items

limit
integer optional

Limit max number of items.

since
integer optional

Timestamp. Use to filter items that were updated_at since this time.

before
integer optional

Timestamp. Use to filter items that were updated_at before this time.

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Video Single)
GET favorite videos ids
GET /user/favorites/ids

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK

Array of video ids (with array key: ‘favoriteIds’)

POST add video to favorite
POST /user/favorite/video/{id}

Path variables

id
string required

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Bool Response)

Result of operation.

DELETE video from favorite
DELETE /user/favorite/video/{id}

Path variables

id
string required

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Bool Response)

Result of operation.

GET movelists
GET /user/movelists

Request parameters

offset
integer optional

Bypass number of items

limit
integer optional

Limit max number of items.

since
integer optional

Timestamp. Use to filter items that were updated_at since this time.

before
integer optional

Timestamp. Use to filter items that were updated_at before this time.

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Movelists Array)

Array of movelists, oldest on top.

GET movelist videos
GET /user/movelists/{id}

Path variables

id
string required

Request parameters

offset
integer optional

Bypass number of items

limit
integer optional

Limit max number of items.

since
integer optional

Timestamp. Use to filter items that were updated_at since this time.

before
integer optional

Timestamp. Use to filter items that were updated_at before this time.

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK
Body
Object
id
integer
name
string
data
Array of string

Videos Array

POST create movelist
POST /user/movelist

Request headers

token
string optional

User get this token after login. Client will send this token in header

Request body

Object
name
string

movelist name

Responses

200 OK (Bool Response)

Result of operation.

POST rename movelist
POST /user/movelist

Request headers

token
string optional

User get this token after login. Client will send this token in header

Request body

Object
movelist
integer

movelist id

name
string

movelist name

Responses

200 OK (Bool Response)

Result of operation.

POST add video to movelist
POST /user/movelist/video

Request headers

token
string optional

User get this token after login. Client will send this token in header

Request body

Object
movelist
integer

movelist id

video
integer

video id

Responses

200 OK (Bool Response)

Result of operation.

DELETE movelist
DELETE /user/movelist/{id}

Path variables

id
string required

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Bool Response)

Result of operation.

DELETE remove video from movelist
DELETE /user/movelist/{movelistid}/video/{id}

Path variables

movelistid
string required
id
string required

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Bool Response)

Result of operation.

GET events
GET /events

to fetch starred (gold or silver) + scheduled classes

Request parameters

start
integer optional

start timestamp

end
integer optional

end timestamp

id
integer optional

scheduled event id (start and end are ignored if this parameter is passed)

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK

Returns an array of objects.

Body
Object
POST create scheduled class
POST /schedule/create

Request headers

token
string optional

User get this token after login. Client will send this token in header

Request body

Object
video
integer

video id

timestamp
integer

timestamp

Responses

200 OK (Bool Response)

Result of operation.

POST update scheduled class
POST /schedule

Request headers

token
string optional

User get this token after login. Client will send this token in header

Request body

Object
schedule
integer

schedule id

timestamp
integer

timestamp

Responses

200 OK (Bool Response)

Result of operation.

DELETE scheduled class
DELETE /schedule/{id}

Path variables

id
string required

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK (Bool Response)

Result of operation.

POST register device
POST /register

register a device for a user

Request headers

token
string optional

User get this token after login. Client will send this token in header

Request body

Object
deviceToken
string

device token

Responses

200 OK (Bool Response)

Result of operation.

POST deregister device
POST /deregister

deregister a device for a user

Request headers

token
string optional

User get this token after login. Client will send this token in header

Request body

Object
deviceToken
string

device token

Responses

200 OK (Bool Response)

Result of operation.

Teachers methods
GET /teachers
GET /teachers/{id}
GET teachers
GET /teachers

Responses

200 OK (Teacher Single)
GET teacher
GET /teachers/{id}

Path variables

id
string required

Responses

200 OK (Teacher Single)
Filters methods
GET /filters
GET filters
GET /filters

Request headers

token
string optional

User get this token after login. Client will send this token in header

Responses

200 OK
Body
Object
id
string

Unique identifier

Example:
asX29dGuO1lraA==
name
string

Name of filter

Example:
Emotion
subfilters
Array

Subfilters. If empty - return empty array, not null.

Object
id
string

Unique identifier

Example:
BKXejaK6zmn1BA==
name
string

Name of filter

Example:
All Emotion
subfilters
Array of unknown

Subfilters. If empty - return empty array, not null.

Parameters
limit
integer optional

Limit max number of items.

since
integer optional

Timestamp. Use to filter items that were updated_at since this time.

before
integer optional

Timestamp. Use to filter items that were updated_at before this time.

X-Authorization
string required
Applied to all operations

API key

Responses
200 OK (Movelists Array)

Array of movelists, oldest on top.

Body
Object
id
integer
name
string
video_count
integer
Operations: GET movelists
200 OK (Video Single)
Body
Object
id
string

Unique identifier

Example:
12345
thumbnail_url
string

URL of thumbnail picture

Example:
http://bsmedia.business-standard.com/_media/bs/img/article/2015-12/14/full/1450075516-5439.jpg
title
string

Title of video

Example:
Starter Yoga Video
description
string

Description of video

Example:
Long Yoga video description
duration
integer

Duration of video, in seconds

Example:
120
teacher
Object

Teacher`s model

id
string

Unique identifier

Example:
Q8ErRuZdAnNP0w==
thumbnail_url
string

URL of teacher`s thumbnail picture

Example:
http://bsmedia.business-standard.com/_media/bs/img/article/2015-12/14/full/1450075516-5439.jpg
first_name
string
last_name
string
is_favourite
boolean

Flag, that shows if this video is in favorites of user who sent request. If user is not logged in - return false

Example:
true
is_in_movelists
Array of integer

List of movelists this video appears in for user who sent request. If user is not logged in - return false

updated_at
integer

Timestamp (time interval from 1970) in seconds

Example:
1487105627
closest_scheduled_event_id
integer

closest scheduled event id

files
Array of string

array of video files from vimeo

200 OK (Filters)

Return filters for classes

Body
Object
id
number

filter id

name
string

name

200 OK (Teacher Single)
Body
Object
id
number
first_name
string
last_name
string
categories
Array
Object
id
number
name
string
thumbnail_url
string
bio
string
Trash