Introduction
The Teachfloor API is organized around REST. Our API has predictable resource-oriented URLs, accepts form-encoded request bodies, returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
Base URL
https://api.teachfloor.com
Authenticating requests
Authenticate requests to this API's endpoints by sending an Authorization
header with the value "Bearer {YOUR_API_KEY}"
.
All authenticated endpoints are marked with a requires authentication
badge in the documentation below.
You can retrieve your API Key in Settings > Integrations and clicking Generate API Key.
Rate Limiting
Example response: HTTP/1.1 200 OK X-RateLimit-Limit: 50 X-RateLimit-Remaining: 48
Teachfloor API has a rate limit of 50 requests per minute per API Key.
Each HTTP response includes headers indicating the rate limit status: X-RateLimit-Limit
specifies the rate limit per minute, and X-RateLimit-Remaining
indicates the remaining rate limit available.
Activities
Retrieve an Activity
Requires Authentication
Retrieves the details of an existing activity in your organization based on the provided unique activity ID. The response includes comprehensive information about the activity, such as its score, timestamps, associated element details, and related metadata.
If the activity is performed by an individual, the member
key contains the details of the member who completed the activity.
If the activity is performed by a group, the members
key provides a list of all members who participated in the activity.
The meta
object contains additional details and metadata about the activity's completion status. It provides context on the outcome and participant of the activity.
Example request:
curl --request GET \
--get "https://api.teachfloor.com/v0/activities/p5v87ERWKR3dkjyD" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.teachfloor.com/v0/activities/p5v87ERWKR3dkjyD',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/activities/p5v87ERWKR3dkjyD"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"id": "KwJ8VgrmlAp4PBnM",
"object": "activity",
"timestamp" : "2022-11-27T13:52:02.000000Z",
"status": "PASSED",
"passed": true,
"score": 100,
"completed_by": "6K8vojJn1xe14abL",
"member": {
"id": "6K8vojJn1xe14abL",
"object": "member",
"first_name": "Adalberto",
"last_name": "Bruen",
"full_name": "Adalberto Bruen",
"avatar": null,
"email": "iva52@example.org",
"is_email_verified": true,
"last_seen": "2024-11-27T13:51:52.000000Z"
},
"context": {
"id": "QB8nmEJjqdbLA2K5",
"object": "element",
"created_at": "2024-11-26T11:37:16.000000Z",
"name": "Multiple Choice Quiz",
"cover": null,
"type": "QUIZ",
"position": 3,
"module": "no0aApWNyRMD68rv",
"metadata": {}
}
}
Received response:
Request failed with error:
List all Activities
Requires Authentication
Returns a list of activities within your organization. The activities are sorted by their creation date, with the most recently created activities appearing first. Each activity in the list includes information such as the score, dates, element data and more.
If the activity is performed by an individual, the member
key contains the details of the member who completed the activity.
If the activity is performed by a group, the members
key provides a list of all members who participated in the activity.
Example request:
curl --request GET \
--get "https://api.teachfloor.com/v0/activities?module=no0aApWNyRMD68rv&element=QB8nmEJjqdbLA2K5&member=6K8vojJn1xe14abL&page=2" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.teachfloor.com/v0/activities',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'module'=> 'no0aApWNyRMD68rv',
'element'=> 'QB8nmEJjqdbLA2K5',
'member'=> '6K8vojJn1xe14abL',
'page'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/activities"
);
const params = {
"module": "no0aApWNyRMD68rv",
"element": "QB8nmEJjqdbLA2K5",
"member": "6K8vojJn1xe14abL",
"page": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"data": [
{
"id": "KwJ8VgrmlAp4PBnM",
"object": "activity",
"timestamp" : "2022-11-27T13:52:02.000000Z",
"status": "PASSED",
"passed": true,
"score": 100,
"completed_by": "6K8vojJn1xe14abL",
"member": {
"id": "6K8vojJn1xe14abL",
"object": "member",
"first_name": "Adalberto",
"last_name": "Bruen",
"full_name": "Adalberto Bruen",
"avatar": null,
"email": "iva52@example.org",
"is_email_verified": true,
"last_seen": "2024-11-27T13:51:52.000000Z"
},
"context": {
"id": "QB8nmEJjqdbLA2K5",
"object": "element",
"created_at": "2024-11-26T11:37:16.000000Z",
"name": "Multiple Choice Quiz",
"cover": null,
"type": "QUIZ",
"position": 3,
"module": "no0aApWNyRMD68rv",
"metadata": {}
}
},
{...},
{...},
],
"pagination": {
"total": 3,
"count": 3,
"per_page": 10,
"current_page": 1,
"total_pages": 1
}
}
Received response:
Request failed with error:
Courses
Search Courses
Requires Authentication
Search for existing courses in your organization. You can search by course name. The search is case-insensitive and supports partial matches.
Example request:
curl --request GET \
--get "https://api.teachfloor.com/v0/courses/search" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"q\": \"Marketing\",
\"include_test_user\": true
}"
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.teachfloor.com/v0/courses/search',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'q' => 'Marketing',
'include_test_user' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/courses/search"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"q": "Marketing",
"include_test_user": true
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"data": [
{
"id": "p5v87ERWKR3dkjyD",
"object": "course",
"name": "Ultimate Marketing Course",
"status": "PUBLISHED",
"created_at": "2022-02-03T16:06:42.000000Z",
"cover": null,
"availability": "CONTINUOUS",
"visibility": "PRIVATE",
"start_date": null,
"end_date": null,
"currency": "eur",
"price": null,
"url": null,
"public_url": null,
"join_url": null,
"metadata": {},
"custom_fields": {
"field_1": {
"key": "field_1",
"object": "custom-field",
"created_at": "2024-07-30T16:05:47.000000Z",
"name": "Multiple Field Question",
"description": null,
"type": "MULTIPLE_OPTIONS",
"options": [
"Option A",
"Option B",
"Option C"
],
"required": false
}
}
},
{...},
{...}
],
"pagination": {
"total": 5,
"count": 5,
"per_page": 10,
"current_page": 1,
"total_pages": 1
}
}
}
Received response:
Request failed with error:
Retrieve a Course
Requires Authentication
Retrieves the details of an existing course in your organization based on the provided unique course ID. Returns a comprehensive information about the course, including its name, availability, status, dates, and more.
Example request:
curl --request GET \
--get "https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"id": "p5v87ERWKR3dkjyD",
"object": "course",
"name": "Ultimate Marketing Course",
"status": "PUBLISHED",
"created_at": "2022-02-03T16:06:42.000000Z",
"cover": null,
"availability": "CONTINUOUS",
"visibility": "PRIVATE",
"start_date": null,
"end_date": null,
"currency": "eur",
"price": null,
"url": null,
"public_url": null,
"join_url": null,
"metadata": {},
"custom_fields": {
"field_1": {
"key": "field_1",
"object": "custom-field",
"created_at": "2024-07-30T16:05:47.000000Z",
"name": "Multiple Field Question",
"description": null,
"type": "MULTIPLE_OPTIONS",
"options": [
"Option A",
"Option B",
"Option C"
],
"required": false
}
}
}
}
Received response:
Request failed with error:
List all Courses
Requires Authentication
Returns a list of courses within your organization. The courses are sorted by their creation date, with the most recently created courses appearing first. Each course in the list includes information such as the course name, availability, status, dates, and more.
Example request:
curl --request GET \
--get "https://api.teachfloor.com/v0/courses?page=2" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.teachfloor.com/v0/courses',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/courses"
);
const params = {
"page": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"data": [
{
"id": "p5v87ERWKR3dkjyD",
"object": "course",
"name": "Ultimate Marketing Course",
"status": "PUBLISHED",
"created_at": "2022-02-03T16:06:42.000000Z",
"cover": null,
"availability": "CONTINUOUS",
"visibility": "PRIVATE",
"start_date": null,
"end_date": null,
"currency": "eur",
"price": null,
"url": null,
"public_url": null,
"join_url": null,
"metadata": {},
"custom_fields": {
"field_1": {
"key": "field_1",
"object": "custom-field",
"created_at": "2024-07-30T16:05:47.000000Z",
"name": "Multiple Field Question",
"description": null,
"type": "MULTIPLE_OPTIONS",
"options": [
"Option A",
"Option B",
"Option C"
],
"required": false
}
}
},
{...},
{...}
],
"pagination": {
"total": 15,
"count": 5,
"per_page": 10,
"current_page": 1,
"total_pages": 2
}
}
}
Received response:
Request failed with error:
Join a Course
Requires Authentication
Joins a member in one of your courses.
Example request:
curl --request POST \
"https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD/join" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"member\": \"e7W6kP8wvjd3GRBz\",
\"role\": \"customer\"
}"
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD/join',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'member' => 'e7W6kP8wvjd3GRBz',
'role' => 'customer',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD/join"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"member": "e7W6kP8wvjd3GRBz",
"role": "customer"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": null
}
Received response:
Request failed with error:
Revoke Course Access
Requires Authentication
Revokes a member access to a course.
Example request:
curl --request POST \
"https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD/revoke" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"member\": \"e7W6kP8wvjd3GRBz\"
}"
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD/revoke',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'member' => 'e7W6kP8wvjd3GRBz',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD/revoke"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"member": "e7W6kP8wvjd3GRBz"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": null
}
Received response:
Request failed with error:
Create a Course
Requires Authentication
Creates a course in your organization. Returns the created course details upon successful creation.
Example request:
curl --request POST \
"https://api.teachfloor.com/v0/courses" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Ultimate Marketing Course\",
\"availability\": \"CONTINUOUS\",
\"start_date\": \"2023-07-12\",
\"end_date\": \"2023-07-26\",
\"visibility\": \"PRIVATE\",
\"metadata\": {
\"category\": \"marketing\",
\"level\": \"advanced\"
}
}"
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.teachfloor.com/v0/courses',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Ultimate Marketing Course',
'availability' => 'CONTINUOUS',
'start_date' => '2023-07-12',
'end_date' => '2023-07-26',
'visibility' => 'PRIVATE',
'metadata' => [
'category' => 'marketing',
'level' => 'advanced',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/courses"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Ultimate Marketing Course",
"availability": "CONTINUOUS",
"start_date": "2023-07-12",
"end_date": "2023-07-26",
"visibility": "PRIVATE",
"metadata": {
"category": "marketing",
"level": "advanced"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"id": "p5v87ERWKR3dkjyD",
"object": "course",
"name": "Ultimate Marketing Course",
"status": "PUBLISHED",
"created_at": "2022-02-03T16:06:42.000000Z",
"cover": null,
"availability": "CONTINUOUS",
"visibility": "PRIVATE",
"start_date": null,
"end_date": null,
"currency": "eur",
"price": null,
"url": null,
"public_url": null,
"join_url": null,
"metadata": {},
"custom_fields": {
"field_1": {
"key": "field_1",
"object": "custom-field",
"created_at": "2024-07-30T16:05:47.000000Z",
"name": "Multiple Field Question",
"description": null,
"type": "MULTIPLE_OPTIONS",
"options": [
"Option A",
"Option B",
"Option C"
],
"required": false
}
}
}
}
Received response:
Request failed with error:
List all Course Members
Requires Authentication
Returns a list of members within the course.
Example request:
curl --request GET \
--get "https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD/members" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"include_test_user\": true
}"
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD/members',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'include_test_user' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD/members"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"include_test_user": true
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"data": [
{
"id": "6jO9XN7mZEVpvxqo",
"object": "course_member",
"joined_at": "2024-01-22T12:56:04.000000Z",
"member": {
"id": "e7W6kP8wvjd3GRBz",
"object": "member",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"avatar": null,
"email": null,
"is_email_verified": false,
"last_seen": "2024-01-22T12:56:04.000000Z"
},
"course": {
"id": "p5v87ERWKR3dkjyD",
"object": "course",
"name": "Ultimate Marketing Course",
"status": "PUBLISHED",
"created_at": "2022-02-03T16:06:42.000000Z",
"cover": null,
"availability": "CONTINUOUS",
"visibility": "PRIVATE",
"start_date": null,
"end_date": null,
"currency": "eur",
"price": null,
"url": null,
"public_url": null,
"join_url": null,
"metadata": {},
"custom_fields": {
"field_1": {
"key": "field_1",
"object": "custom-field",
"created_at": "2024-07-30T16:05:47.000000Z",
"name": "Multiple Field Question",
"description": null,
"type": "MULTIPLE_OPTIONS",
"options": [
"Option A",
"Option B",
"Option C"
],
"required": false
}
}
},
"custom_fields": {
"field_1": [
"Option A",
"Option B"
]
}
},
{...},
{...}
],
"pagination": {
"total": 15,
"count": 5,
"per_page": 10,
"current_page": 1,
"total_pages": 2
}
}
}
Received response:
Request failed with error:
List all Course Modules
Requires Authentication
Returns a list of modules within the course.
Example request:
curl --request GET \
--get "https://api.teachfloor.com/v0/courses/LZ6dN0DGgBD3QjxB/modules" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.teachfloor.com/v0/courses/LZ6dN0DGgBD3QjxB/modules',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/courses/LZ6dN0DGgBD3QjxB/modules"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"data": [
{
"id": "LZ6dN0DGgBD3QjxB",
"object": "module",
"created_at": "2024-01-22T12:55:11.000000Z",
"name": "Lesson #1",
"type": "LESSON",
"availability": "CONTINUOUS",
"position": 0,
"course": "B4peAvmZ1L9OY3Xr",
"metadata": {}
},
{...},
{...}
],
"pagination": {
"total": 15,
"count": 5,
"per_page": 10,
"current_page": 1,
"total_pages": 2
}
}
}
Received response:
Request failed with error:
List all Course Elements
Requires Authentication
Returns a list of elements within the course.
Example request:
curl --request GET \
--get "https://api.teachfloor.com/v0/courses/WYxKj5OlrekVAGr7/elements" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.teachfloor.com/v0/courses/WYxKj5OlrekVAGr7/elements',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/courses/WYxKj5OlrekVAGr7/elements"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"data": [
{
"id": "WYxKj5OlrekVAGr7",
"object": "element",
"created_at": "2024-01-22T12:55:11.000000Z",
"name": "Introduction",
"cover": null,
"type": "CONTENT",
"position": 0,
"module": "LZ6dN0DGgBD3QjxB",
"metadata": {}
},
{...},
{...}
],
"pagination": {
"total": 15,
"count": 5,
"per_page": 10,
"current_page": 1,
"total_pages": 2
}
}
}
Received response:
Request failed with error:
Update a Course
Requires Authentication
Updates the details of an existing course in your organization based on the provided unique course ID. Any parameters not provided will be left unchanged. Returns the updated course details upon successful update.
Example request:
curl --request POST \
"https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Ultimate Marketing Course\",
\"availability\": \"SCHEDULED\",
\"start_date\": \"2023-07-12\",
\"end_date\": \"2023-07-26\",
\"visibility\": \"PRIVATE\",
\"metadata\": {
\"category\": \"marketing\",
\"level\": \"advanced\"
}
}"
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Ultimate Marketing Course',
'availability' => 'SCHEDULED',
'start_date' => '2023-07-12',
'end_date' => '2023-07-26',
'visibility' => 'PRIVATE',
'metadata' => [
'category' => 'marketing',
'level' => 'advanced',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/courses/p5v87ERWKR3dkjyD"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Ultimate Marketing Course",
"availability": "SCHEDULED",
"start_date": "2023-07-12",
"end_date": "2023-07-26",
"visibility": "PRIVATE",
"metadata": {
"category": "marketing",
"level": "advanced"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"id": "p5v87ERWKR3dkjyD",
"object": "course",
"name": "Ultimate Marketing Course",
"status": "PUBLISHED",
"created_at": "2022-02-03T16:06:42.000000Z",
"cover": null,
"availability": "CONTINUOUS",
"visibility": "PRIVATE",
"start_date": null,
"end_date": null,
"currency": "eur",
"price": null,
"url": null,
"public_url": null,
"join_url": null,
"metadata": {},
"custom_fields": {
"field_1": {
"key": "field_1",
"object": "custom-field",
"created_at": "2024-07-30T16:05:47.000000Z",
"name": "Multiple Field Question",
"description": null,
"type": "MULTIPLE_OPTIONS",
"options": [
"Option A",
"Option B",
"Option C"
],
"required": false
}
}
}
}
Received response:
Request failed with error:
Elements
List all activites
Requires Authentication
Returns a list of activites related to the element.
If the activity is performed by an individual, the member
key contains the details of the member who completed the activity.
If the activity is performed by a group, the members
key provides a list of all members who participated in the activity.
Example request:
curl --request GET \
--get "https://api.teachfloor.com/v0/elements/e7W6kP8wvjd3GRBz/activities?member=6K8vojJn1xe14abL" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.teachfloor.com/v0/elements/e7W6kP8wvjd3GRBz/activities',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'member'=> '6K8vojJn1xe14abL',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/elements/e7W6kP8wvjd3GRBz/activities"
);
const params = {
"member": "6K8vojJn1xe14abL",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"data": [
{
"id": "KwJ8VgrmlAp4PBnM",
"object": "activity",
"timestamp" : "2022-11-27T13:52:02.000000Z",
"status": "PASSED",
"passed": true,
"score": 100,
"completed_by": "6K8vojJn1xe14abL",
"member": {
"id": "6K8vojJn1xe14abL",
"object": "member",
"first_name": "Adalberto",
"last_name": "Bruen",
"full_name": "Adalberto Bruen",
"avatar": null,
"email": "iva52@example.org",
"is_email_verified": true,
"last_seen": "2024-11-27T13:51:52.000000Z"
},
"context": {
"id": "QB8nmEJjqdbLA2K5",
"object": "element",
"created_at": "2024-11-26T11:37:16.000000Z",
"name": "Multiple Choice Quiz",
"cover": null,
"type": "QUIZ",
"position": 3,
"module": "no0aApWNyRMD68rv",
"metadata": {}
},
},
{...},
{...},
],
"pagination": {
"total": 3,
"count": 3,
"per_page": 10,
"current_page": 1,
"total_pages": 1
}
}
Received response:
Request failed with error:
Create element
Requires Authentication
Creates an element in the specified module. Returns the created element details upon successful creation.
Example request:
curl --request POST \
"https://api.teachfloor.com/v0/elements" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"First knowledge\",
\"module\": \"no0aApWNyRMD68rv\",
\"type\": \"QUIZ\",
\"metadata\": {
\"category\": \"marketing\",
\"level\": \"advanced\"
}
}"
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.teachfloor.com/v0/elements',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'First knowledge',
'module' => 'no0aApWNyRMD68rv',
'type' => 'QUIZ',
'metadata' => [
'category' => 'marketing',
'level' => 'advanced',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/elements"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "First knowledge",
"module": "no0aApWNyRMD68rv",
"type": "QUIZ",
"metadata": {
"category": "marketing",
"level": "advanced"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"data": {
"id": "QB8nmEJjqdbLA2K5",
"object": "element",
"created_at": "2024-11-26T11:37:16.000000Z",
"name": "Multiple Choice Quiz",
"cover": null,
"type": "QUIZ",
"position": 3,
"module": "no0aApWNyRMD68rv",
"metadata": {}
}
}
}
Received response:
Request failed with error:
Update element
Requires Authentication
Updates the details of an existing element in your organization based on the provided unique element ID. Any parameters not provided will be left unchanged. Returns the updated element details upon successful update.
Example request:
curl --request POST \
"https://api.teachfloor.com/v0/elements/p5v87ERWKR3dkjyD" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Ultimate Marketing Element\",
\"metadata\": {
\"category\": \"marketing\",
\"level\": \"advanced\"
}
}"
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.teachfloor.com/v0/elements/p5v87ERWKR3dkjyD',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Ultimate Marketing Element',
'metadata' => [
'category' => 'marketing',
'level' => 'advanced',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/elements/p5v87ERWKR3dkjyD"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Ultimate Marketing Element",
"metadata": {
"category": "marketing",
"level": "advanced"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"data": {
"id": "QB8nmEJjqdbLA2K5",
"object": "element",
"created_at": "2024-11-26T11:37:16.000000Z",
"name": "Multiple Choice Quiz",
"cover": null,
"type": "QUIZ",
"position": 3,
"module": "no0aApWNyRMD68rv",
"metadata": {}
}
}
}
Received response:
Request failed with error:
Members
Search Members
Requires Authentication
Search for existing members in your organization. You can search by first name, last name or email. The search is case-insensitive and supports partial matches.
Example request:
curl --request GET \
--get "https://api.teachfloor.com/v0/members/search" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"q\": \"John\",
\"include_test_user\": true
}"
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.teachfloor.com/v0/members/search',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'q' => 'John',
'include_test_user' => true,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/members/search"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"q": "John",
"include_test_user": true
};
fetch(url, {
method: "GET",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"data": [
{
"id": "e7W6kP8wvjd3GRBz",
"object": "member",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"avatar": null,
"email": null,
"is_email_verified": false,
"last_seen": "2024-01-22T12:56:04.000000Z"
},
{...},
{...}
],
"pagination": {
"total": 5,
"count": 5,
"per_page": 10,
"current_page": 1,
"total_pages": 1
}
}
}
Received response:
Request failed with error:
Retrieve a Member
Requires Authentication
Retrieves the details of an existing member in your organization based on the provided unique member ID. Returns a comprehensive information about the member, including their first name, last name, email, and profile image.
Example request:
curl --request GET \
--get "https://api.teachfloor.com/v0/members/e7W6kP8wvjd3GRBz" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.teachfloor.com/v0/members/e7W6kP8wvjd3GRBz',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/members/e7W6kP8wvjd3GRBz"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"id": "e7W6kP8wvjd3GRBz",
"object": "member",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"avatar": null,
"email": null,
"is_email_verified": false,
"last_seen": "2024-01-22T12:56:04.000000Z"
}
}
Received response:
Request failed with error:
List all Members
Requires Authentication
Retrieves a paginated list of members in your organization. This API endpoint allows you to retrieve detailed information about each member, including their name, email, and other relevant details.
Example request:
curl --request GET \
--get "https://api.teachfloor.com/v0/members?page=2" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.teachfloor.com/v0/members',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'query' => [
'page'=> '2',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/members"
);
const params = {
"page": "2",
};
Object.keys(params)
.forEach(key => url.searchParams.append(key, params[key]));
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"data": [
{
"id": "e7W6kP8wvjd3GRBz",
"object": "member",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"avatar": null,
"email": null,
"is_email_verified": false,
"last_seen": "2024-01-22T12:56:04.000000Z"
},
{...},
{...}
],
"pagination": {
"total": 152,
"count": 10,
"per_page": 10,
"current_page": 1,
"total_pages": 16
}
}
}
Received response:
Request failed with error:
Create a Member
Requires Authentication
Create a member in your organization.
Example request:
curl --request POST \
"https://api.teachfloor.com/v0/members" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"john.doe@example.com\",
\"password\": \"doNotU5e_thiSPassw0rd\",
\"first_name\": \"John\",
\"last_name\": \"Doe\",
\"role\": \"lecturer\",
\"avatar\": \"https:\\/\\/example.com\\/avatar.png\"
}"
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.teachfloor.com/v0/members',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'john.doe@example.com',
'password' => 'doNotU5e_thiSPassw0rd',
'first_name' => 'John',
'last_name' => 'Doe',
'role' => 'lecturer',
'avatar' => 'https://example.com/avatar.png',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/members"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "john.doe@example.com",
"password": "doNotU5e_thiSPassw0rd",
"first_name": "John",
"last_name": "Doe",
"role": "lecturer",
"avatar": "https:\/\/example.com\/avatar.png"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"id": "e7W6kP8wvjd3GRBz",
"object": "member",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"avatar": null,
"email": "john.doe@example.com",
"is_email_verified": false,
"last_seen": "2024-01-22T12:56:04.000000Z"
}
}
Received response:
Request failed with error:
List all Member Courses
Requires Authentication
Returns a list of courses the member belongs to.
Example request:
curl --request GET \
--get "https://api.teachfloor.com/v0/members/e7W6kP8wvjd3GRBz/courses" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json"
$client = new \GuzzleHttp\Client();
$response = $client->get(
'https://api.teachfloor.com/v0/members/e7W6kP8wvjd3GRBz/courses',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/members/e7W6kP8wvjd3GRBz/courses"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
fetch(url, {
method: "GET",
headers,
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"data": [
{
"id": "6jO9XN7mZEVpvxqo",
"object": "course_member",
"joined_at": "2024-01-22T12:56:04.000000Z",
"member": {
"id": "e7W6kP8wvjd3GRBz",
"object": "member",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"avatar": null,
"email": null,
"is_email_verified": false,
"last_seen": "2024-01-22T12:56:04.000000Z"
},
"course": {
"id": "p5v87ERWKR3dkjyD",
"object": "course",
"name": "Ultimate Marketing Course",
"created_at": "2022-02-03T16:06:42.000000Z",
"cover": null,
"availability": "CONTINUOUS",
"visibility": "PRIVATE",
"start_date": null,
"end_date": null,
"currency": "eur",
"price": null,
"url": null,
"public_url": null,
"join_url": null,
"metadata": {}
},
"custom_fields": {
"field_1": {
"key": "field_1",
"object": "custom-field",
"created_at": "2024-07-30T16:05:47.000000Z",
"name": "Multiple Field Question",
"description": null,
"type": "MULTIPLE_OPTIONS",
"options": [
"Option A",
"Option B",
"Option C"
],
"required": false
}
}
},
{...},
{...}
],
"pagination": {
"total": 15,
"count": 5,
"per_page": 10,
"current_page": 1,
"total_pages": 2
}
}
}
Received response:
Request failed with error:
Update a Member
Requires Authentication
Updates the details of an existing member in your organization based on the provided unique member ID. Any parameters not provided will be left unchanged. Returns the updated member details upon successful update.
Example request:
curl --request POST \
"https://api.teachfloor.com/v0/members/p5v87ERWKR3dkjyD" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"john.doe@example.com\",
\"password\": \"doNotU5e_thiSPassw0rd\",
\"first_name\": \"tm7v$7ER9KR4dk*yD\",
\"last_name\": \"Doe\",
\"avatar\": \"https:\\/\\/example.com\\/avatar.png\"
}"
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.teachfloor.com/v0/members/p5v87ERWKR3dkjyD',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'john.doe@example.com',
'password' => 'doNotU5e_thiSPassw0rd',
'first_name' => 'tm7v$7ER9KR4dk*yD',
'last_name' => 'Doe',
'avatar' => 'https://example.com/avatar.png',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/members/p5v87ERWKR3dkjyD"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "john.doe@example.com",
"password": "doNotU5e_thiSPassw0rd",
"first_name": "tm7v$7ER9KR4dk*yD",
"last_name": "Doe",
"avatar": "https:\/\/example.com\/avatar.png"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"id": "e7W6kP8wvjd3GRBz",
"object": "member",
"first_name": "John",
"last_name": "Doe",
"full_name": "John Doe",
"avatar": null,
"email": "john.doe@example.com",
"is_email_verified": false,
"last_seen": "2024-01-22T12:56:04.000000Z"
}
}
Received response:
Request failed with error:
Modules
Create a module
Requires Authentication
Create a module in the specified course. Returns the created module details upon successful creation.
Example request:
curl --request POST \
"https://api.teachfloor.com/v0/modules" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Ultimate Marketing Module\",
\"course\": \"e7W6kP8wvjd3GRBz\",
\"availability\": \"CONTINUOUS\",
\"start_date\": \"2025-02-17T00:00:00Z\",
\"end_date\": \"2025-03-17T00:00:00Z\",
\"metadata\": {
\"category\": \"marketing\",
\"level\": \"advanced\"
}
}"
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.teachfloor.com/v0/modules',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Ultimate Marketing Module',
'course' => 'e7W6kP8wvjd3GRBz',
'availability' => 'CONTINUOUS',
'start_date' => '2025-02-17T00:00:00Z',
'end_date' => '2025-03-17T00:00:00Z',
'metadata' => [
'category' => 'marketing',
'level' => 'advanced',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/modules"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Ultimate Marketing Module",
"course": "e7W6kP8wvjd3GRBz",
"availability": "CONTINUOUS",
"start_date": "2025-02-17T00:00:00Z",
"end_date": "2025-03-17T00:00:00Z",
"metadata": {
"category": "marketing",
"level": "advanced"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"id": "e7W6kP8wvjd3GRBz",
"object": "module",
"created_at": "2024-01-22T12:56:04.000000Z",
"name": "Example module",
"type": "LESSON",
"availability": CONTINUOUS,
"position": 1,
"course": p5v87ERWKR3dkjyD,
"metadata": {},
}
}
Received response:
Request failed with error:
Update a module
Requires Authentication
Updates the details of an existing module based on the provided unique module ID. Any parameters not provided will be left unchanged. Returns the updated module details upon successful update.
Example request:
curl --request POST \
"https://api.teachfloor.com/v0/modules/p5v87ERWKR3dkjyD" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"name\": \"Ultimate Marketing Module\",
\"availability\": \"CONTINUOUS\",
\"start_date\": \"2025-02-17T00:00:00Z\",
\"end_date\": \"2025-03-17T00:00:00Z\",
\"metadata\": {
\"category\": \"marketing\",
\"level\": \"advanced\"
}
}"
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.teachfloor.com/v0/modules/p5v87ERWKR3dkjyD',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'name' => 'Ultimate Marketing Module',
'availability' => 'CONTINUOUS',
'start_date' => '2025-02-17T00:00:00Z',
'end_date' => '2025-03-17T00:00:00Z',
'metadata' => [
'category' => 'marketing',
'level' => 'advanced',
],
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/modules/p5v87ERWKR3dkjyD"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"name": "Ultimate Marketing Module",
"availability": "CONTINUOUS",
"start_date": "2025-02-17T00:00:00Z",
"end_date": "2025-03-17T00:00:00Z",
"metadata": {
"category": "marketing",
"level": "advanced"
}
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"id": "e7W6kP8wvjd3GRBz",
"object": "module",
"created_at": "2024-01-22T12:56:04.000000Z",
"name": "Example module",
"type": "LESSON",
"availability": CONTINUOUS,
"position": 1,
"course": p5v87ERWKR3dkjyD,
"metadata": {},
}
}
Received response:
Request failed with error:
Organization
Revoke Organization Access
Requires Authentication
Revoke a member access from organization.
Example request:
curl --request POST \
"https://api.teachfloor.com/v0/revoke" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"member\": \"e7W6kP8wvjd3GRBz\"
}"
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.teachfloor.com/v0/revoke',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'member' => 'e7W6kP8wvjd3GRBz',
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/revoke"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"member": "e7W6kP8wvjd3GRBz"
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": null
}
Received response:
Request failed with error:
Invite Member
Requires Authentication
Invite a member to join the organization or course.
Example request:
curl --request POST \
"https://api.teachfloor.com/v0/invites" \
--header "Authorization: Bearer {YOUR_API_KEY}" \
--header "Content-Type: application/json" \
--header "Accept: application/json" \
--data "{
\"email\": \"john.doe@example.com\",
\"full_name\": \"John Doe\",
\"role\": \"customer\",
\"discount_percentage\": 100,
\"course\": \"e7W6kP8wvjd3GRBz\",
\"skip_email\": false
}"
$client = new \GuzzleHttp\Client();
$response = $client->post(
'https://api.teachfloor.com/v0/invites',
[
'headers' => [
'Authorization' => 'Bearer {YOUR_API_KEY}',
'Content-Type' => 'application/json',
'Accept' => 'application/json',
],
'json' => [
'email' => 'john.doe@example.com',
'full_name' => 'John Doe',
'role' => 'customer',
'discount_percentage' => 100,
'course' => 'e7W6kP8wvjd3GRBz',
'skip_email' => false,
],
]
);
$body = $response->getBody();
print_r(json_decode((string) $body));
const url = new URL(
"https://api.teachfloor.com/v0/invites"
);
const headers = {
"Authorization": "Bearer {YOUR_API_KEY}",
"Content-Type": "application/json",
"Accept": "application/json",
};
let body = {
"email": "john.doe@example.com",
"full_name": "John Doe",
"role": "customer",
"discount_percentage": 100,
"course": "e7W6kP8wvjd3GRBz",
"skip_email": false
};
fetch(url, {
method: "POST",
headers,
body: JSON.stringify(body),
}).then(response => response.json());
Example response (200):
{
"error": null,
"payload": {
"id": "R8dXqkpL1BaJl92y",
"object": "invite",
"token": "PgvInCUzTnNuTYpYWb2c",
"url": null,
"full_name": "John Doe",
"role": "customer",
"discount_percentage": 0,
"course": null,
"skip_email": false
}
}
Received response:
Request failed with error:
Webhooks
Teachfloor uses webhooks to notify your application when an event happens in your account. Webhooks are particularly useful for asynchronous events like when a new member joins a course, a member has completed an element, or when a course is updated.
You can start receiving event notifications by adding your own webhook endpoint in Developers > Webhooks and clicking on Add Endpoint.
Webhook Retries
Teachfloor webhooks have built-in retry methods for 3xx
, 4xx
, or 5xx
response status codes. If Teachfloor doesn’t quickly receive a 2xx
response status code for an event, we will retry calling the webhook after 10 seconds. If that second attempt fails, we will attempt to call the webhook a final time after 100 seconds.
Webhook Signature
Signature verification example:
/**
* Generate the signature using the signing
* secret and the webhook content
*/
$generatedSignature = hash_hmac('sha256', $request->getContent(), $webhookSigningSecret);
/**
* Compare the generated signature with the received
* Teachfloor-Signature header to determine if the
* webhook event is legit
*/
if ($generatedSignature !== $headerSignature) {
/**
* Verification failed
*/
return false;
}
/**
* Legit event, use the webhook content...
*/
Teachfloor will sign the webhook events it sends to your endpoints by including a signature in each event’s Teachfloor-Signature
header. This allows you to verify that the events were sent by Teachfloor, not by a third party.
To verify the webhook event signatures, you need to retrieve your endpoint’s secret from your Webhook Endpoints settings. Select an endpoint that you want to obtain the secret for, then click the Reveal Signing Secret button.
Signatures are generated using a hash-based message authentication code (HMAC) with SHA-256. Use the endpoint’s signing secret as the key, convert the event payload to json format and use it as the message in your HMAC-SHA256 function. Compare the generated signature with the received Teachfloor-Signature
header to determine if the webhook event is legit.