Welcome to the VideoTile API documentation.
The VideoTile API allows you to automate your workflow with the VideoTile Learning Management System. The current API features are:
It is assumed that you're using the VideoTile SDK for the PHP examples.
Public Routes
Authenticated Routes
Admin Routes
Each request sent to the requires the vendor_id parameter.
You can return an array of all available courses within your LMS.
$api->getCourses();
{
"vendor_id": "vendor"
}
[
{
"id": 1,
"name": "Basic Legionella Management",
"description": "Explaining the background to Legionella and Legionnaires' Disease, the potential risks associated with water systems and how these can be prevented or controlled.",
"duration": 75,
"rrp": "65.00"
},
{
"id": 2,
"name": "Asbestos Awareness",
"description": "As well as informing you about the risks of working with asbestos, the course will deliver a lot more information about: Recognising asbestos, where it's used, minimising the risks and the legislation about working with asbestos.",
"duration": 65,
"rrp": "35.00"
},
]
Returns an object of a single course, specified by the request ID.
$api->getCourseById(1);
{
"id": 1,
"vendor_id": "vendor"
}
{
"id": 1,
"name": "Basic Legionella Management",
"description": "Explaining the background to Legionella and Legionnaires' Disease, the potential risks associated with water systems and how these can be prevented or controlled.",
"duration": 75,
"rrp": "65.00"
}
Returns a unique API token which is used for 'personal' requests for the user.
You should store this token, as it will be required for other routes which are protected by an authentication middleware, tokens are automatically generated.
{
"username": "johndoe",
"password": "password",
"vendor_id": "vendor"
}
$api->authenticateUser($username, $password);
{
"token": "generated-token"
}
Returns an array of all courses related to the authenticated user.
The 'api_token' parameter is required for this request.
{
"token": "token",
"vendor_id": "vendor",
"api_token": "token"
}
$api->getMyCourses($token);
{
"courses": [
{
"user_course_id": 1,
"course_name": "Basic Legionella Management",
"course_description": "Explaining the background to Legionella and Legionnaires' Disease, the potential risks associated with water systems and how these can be prevented or controlled.",
"user_course_percentage": 0
}
]
}
The API provides support with automatically logging in a user to the VideoTile LMS, you must use the users Auth Token for this.
An auth token lasts for 60 minutes, and will be automatically created on specific API routes, such as /my/courses and initial user auth.
The auth token is different to the users standard API token.
{
"api_token": "random-generated-token",
"vendor_id": "vendor"
}
$api->generateAuthToken($token);
{
"token": "token"
}
An array with all users in the database will be returned, an additional 'admin token' is required, this is provided by VideoTile upon initial installation.
An 'admin_token' parameter is required for all admin requests.
$api->getUserList($token);
{
"vendor_id": "vendor",
"admin_token": "admin_token"
}
[
{
"id": 393,
"userid": "johndoe",
"date": "2019-02-21 12:31:36",
"name": "johndoe",
"firstname": "John",
"lastname": "Doe",
"fullname": "John Doe",
"logindate": "2019-02-21 12:31:36",
"disabled": 1,
"api_token": "token"
},
{
"id": 394,
"userid": "janedoe",
"date": "2019-02-21 12:31:45",
"name": "janedoe",
"firstname": "Jane",
"lastname": "Doe",
"fullname": "Jane Doe",
"logindate": "2019-02-21 12:31:45",
"disabled": 0,
"api_token": "token"
}
]
Creates a new user with the given payload.
| Property | Description |
|---|---|
first_name |
the first name of the customer |
last_name |
the last name of the customer |
email |
the email address of the customer |
telephone |
the telephone of the customer, this is an optional field. |
$api->createUser([
'first_name' => 'John',
'last_name' => 'Doe',
'email' => 'john@doe.com',
'telephone' => '0123456789'
]);
{
"first_name": "John",
"last_name": "Doe",
"email": "john@doe.com",
"vendor_id": "vendor",
"admin_token": "admin_token",
"telephone": "0123456789"
}
{
"user_id": "1",
"username": "johndoe",
"api_token": "generated-token"
}
Returns a single user.
{
"id": 1,
"vendor_id": "vendor",
"admin_token": "admin_token"
}
$api->getUserById(1);
{
"id": 393,
"userid": "johndoe",
"date": "2019-02-21 12:31:36",
"name": "johndoe",
"firstname": "John",
"fullname": "John Doe",
"logindate": "2019-02-21 12:31:36",
"disabled": 1,
"api_token": "token"
}
Returns an array of all courses this user has enrolled to.
{
"id": 1,
"vendor_id": "vendor",
"admin_token": "admin_token"
}
$api->getUserCoursesById($userId);
{
"courses": [
{
"user_course_id": 1,
"course_name": "Basic Legionella Management",
"course_description": "Explaining the background to Legionella and Legionnaires' Disease, the potential risks associated with water systems and how these can be prevented or controlled.",
"user_course_percentage": 0
}
]
}
Returns an array of all courses this user has enrolled to.
{
"id": 1,
"course_id": 1,
"vendor_id": "vendor",
"admin_token": "admin_token"
}
$api->getUserCourseByCourseId($userId, $courseId);
{
"course": {
"usercourseid": 1,
"usrid": 393,
"userid": "craigsledmore",
"groupid": 0,
"courseid": 1,
"usercoursedate": "2019-02-27 00:02:28",
"certificatedate": "2019-02-27 00:02:28",
"certificatecode": "",
"failed": 0,
"percentage": 0,
"user": {
"id": 393,
"userid": "johndoe",
"date": "2019-02-21 12:31:36",
"name": "johndoe",
"firstname": "John",
"lastname": "Doe",
"email": "john@doe.com",
"fullname": "John Doe",
"logindate": "2019-02-21 12:31:36",
"disabled": 1,
"api_token": "1212"
},
"course": {
"courseid": 1,
"coursename": "Basic Legionella Management",
"coursedescrip": "Explaining the background to Legionella and Legionnaires' Disease, the potential risks associated with water systems and how these can be prevented or controlled.",
"courseDuration": 75,
"rrp": "65.00"
}
}
}
Should you need to disable a users account, you can send a POST request to the displayed endpoint which will update the disabled field in the VideoTile LMS.
{
"id": 1,
"vendor_id": "vendor",
"admin_token": "admin_token"
}
$api->disableUserAccountById($userId);
{
"success": "Account successfully disabled."
}
You may also find you need to quickly re-enable a users LMS access, you can do that with this route.
{
"id": 1,
"vendor_id": "vendor",
"admin_token": "admin_token"
}
$api->enableUserAccountById($userId);
{
"error": "This account is currently not disabled."
}
This request call allows you to assign a course to a users account.
{
"user_id": "1",
"course_id": "1"
}
$api->assignCourseByUserId($userId, $courseId);
{
"success":" Course successfully assigned to the user",
"user_course_id": 20
}