Table of Contents
Authentication REST API WordPress
Authentication
Rest API
Schema
The schema defines all the fields that exist within a course record. Any response from these endpoints can be expected to contain the fields below unless the `_filter` query parameter is used or the schema field only appears in a specific context.
date
string, null, datetime (details)
view
, edit
, embed
date_gmt
string, null, datetime (details)
The date the object was published, as GMT.Context:view
, edit
guid
object
The globally unique identifier for the object. Read only. Context: view
, edit
id
integer
view
, edit
, embed
link
string, uri
URL to the object. Read only. Context: view
, edit
, embed
modified
string, datetime (details)
The date the object was last modified, in the site’s timezone. Read only. Context: view
, edit
modified_gmt
string, datetime (details)
The date the object was last modified, as GMT. Read only. Context: view
, edit
slug
string
An alphanumeric identifier for the object unique to its type. Context: view
, edit
, embed
status
string
A named status for the object. Context: view
, edit
One Of: publish
, future
, draft
, pending
, private
, graded
, not_graded
type
string
Type of Post for the object. Read only. Context: view
, edit
, embed
password
string
A password to protect access to the content and excerpt. Context: edit
permalink_template
string
Permalink template for the object. Read only. Context: edit
generated_slug
string
Slug automatically generated from the object title. Read only. Context: edit
title
object
The title for the object. Context: view
, edit
, embed
content
object
The content for the object. Context: view
, edit
author
integer
The ID for the author of the object. Context: view
, edit
, embed
featured_media
integer
The ID of the featured media for the object. Context: view
, edit
, embed
comment_status
string
Whether or not comments are open on the object. Context: view
, edit
One of: open
, closed
ping_status
string
Whether or not the object can be pinged. Context: view
, edit
One of: open
, closed
menu_order
integer
The order of the object in relation to other object of its type. Context: view
, edit
template
string
The theme file to use to display the object. Context: view
, edit
categories
array
The terms assigned to the object in the category taxonomy. Context: view
, edit
tags
array
The terms assigned to the object in the post_tag taxonomy. Context: view
, edit
ld_course_category
array
The terms assigned to the object in the ld_course_category taxonomy. Context: view
, edit
ld_course_tag
array
The terms assigned to the object in the ld_course_tag taxonomy. Context: view
, edit
course_materials
html
Course Materials. Context: view
, edit
course_price_type
string
Course Price Type. Context: view
, edit
One of: open
, closed
, free
, buynow
, subscribe
custom_button_label
text
Custom Button Label. Context: view
, edit
custom_button_url
text
Custom Button URL. Context: view
, edit
course_price
text
Course Price. Context: view
, edit
course_prerequisite_enabled
boolean
Enable Course Prerequisites. Context: view
, edit
course_prerequisite
array
Course Prerequisites. Context: view
, edit
course_prerequisite_compare
string
Course Prerequisites Compare. Context: view
, edit
One of: ANY
, ALL
course_points_enabled
boolean
Enable Course Points. Context: view
, edit
course_points
number
Course Points. Context: view
, edit
course_points_access
number
Course Points Access. Context: view
, edit
course_disable_lesson_progression
boolean
Disable Lesson Progression. Context: view
, edit
expire_access
boolean
Expire Access. Context: view
, edit
expire_access_days
number
Expire Access After (days). Context: view
, edit
expire_access_delete_progress
boolean
Delete Course and Quiz Data After Expiration. Context: view
, edit
List Courses
Query this endpoint to retrieve a collection of courses. The response you receive can be controlled and filtered using the URL query parameters below.
Definition
GET /ldlms/v1/sfwd-courses
Example Request
$ curl https://example.com/wp-json/ldlms/v1/sfwd-courses
Arguments
context
Scope under which the request is made; determines fields present in response. Default: view
One of: view
, embed
, edit
page
Current page of the collection. Default: 1
per_page
Maximum number of items to be returned in result set. Default: 10
search
Limit results to those matching a string.
after
Limit response to posts published after a given ISO8601 compliant date.
modified_after
Limit response to posts modified after a given ISO8601 compliant date.
author
Limit result set to posts assigned to specific authors.
author_exclude
Ensure result set excludes posts assigned to specific authors.
before
Limit response to posts published before a given ISO8601 compliant date.
modified_before
Limit response to posts modified before a given ISO8601 compliant date.
exclude
Ensure result set excludes specific IDs.
include
Limit result set to specific IDs.
menu_order
Limit result set to posts with a specific menu_order value.
offset
Offset the result set by a specific number of items.
order
Order sort attribute ascending or descending. Default: asc
One of: asc
, desc
orderby
Sort collection by object attribute. Default: title
One of: author
, date
, id
, include
, modified
, parent
,relevance
, slug
, include_slugs
, title
, menu_order
slug
Limit result set to posts with one or more specific slugs.
status
Limit result set to posts assigned one or more statuses. Default: publish
tax_relation
Limit result set based on relationship between multiple taxonomies. One of: AND
, OR
categories
Limit result set to items with specific terms assigned in the categories taxonomy.
categories_exclude
Limit result set to items except those with specific terms assigned in the categories taxonomy.
tags
Limit result set to items with specific terms assigned in the tags taxonomy.
tags_exclude
Limit result set to items except those with specific terms assigned in the tags taxonomy.
ld_course_category
Limit result set to items with specific terms assigned in the ld_course_category taxonomy.
ld_course_category_exclude
Limit result set to items except those with specific terms assigned in the ld_course_category taxonomy.
ld_course_tag
Limit result set to items with specific terms assigned in the ld_course_tag taxonomy.
ld_course_tag_exclude
Limit result set to items except those with specific terms assigned in the ld_course_tag taxonomy.
Course Users
Schema
The schema defines all the fields that exist within a course user record. Any response from these endpoints can be expected to contain the fields below unless the `_filter` query parameter is used or the schema field only appears in a specific context.
id
integer
Unique identifier for the object. Read only. Context: view
, edit
, embed
user_ids
array
The user IDs. Limit 50 per request. Context: view
, edit
List Course Users
Query this endpoint to retrieve a collection of course users. The response you receive can be controlled and filtered using the URL query parameters below.
Definition
GET /ldlms/v1/sfwd-courses//users
Example Request
$ curl https://example.com/wp-json/ldlms/v1/sfwd-courses//users
Arguments
id
Course ID. Required: 1
context
Scope under which the request is made; determines fields present in response. Default: view
One of: view
, embed
, edit
fields
Returned values. Default: ids
One of: ids
, objects
exclude
Ensure result set excludes specific IDs.
include
Limit result set to specific IDs.
offset
Offset the result set by a specific number of items.
order
Order sort attribute ascending or descending. Default: asc
One of: asc
, desc
page
Current page of the collection. Default: 1
per_page
Maximum number of items to be returned in result set. Default: 10
search
Limit results to those matching a string.
roles
Limit result set to users matching at least one specific role provided. Accepts csv list or single role.
slug
Limit result set to users with one or more specific slugs.
Update a Course User
Definition
POST /ldlms/v1/sfwd-courses//users
Example Request
$ curl -X POST https://example.com/wp-json/ldlms/v1/sfwd-courses//users -d '{"user_ids":[ 1,2 ]}'
Arguments
id
Course ID. Required: 1
user_ids
User IDs to enroll into course. Limit 50 per request. Required: 1
Delete a Course User
Definition
DELETE /ldlms/v1/sfwd-courses//users
Example Request
$ curl -X DELETE https://example.com/wp-json/ldlms/v1/sfwd-courses//users
Arguments
id
Course ID. Required: 1
user_ids
User IDs to remove from group. Limit 50 per request. Required: 1
Lessons
Schema
The schema defines all the fields that exist within a lesson record. Any response from these endpoints can be expected to contain the fields below unless the `_filter` query parameter is used or the schema field only appears in a specific context.
date
string, null, datetime (details)
view
, edit
, embed
date_gmt
string, null, datetime (details)
The date the object was published, as GMT.Context:view
, edit
guid
object
The globally unique identifier for the object. Read only. Context: view
, edit
id
integer
view
, edit
, embed
link
string, uri
URL to the object. Read only. Context: view
, edit
, embed
modified
string, datetime (details)
The date the object was last modified, in the site’s timezone. Read only. Context: view
, edit
modified_gmt
string, datetime (details)
The date the object was last modified, as GMT. Read only. Context: view
, edit
slug
string
An alphanumeric identifier for the object unique to its type. Context: view
, edit
, embed
status
string
A named status for the object. Context: view
, edit
One Of: publish
, future
, draft
, pending
, private
, graded
, not_graded
type
string
Type of Post for the object. Read only. Context: view
, edit
, embed
password
string
A password to protect access to the content and excerpt. Context: edit
permalink_template
string
Permalink template for the object. Read only. Context: edit
generated_slug
string
Slug automatically generated from the object title. Read only. Context: edit
title
object
The title for the object. Context: view
, edit
, embed
content
object
The content for the object. Context: view
, edit
author
integer
The ID for the author of the object. Context: view
, edit
, embed
featured_media
integer
The ID of the featured media for the object. Context: view
, edit
, embed
comment_status
string
Whether or not comments are open on the object. Context: view
, edit
One of: open
, closed
ping_status
string
Whether or not the object can be pinged. Context: view
, edit
One of: open
, closed
menu_order
integer
The order of the object in relation to other object of its type. Context: view
, edit
meta
object
Meta fields. Context: view
, edit
template
string
The theme file to use to display the object. Context: view
, edit
categories
array
The terms assigned to the object in the category taxonomy. Context: view
, edit
tags
array
The terms assigned to the object in the post_tag taxonomy. Context: view
, edit
ld_lesson_category
array
The terms assigned to the object in the ld_lesson_category taxonomy. Context: view
, edit
ld_lesson_tag
array
The terms assigned to the object in the ld_lesson_tag taxonomy. Context: view
, edit
lesson_materials
html
Lesson Materials. Context: view
, edit
forced_lesson_time
text
Forced Lesson Timer. Context: view
, edit
lesson_assignment_upload
boolean
Upload Assignment. Context: view
, edit
auto_approve_assignment
boolean
Auto Approve Assignment. Context: view
, edit
assignment_upload_limit_count
number
Limit number of uploaded files. Context: view
, edit
lesson_assignment_deletion_enabled
boolean
Allow Student to Delete own Assignment(s). Context: view
, edit
lesson_assignment_points_enabled
boolean
Award Points for Assignment. Context: view
, edit
lesson_assignment_points_amount
number
Set Number of Points for Assignment. Context: view
, edit
assignment_upload_limit_extensions
text
Allowed File Extensions. Context: view
, edit
assignment_upload_limit_size
text
Allowed File Size. Context: view
, edit
visible_after
number
Make Lesson visible X Days After Sign-up. Context: view
, edit
visible_after_specific_date
wp_date_selector
Make Lesson Visible on Specific Date. Context: view
, edit
List Lessons
Query this endpoint to retrieve a collection of lessons. The response you receive can be controlled and filtered using the URL query parameters below.
Definition
GET /ldlms/v1/sfwd-lessons
Example Request
$ curl https://example.com/wp-json/ldlms/v1/sfwd-lessons
Arguments
context
Scope under which the request is made; determines fields present in response. Default: view
One of: view
, embed
, edit
page
Current page of the collection. Default: 1
per_page
Maximum number of items to be returned in result set. Default: 10
search
Limit results to those matching a string.
after
Limit response to posts published after a given ISO8601 compliant date.
modified_after
Limit response to posts modified after a given ISO8601 compliant date.
author
Limit result set to posts assigned to specific authors.
author_exclude
Ensure result set excludes posts assigned to specific authors.
before
Limit response to posts published before a given ISO8601 compliant date.
modified_before
Limit response to posts modified before a given ISO8601 compliant date.
exclude
Ensure result set excludes specific IDs.
include
Limit result set to specific IDs.
menu_order
Limit result set to posts with a specific menu_order value.
offset
Offset the result set by a specific number of items.
order
Order sort attribute ascending or descending. Default: asc
One of: asc
, desc
orderby
Sort collection by object attribute. Default: title
One of: author
, date
, id
, include
, modified
, parent
,relevance
, slug
, include_slugs
, title
, menu_order
slug
Limit result set to posts with one or more specific slugs.
status
Limit result set to posts assigned one or more statuses. Default: publish
tax_relation
Limit result set based on relationship between multiple taxonomies. One of: AND
, OR
categories
Limit result set to items with specific terms assigned in the categories taxonomy.
categories_exclude
Limit result set to items except those with specific terms assigned in the categories taxonomy.
tags
Limit result set to items with specific terms assigned in the tags taxonomy.
tags_exclude
Limit result set to items except those with specific terms assigned in the tags taxonomy.
ld_lesson_category
Limit result set to items with specific terms assigned in the ld_lesson_category taxonomy.
ld_lesson_category_exclude
Limit result set to items except those with specific terms assigned in the ld_lesson_category taxonomy.
ld_lesson_tag
Limit result set to items with specific terms assigned in the ld_lesson_tag taxonomy.
ld_lesson_tag_exclude
Limit result set to items except those with specific terms assigned in the ld_lesson_tag taxonomy.
course
Limit results to be within a specific Course. Required for non-admin users.
Questions
Schema
The schema defines all the fields that exist within a question record. Any response from these endpoints can be expected to contain the fields below unless the `_filter` query parameter is used or the schema field only appears in a specific context.
_id
integer
Unique identifier for the object. Read only. Context: view
, edit
, embed
_quizId
integer
The ID of the quiz associated with the question. Read only. Context: view
, edit
, embed
_sort
integer
The order of the question in the quiz. Context: view
, edit
_title
string
The title for the object. Context: view
, edit
_question
string
The question content. Context: view
, edit
_correctMsg
string
The message to show when the answer is correct. Context: view
, edit
_incorrectMsg
string
The message to show when the answer is incorrect. Context: view
, edit
_correctSameText
boolean
Whether the incorrect and correct message are same.
Context: view
, edit
_tipEnabled
boolean
The message to show when the answer is incorrect. Context: view
, edit
_tipMsg
string
The solution hint for the question. Context: view
, edit
_points
boolean
The total number of points that can be obtained from the question. Context: view
, edit
_showPointsInBox
boolean
Whether to show points in box. Context: view
, edit
_answerPointsActivated
boolean
Whether the individual points for the answers are activated. Context: view
, edit
_answerType
string
The type of the answer. Context: view
, edit
One of: single
, multiple
, free_answer
, sort_answer
,
matrix_sort_answer
, cloze_answer
, essay
, assessment_answer
_answerPointsDiffModusActivated
boolean, null
Whether the different points modus is activated. Context: view
, edit
_disableCorrect
boolean
Whether to distinguish between correct and incorrect when the different point modus is activated. Context: view
, edit
_matrixSortAnswerCriteriaWidth
integer
The percentage width of the criteria table column for matrix sort answer. Context: view
, edit
_answerData
array
An array of answer data objects. Context: view
, edit
question_id
integer
The question post ID. Read only. Context: view
, edit
, embed
question_post_title
string
The question post title. Context: view
, edit
Retrieve a Question
Definition
GET /ldlms/v1/sfwd-questions/
//Query this endpoint to retrieve a specific question record.
Example Request
$ curl https://example.com/wp-json/ldlms/v1/sfwd-questions/
Sample Response
{
"_id": 429,
"_quizId": 46,
"_sort": 1,
"_title": "Question: 1",
"_question": "In this video Fein states at 1:34 "We often relate to the body as an instrument that helps bring what's happening in our minds into the world, and often this relationship is ______." ",
"_correctMsg": "Nice job.",
"_incorrectMsg": "See the correct answer highlighted in green above.",
"_correctSameText": false,
"_tipEnabled": false,
"_tipMsg": "",
"_points": 1,
"_showPointsInBox": false,
"_answerPointsActivated": false,
"_answerType": "single",
"_answerPointsDiffModusActivated": null,
"_disableCorrect": false,
"_matrixSortAnswerCriteriaWidth": 20,
"_answerData": [
{
"_answer": "a. Painful",
"_html": false,
"_points": 0,
"_correct": false,
"_sortString": "",
"_sortStringHtml": false,
"_graded": false,
"_gradingProgression": "not-graded-none",
"_gradedType": null
},
{
"_answer": "b. Problematic",
"_html": false,
"_points": 0,
"_correct": false,
"_sortString": "",
"_sortStringHtml": false,
"_graded": false,
"_gradingProgression": "not-graded-none",
"_gradedType": null
},
{
"_answer": "c. Superficial",
"_html": false,
"_points": 0,
"_correct": true,
"_sortString": "",
"_sortStringHtml": false,
"_graded": false,
"_gradingProgression": "not-graded-none",
"_gradedType": null
},
{
"_answer": "d. Stupid",
"_html": false,
"_points": 0,
"_correct": false,
"_sortString": "",
"_sortStringHtml": false,
"_graded": false,
"_gradingProgression": "not-graded-none",
"_gradedType": null
}
],
"question_id": 82968,
"question_post_title": "Question: 1"
}
Arguments
id
The question ID. Required: 1
Update a Question
Definition
POST /ldlms/v1/sfwd-questions/
Example Request
$ curl -X POST https://example.com/wp-json/ldlms/v1/sfwd-questions/ -d '{"_title":"Question title"}'
Arguments
id
The question ID. Required: 1
Update a Question
Definition
DELETE /ldlms/v1/sfwd-questions/
Example Request
$ curl -X DELETE https://example.com/wp-json/ldlms/v1/sfwd-questions/
Arguments
id
The question ID. Required: 1
User Courses
Schema
The schema defines all the fields that exist within a user course record. Any response from these endpoints can be expected to contain the fields below unless the `_filter` query parameter is used or the schema field only appears in a specific context.
_id
integer
Unique identifier for the object. Read only. Context: view
, edit
, embed
course_ids
array
The course IDs. Context: view
, edit
List User Courses
Query this endpoint to retrieve a collection of user courses. The response you receive can be controlled and filtered using the URL query parameters below.
Definition
GET /ldlms/v1/users//courses
Example Request
$ curl https://example.com/wp-json/ldlms/v1/users//courses
Arguments
id
User ID to enroll user into. Required: 1
context
Scope under which the request is made; determines fields present in response. Default: view
One of: view
, embed
, edit
fields
Returned values. Default: ids
One of: ids
, objects
exclude
Ensure result set excludes specific IDs.
include
Limit result set to specific IDs.
offset
Offset the result set by a specific number of items.
order
Order sort attribute ascending or descending. Default: asc
One of: asc
, desc
orderby
Sort collection by object attribute. Default: title
One of: author
, date
, id
, include
, modified
, parent
,
relevance
, slug
, include_slugs
, title
, menu_order
per_page
Maximum number of items to be returned in result set. Default: 10
page
Current page of the collection. Default: 1
search
Limit results to those matching a string.
Update a User Course
Definition
POST /ldlms/v1/users//courses
Example Request
$ curl -X POST https://example.com/wp-json/ldlms/v1/users//courses -d '{"course_ids":[ 1,2 ]}'
Arguments
id
User ID to enroll user into. Required: 1
course_ids
Courses IDs to add to User. Required: 1
Delete a User Course
Definition
DELETE /ldlms/v1/users//courses
Example Request
$ curl -X DELETE https://example.com/wp-json/ldlms/v1/users//courses
Arguments
id
User ID to enroll user into. Required: 1
course_ids
Courses IDs to remove from User. Required: 1