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)

The date the object was published, in the site’s timezone. Context: vieweditembed

date_gmt
string, null, datetime (details)

The date the object was published, as GMT.Context:viewedit

guid
object

The globally unique identifier for the object. Read only. Context: viewedit

id
integer

Unique identifier for the object. Read only. Context: vieweditembed

link
string, uri

URL to the object. Read only. Context: vieweditembed

modified
string, datetime (details)

The date the object was last modified, in the site’s timezone. Read only. Context: viewedit

modified_gmt
string, datetime (details)

The date the object was last modified, as GMT. Read only. Context: viewedit

slug
string

An alphanumeric identifier for the object unique to its type. Context: vieweditembed

status
string

A named status for the object. Context: viewedit

One Of: publishfuturedraftpendingprivategradednot_graded

type
string

Type of Post for the object. Read only. Context: vieweditembed

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: vieweditembed

content
object

The content for the object. Context: viewedit

author
integer

The ID for the author of the object. Context: vieweditembed

featured_media
integer

The ID of the featured media for the object. Context: vieweditembed

comment_status
string

Whether or not comments are open on the object. Context: viewedit

One of: openclosed

ping_status
string

Whether or not the object can be pinged. Context: viewedit

One of: openclosed

menu_order
integer

The order of the object in relation to other object of its type. Context: viewedit

template
string

The theme file to use to display the object. Context: viewedit

categories
array

The terms assigned to the object in the category taxonomy. Context: viewedit

tags
array

The terms assigned to the object in the post_tag taxonomy. Context: viewedit

ld_course_category
array

The terms assigned to the object in the ld_course_category taxonomy. Context: viewedit

ld_course_tag
array

The terms assigned to the object in the ld_course_tag taxonomy. Context: viewedit

course_materials
html

Course Materials. Context: viewedit

course_price_type
string

Course Price Type. Context: viewedit

One of: openclosedfreebuynowsubscribe

custom_button_label
text

Custom Button Label. Context: viewedit

custom_button_url
text

Custom Button URL. Context: viewedit

course_price
text

Course Price. Context: viewedit

course_prerequisite_enabled
boolean

Enable Course Prerequisites. Context: viewedit

course_prerequisite
array

Course Prerequisites. Context: viewedit

course_prerequisite_compare
string

Course Prerequisites Compare. Context: viewedit

One of: ANYALL

course_points_enabled
boolean

Enable Course Points. Context: viewedit

course_points
number

Course Points. Context: viewedit

course_points_access
number

Course Points Access. Context: viewedit

course_disable_lesson_progression
boolean

Disable Lesson Progression. Context: viewedit

expire_access
boolean

Expire Access. Context: viewedit

expire_access_days
number

Expire Access After (days). Context: viewedit

expire_access_delete_progress
boolean

Delete Course and Quiz Data After Expiration. Context: viewedit

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: viewembededit

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: ascdesc

orderby

Sort collection by object attribute. Default: title

One of: authordateidincludemodifiedparent,
relevancesluginclude_slugstitlemenu_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: ANDOR

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: vieweditembed

user_ids
array

The user IDs. Limit 50 per request. Context: viewedit

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/<id>/users
				
			

Example Request

				
					$ curl https://example.com/wp-json/ldlms/v1/sfwd-courses/<id>/users
				
			

Arguments

id

Course ID. Required: 1

context

Scope under which the request is made; determines fields present in response. Default: view

One of: viewembededit

fields

Returned values. Default: ids

One of: idsobjects

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: ascdesc

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/<id>/users
				
			

Example Request

				
					$ curl -X POST https://example.com/wp-json/ldlms/v1/sfwd-courses/<id>/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/<id>/users
				
			

Example Request

				
					$ curl -X DELETE https://example.com/wp-json/ldlms/v1/sfwd-courses/<id>/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)

The date the object was published, in the site’s timezone. Context: vieweditembed

date_gmt
string, null, datetime (details)

The date the object was published, as GMT.Context:viewedit

guid
object

The globally unique identifier for the object. Read only. Context: viewedit

id
integer

Unique identifier for the object. Read only. Context: vieweditembed

link
string, uri

URL to the object. Read only. Context: vieweditembed

modified
string, datetime (details)

The date the object was last modified, in the site’s timezone. Read only. Context: viewedit

modified_gmt
string, datetime (details)

The date the object was last modified, as GMT. Read only. Context: viewedit

slug
string

An alphanumeric identifier for the object unique to its type. Context: vieweditembed

status
string

A named status for the object. Context: viewedit

One Of: publishfuturedraftpendingprivategradednot_graded

type
string

Type of Post for the object. Read only. Context: vieweditembed

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: vieweditembed

content
object

The content for the object. Context: viewedit

author
integer

The ID for the author of the object. Context: vieweditembed

featured_media
integer

The ID of the featured media for the object. Context: vieweditembed

comment_status
string

Whether or not comments are open on the object. Context: viewedit

One of: openclosed

ping_status
string

Whether or not the object can be pinged. Context: viewedit

One of: openclosed

menu_order
integer

The order of the object in relation to other object of its type. Context: viewedit

meta
object

Meta fields. Context: viewedit

template
string

The theme file to use to display the object. Context: viewedit

categories
array

The terms assigned to the object in the category taxonomy. Context: viewedit

tags
array

The terms assigned to the object in the post_tag taxonomy. Context: viewedit

ld_lesson_category
array

The terms assigned to the object in the ld_lesson_category taxonomy. Context: viewedit

ld_lesson_tag
array

The terms assigned to the object in the ld_lesson_tag taxonomy. Context: viewedit

lesson_materials
html

Lesson Materials. Context: viewedit

forced_lesson_time
text

Forced Lesson Timer. Context: viewedit

lesson_assignment_upload
boolean

Upload Assignment. Context: viewedit

auto_approve_assignment
boolean

Auto Approve Assignment. Context: viewedit

assignment_upload_limit_count
number

Limit number of uploaded files. Context: viewedit

lesson_assignment_deletion_enabled
boolean

Allow Student to Delete own Assignment(s). Context: viewedit

lesson_assignment_points_enabled
boolean

Award Points for Assignment. Context: viewedit

lesson_assignment_points_amount
number

Set Number of Points for Assignment. Context: viewedit

assignment_upload_limit_extensions
text

Allowed File Extensions. Context: viewedit

assignment_upload_limit_size
text

Allowed File Size. Context: viewedit

visible_after
number

Make Lesson visible X Days After Sign-up. Context: viewedit

visible_after_specific_date
wp_date_selector

Make Lesson Visible on Specific Date. Context: viewedit

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: viewembededit

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: ascdesc

orderby

Sort collection by object attribute. Default: title

One of: authordateidincludemodifiedparent,
relevancesluginclude_slugstitlemenu_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: ANDOR

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: vieweditembed

_quizId
integer

The ID of the quiz associated with the question. Read only. Context: vieweditembed

_sort
integer

The order of the question in the quiz. Context: viewedit

_title
string

The title for the object. Context: viewedit

_question
string

The question content. Context: viewedit

_correctMsg
string

The message to show when the answer is correct. Context: viewedit

_incorrectMsg
string

The message to show when the answer is incorrect. Context: viewedit

_correctSameText
boolean

Whether the incorrect and correct message are same.

Context: viewedit

_tipEnabled
boolean

The message to show when the answer is incorrect. Context: viewedit

_tipMsg
string

The solution hint for the question. Context: viewedit

_points
boolean

The total number of points that can be obtained from the question. Context: viewedit

_showPointsInBox
boolean

Whether to show points in box. Context: viewedit

_answerPointsActivated
boolean

Whether the individual points for the answers are activated. Context: viewedit

_answerType
string

The type of the answer. Context: viewedit

One of: singlemultiplefree_answersort_answer,

matrix_sort_answercloze_answeressayassessment_answer

_answerPointsDiffModusActivated
boolean, null

Whether the different points modus is activated. Context: viewedit

_disableCorrect
boolean

Whether to distinguish between correct and incorrect when the different point modus is activated. Context: viewedit

_matrixSortAnswerCriteriaWidth
integer

The percentage width of the criteria table column for matrix sort answer. Context: viewedit

_answerData
array

An array of answer data objects. Context: viewedit

question_id
integer

The question post ID. Read only. Context: vieweditembed

question_post_title
string

The question post title. Context: viewedit

Retrieve a Question

Definition

				
					GET /ldlms/v1/sfwd-questions/<id>
    
    //Query this endpoint to retrieve a specific question record.
				
			

Example Request

				
					$ curl https://example.com/wp-json/ldlms/v1/sfwd-questions/<id>
				
			

Sample Response

				
					{
    "_id": 429,
    "_quizId": 46,
    "_sort": 1,
    "_title": "Question: 1",
    "_question": "In this video Fein states at 1:34 <em>"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 ______." </em>",
    "_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/<id>
				
			

Example Request

				
					$ curl -X POST https://example.com/wp-json/ldlms/v1/sfwd-questions/<id> -d '{"_title":"Question title"}'
				
			

Arguments

id

The question ID. Required: 1

Update a Question

Definition

				
					DELETE /ldlms/v1/sfwd-questions/<id>
				
			

Example Request

				
					$ curl -X DELETE https://example.com/wp-json/ldlms/v1/sfwd-questions/<id>
				
			

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: vieweditembed

course_ids
array

The course IDs. Context: viewedit

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/<id>/courses
				
			

Example Request

				
					$ curl https://example.com/wp-json/ldlms/v1/users/<id>/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: viewembededit

fields

Returned values. Default: ids

One of: idsobjects

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: ascdesc

orderby

Sort collection by object attribute. Default: title

One of: authordateidincludemodifiedparent,

relevancesluginclude_slugstitlemenu_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/<id>/courses
				
			

Example Request

				
					$ curl -X POST https://example.com/wp-json/ldlms/v1/users/<id>/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/<id>/courses
				
			

Example Request

				
					$ curl -X DELETE https://example.com/wp-json/ldlms/v1/users/<id>/courses
				
			

Arguments

id

User ID to enroll user into. Required: 1

course_ids

Courses IDs to remove from User. Required: 1