MENU navbar-image

Introduction

List of all API endpoints

Welcome to our API documentation!

Authenticating requests

This API is not authenticated.

Users

You can perform user management tasks like creating, deleting and updating users.

Retrieve Custom User Fields that needs to be shown on the Registration page

Retrieves the details of pre saved Custom User Fields.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/customRegistrationFields" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/customRegistrationFields"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "fields": {
        "user_meta_key_1": {
            "id": 1,
            "type": "text",
            "label": "Gender",
            "defaultValue": null,
            "isRequired": false,
            "optionLabel": [],
            "isFieldOnRegistrationPage": false,
            "isFieldOnCertificate": true,
            "includeInReportExports": [
                "export-users",
                "export-orders"
            ]
        },
        "user_meta_key_2": {
            "id": 2,
            "type": "textarea",
            "label": "What is your home address",
            "defaultValue": null,
            "isRequired": true,
            "optionLabel": [],
            "isFieldOnRegistrationPage": true,
            "isFieldOnCertificate": false,
            "includeInReportExports": []
        }
    }
}
 

Request   

GET api/users/customRegistrationFields

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update the status of a webinar registration for the given user and course.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/update-webinar-status?ids=%5B101%2C+102%2C+103%5D&status=%22approved%22&webinarId=55&portalId=12" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/update-webinar-status"
);

const params = {
    "ids": "[101, 102, 103]",
    "status": ""approved"",
    "webinarId": "55",
    "portalId": "12",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Status Updated Successfully"
}
 

Request   

GET api/users/update-webinar-status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

ids   string   

array The IDs of the course registrations to update. Example: [101, 102, 103]

status   string   

string The new status of the webinar registration. Example: "approved"

webinarId   string   

int The ID of the webinar module. Example: 55

portalId   string   

int The ID of the portal. Example: 12

Update the notes for a webinar registration for the given user and course.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/update-webinar-notes?ids=%5B101%2C+102%2C+103%5D&webinarId=55&portalId=12&notes=%22This+is+a+test+note%22" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/update-webinar-notes"
);

const params = {
    "ids": "[101, 102, 103]",
    "webinarId": "55",
    "portalId": "12",
    "notes": ""This is a test note"",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Notes Updated Successfully"
}
 

Request   

GET api/users/update-webinar-notes

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

ids   string   

array The IDs of the course registrations to update. Example: [101, 102, 103]

webinarId   string   

int The ID of the webinar module. Example: 55

portalId   string   

int The ID of the portal. Example: 12

notes   string   

string The new notes of the webinar registration. Example: "This is a test note"

Get the quizzes for a given user and portal.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/reports/student-quizzes?user_id=1&searchPortalIds=%5B1%2C2%5D&page_number=1&page_size=10&order_by=%7B%22colName%22%3A%22registered_on%22%2C%22direction%22%3A%22desc%22%7D&search_param=%7B%22nameOrEmail%22%3A%22John+Doe%22%2C%22status%22%3A%5B%5D%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/reports/student-quizzes"
);

const params = {
    "user_id": "1",
    "searchPortalIds": "[1,2]",
    "page_number": "1",
    "page_size": "10",
    "order_by": "{"colName":"registered_on","direction":"desc"}",
    "search_param": "{"nameOrEmail":"John Doe","status":[]}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
 "totalNotStarted": int,
 "totalInProgress": int,
 "totalCompleted": int,
 "recordsTotal": int,
 "recordsFiltered": int,
 "records": Array,
 "userDetails": Object
}
 

Example response (200):


{
 "totalNotStarted": 2,
 "totalInProgress": 1,
 "totalCompleted": 1,
 "recordsTotal": 4,
 "recordsFiltered": 4,
 "records": Array,
 "userDetails": Object
}
 

Request   

GET api/user/reports/student-quizzes

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

user_id   string   

int The ID of the user. Example: 1

searchPortalIds   string   

array The IDs of the portals to search in. Example: [1,2]

page_number   string   

int The page number. Example: 1

page_size   string   

int The page size. Example: 10

order_by   string   

object The order by parameters. Example: {"colName":"registered_on","direction":"desc"}

search_param   string   

object The search parameters. Example: {"nameOrEmail":"John Doe","status":[]}

Retrieves a list of portals for a given user.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/portals?userId=1&type=checkout" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/portals"
);

const params = {
    "userId": "1",
    "type": "checkout",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "portals": [
        {
            "id": 1,
            "name": "Portal 1",
            "referralCode": "portal1",
            "userType": "portal_admin",
            "totalSeat": 100,
            "subscriptionId": 1,
            "parentPortalId": 1,
            "slug": "portal-1"
        },
        {
            "id": 2,
            "name": "Portal 2",
            "referralCode": "portal2",
            "userType": "portal_admin",
            "totalSeat": 50,
            "subscriptionId": 2,
            "parentPortalId": 2,
            "slug": "portal-2"
        }
    ],
    "siteLogo": "http://example.com/logo.jpg",
    "baseUrl": "http://example.com"
}
 

Request   

GET api/user/portals

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

userId   string  optional  

optional User ID to filter portals. Example: 1

type   string  optional  

optional The type of user to filter portals. Example: checkout

User Types

Retrieves all the user types in the system like admin, owner, staff, general.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/userType/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/userType/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "admin",
        "display_name": "Admin"
    },
    {
        "db_value": "owner",
        "display_name": "Owner"
    },
    {
        "db_value": "staff",
        "display_name": "Staff"
    },
    {
        "db_value": "general",
        "display_name": "General"
    }
]
 

Request   

GET api/userType/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Tabular List

Retrieves all the users in a tabular list format with pagination mode. You can apply filter using search_param via nameOrEmail, membershipId, userCategoryId.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/tabularlist?page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C%22direction%22%3A%22desc%22%7D&search_param=%7B%22nameOrEmail%22%3A%22John+Doe%22%2C%22membershipId%22%3A1%2C+%22userCategoryId%22%3A1%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/tabularlist"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at","direction":"desc"}",
    "search_param": "{"nameOrEmail":"John Doe","membershipId":1, "userCategoryId":1}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 4,
            "first_name": "John",
            "last_name": "Doe",
            "is_disabled": false,
            "email": "[email protected]",
            "avatar": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"40\" viewBox=\"0 0 40 40\"><circle cx=\"20\" cy=\"20\" r=\"20\" stroke=\"background\" stroke-width=\"0\" fill=\"#03A9F4\" /><text x=\"20\" y=\"20\" font-size=\"14\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">JD</text></svg>",
            "display_type": "General",
            "created_at": "Aug 06, 2020 07:20 AM",
            "last_login": "2 days ago",
            "source": "default",
            "portals": "Portal 1, Portal 2",
            "user_category": "Category 1, Category 2"
        }
    ]
}
 

Request   

GET api/users/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the users you want for a page. Example: 10

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at","direction":"desc"}

search_param   string  optional  

for searching items based on nameOrEmail, membershipId, userCategoryId. Example: {"nameOrEmail":"John Doe","membershipId":1, "userCategoryId":1}

Retrieve Users By Type

Retrieves a list of users filtered by user type and optionally by portal ID.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/getUsersByType?userType=learner&portalId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/getUsersByType"
);

const params = {
    "userType": "learner",
    "portalId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "records": [
        {
            "id": 1,
            "name": "John Doe ([email protected])"
        }
    ]
}
 

Request   

GET api/users/getUsersByType

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

userType   string  optional  

The type of user to filter by. Example: learner

portalId   string  optional  

Optional. The ID of the portal to filter users by. Example: 1

Enables enroll content for a user.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/enableEnrollContent?userId=1&selectedCourseView=%27grid%27&selectedLearningPathView=%27list%27&selectedCourseViewMode=%27enroll%27&selectedLearningPathViewMode=%27enroll%27&type=%27course%27" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/enableEnrollContent"
);

const params = {
    "userId": "1",
    "selectedCourseView": "'grid'",
    "selectedLearningPathView": "'list'",
    "selectedCourseViewMode": "'enroll'",
    "selectedLearningPathViewMode": "'enroll'",
    "type": "'course'",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Setting Updated Successfully"
}
 

Request   

GET api/users/enableEnrollContent

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

userId   string   

int The ID of the user to enable enroll content for. Example: 1

selectedCourseView   string   

string The view to enable for courses. Example: 'grid'

selectedLearningPathView   string   

string The view to enable for learning paths. Example: 'list'

selectedCourseViewMode   string   

string The mode to enable for courses. Example: 'enroll'

selectedLearningPathViewMode   string   

string The mode to enable for learning paths. Example: 'enroll'

type   string   

string The type of content to enable. Must be either 'course' or 'learningPath'. Example: 'course'

Retrieve Users

Retrieves a list of users filtered by search term and optionally by portal ID and user type.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/lookup?search_term=John&portalId=1&userType=learner&remote_user_search=qui" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/lookup"
);

const params = {
    "search_term": "John",
    "portalId": "1",
    "userType": "learner",
    "remote_user_search": "qui",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "records": [
        {
            "id": 1,
            "full_name": "John Doe",
            "email": "[email protected]",
            "user_type": "learner"
        }
    ]
}
 

Request   

GET api/users/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

search_term   string   

The search term to search for users. Example: John

portalId   string  optional  

optional The ID of the portal to filter users by. Example: 1

userType   string  optional  

optional The type of user to filter by. Example: learner

remote_user_search   string  optional  

optional Set to true to search for users globally. Set to false to search within the portal and its sub-portals. Example: qui

Creates a new user.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/user/create?firstName=John&lastName=Doe&email=john.doe%40example.com&password=h%5C%2A%7BP%2FtCM8u&userCategory=%5B1%2C2%2C3%5D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/create"
);

const params = {
    "firstName": "John",
    "lastName": "Doe",
    "email": "[email protected]",
    "password": "h\*{P/tCM8u",
    "userCategory": "[1,2,3]",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "User created successfully"
}
 

Request   

POST api/user/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

firstName   string   

First name of the user. Example: John

lastName   string   

Last name of the user. Example: Doe

email   string   

Email of the user. Example: [email protected]

password   string   

Password for the user. Must be at least 8 characters long and should not have been compromised according to the haveibeenpwned.com API. Example: h\*{P/tCM8u

userCategory   string  optional  

optional Array of category IDs or names to assign to the user. Example: [1,2,3]

Bulk upload users from csv file

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/user/bulkUpload" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"userList\": [
        \"amet\"
    ],
    \"selectedCourses\": [
        \"officia\"
    ],
    \"selectedLearningPaths\": [
        \"dolorum\"
    ],
    \"membershipId\": 2,
    \"portalId\": 1
}"
const url = new URL(
    "https://demo.aomlms.com/api/user/bulkUpload"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "userList": [
        "amet"
    ],
    "selectedCourses": [
        "officia"
    ],
    "selectedLearningPaths": [
        "dolorum"
    ],
    "membershipId": 2,
    "portalId": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "User(s) uploaded successfully",
    "is_success": "true"
}
 

Request   

POST api/user/bulkUpload

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

userList   string[]   

The list of user objects containing email, first_name, last_name, password, and other custom fields

selectedCourses   string[]   

List of Course Ids to be enrolled

selectedLearningPaths   string[]   

List of Learning Path Ids to be enrolled

membershipId   integer   

Membership Id to be attached Example: 2

portalId   integer   

Portal Id to be attached Example: 1

Retrieves the saved cards for a user.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/saved-cards?userId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/saved-cards"
);

const params = {
    "userId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 101,
        "last4": "4242",
        "payment_gateway_name": "Stripe",
        "card_type": "Visa"
    },
    {
        "id": 102,
        "last4": "1881",
        "payment_gateway_name": "PayPal",
        "card_type": "Mastercard"
    }
]
 

Request   

GET api/user/saved-cards

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

userId   string   

int The ID of the user to retrieve saved cards for. Example: 1

Deletes a saved card for a user.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/user/delete-card?paymentTokenId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/delete-card"
);

const params = {
    "paymentTokenId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "success",
    "message": "Card has been deleted."
}
 

Example response (400):


{
 "status": "error",
 "message": "Card not deleted. Please try again later." OR "Card cannot be deleted as it is linked to an active subscription."
}
 

Request   

POST api/user/delete-card

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

paymentTokenId   string   

int The ID of the payment token to delete. Example: 1

Returns a sample file in JSON format which can be downloaded by the user and used as a template for bulk uploading users.

The sample file contains dummy data for the standard fields and the custom user fields that have been set up in the system. The dummy data is in a format that can be easily copied and pasted into the user's own CSV file. The first record in the sample file contains data for all the fields, while the subsequent records contain blank data. This is to make it easy for the user to see what data is required for each field.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/getBulkUploadSampleFile" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/getBulkUploadSampleFile"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "headers": [
        "email",
        "first_name",
        "last_name",
        "password",
        "custom_field_1",
        "custom_field_2",
        "custom_field_3"
    ],
    "records": [
        {
            "email": "[email protected]",
            "first_name": "Fake FName1",
            "last_name": "Fake LName1",
            "password": "Qwerty@123",
            "custom_field_1": "Fake Custom Field 1 Value",
            "custom_field_2": "Fake Custom Field 2 Value",
            "custom_field_3": "Fake Custom Field 3 Value"
        },
        {
            "email": "[email protected]",
            "first_name": "Fake FName2",
            "last_name": "Fake LName2",
            "password": "",
            "custom_field_1": "",
            "custom_field_2": "",
            "custom_field_3": ""
        },
        {
            "email": "[email protected]",
            "first_name": "Fake FName3",
            "last_name": "Fake LName3",
            "password": "",
            "custom_field_1": "",
            "custom_field_2": "",
            "custom_field_3": ""
        }
    ]
}
 

Request   

GET api/user/getBulkUploadSampleFile

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Get blocked and allowed emails and domains for a given portal.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/getBlockedEmailsAndDomains?portalId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/getBlockedEmailsAndDomains"
);

const params = {
    "portalId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "blocked": [
        "[email protected]",
        "[email protected]"
    ],
    "allowed": [
        "[email protected]",
        "[email protected]"
    ]
}
 

Request   

GET api/user/getBlockedEmailsAndDomains

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer  optional  

The ID of the portal to get the blocked and allowed emails and domains for. If not provided, will return the blocked emails and domains for the main site. Example: 1

Retrieve User By ID

This endpoint returns the user details based on the ID specified.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "firstName": "John",
    "lastName": "Doe",
    "email": "[email protected]",
    "lastLoggedIn": "2 hours ago",
    "avatar": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\" viewBox=\"0 0 100 100\"><circle cx=\"50\" cy=\"50\" r=\"50\" stroke=\"background\" stroke-width=\"0\" fill=\"#03A9F4\" /><text x=\"50\" y=\"50\" font-size=\"40\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">JD</text></svg>",
    "disabled": false,
    "userType": "staff",
    "currentLoggedUserType": "owner",
    "membership": {
        "id": 1,
        "name": "Silver",
        "expiryDate": null
    },
    "customUserMetas": {
        "full_name": {
            "type": "text",
            "label": "Full Name",
            "submitted_value": "John Doe",
            "placeholder_value": ""
        },
        "user_type": {
            "type": "dropdown",
            "label": "User Type",
            "submitted_value": 1,
            "placeholder_value": "",
            "option_label": [
                "Staff",
                "Owner"
            ],
            "option_value": [
                1,
                2
            ]
        }
    },
    "internal_note": null
}
 

Request   

GET api/user/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the user. Example: 1

Updates an existing user.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/user/{id}?id=1&firstName=John&lastName=Doe&email=john.doe%40example.com&disabled=0&internal_note=This+is+a+note.&customUserMetas=%7B%22meta_key1%22%3A%7B%22type%22%3A%22text%22%2C%22submitted_value%22%3A%22value1%22%7D%2C%22meta_key2%22%3A%7B%22type%22%3A%22checkbox%22%2C%22submitted_value%22%3A%5B1%2C2%2C3%5D%7D%7D&userCategory=%5B1%2C2%2C3%5D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/{id}"
);

const params = {
    "id": "1",
    "firstName": "John",
    "lastName": "Doe",
    "email": "[email protected]",
    "disabled": "0",
    "internal_note": "This is a note.",
    "customUserMetas": "{"meta_key1":{"type":"text","submitted_value":"value1"},"meta_key2":{"type":"checkbox","submitted_value":[1,2,3]}}",
    "userCategory": "[1,2,3]",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "User updated successfully"
}
 

Request   

PUT api/user/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

User ID to update. Example: 1

firstName   string   

First name of the user. Example: John

lastName   string   

Last name of the user. Example: Doe

email   string   

Email of the user. Example: [email protected]

disabled   string   

boolean whether the user is disabled or not. Example: 0

internal_note   string  optional  

optional Internal note for the user. Example: This is a note.

customUserMetas   string  optional  

optional Custom user meta fields. Example: {"meta_key1":{"type":"text","submitted_value":"value1"},"meta_key2":{"type":"checkbox","submitted_value":[1,2,3]}}

userCategory   string  optional  

optional Array of category IDs or names to assign to the user. Example: [1,2,3]

Update Membership

Updates the membership of a specified user. The membership will be revoked if the expired_at date is in the past. If the expired_at is not provided, the expired_at of the membership will be used.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/user/1/update-membership" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": \"1\",
    \"expired_at\": \"\'2021-10-03 23:59:59\'\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/user/1/update-membership"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": "1",
    "expired_at": "'2021-10-03 23:59:59'"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


array A response with a message. Example: {message: User updated successfully}
 

Request   

PUT api/user/{id}/update-membership

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the user. Example: 1

Body Parameters

id   required  optional  

The ID of the membership. Example: 1

expired_at   nullable  optional  

The expired date for the user. Example: '2021-10-03 23:59:59'

Updates the password of a user.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/user/updatePassword/{id}?password=%22MyP%40ssw0rd%22&userId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/updatePassword/{id}"
);

const params = {
    "password": ""MyP@ssw0rd"",
    "userId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Password updated successfully"
}
 

Request   

PUT api/user/updatePassword/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

password   string   

New password for the user. Must be at least 8 characters long and should not have been compromised according to the haveibeenpwned.com API. Example: "MyP@ssw0rd"

userId   string   

ID of the user to update the password for. Example: 1

Enrolled Courses

Retrieves all courses enrolled by a specified user. The response includes course status, completion percentage, last access date, and access status.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/enrolled-courses?user_id=1&page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C%22direction%22%3A%22desc%22%7D&search_param=%7B%22status%22%3A%5B%22Not+Started%22%2C%22In+Progress%22%5D%2C%22nameOrEmail%22%3A%22John+Doe%22%7D&portalId=1&viewType=%22self%22&manage_course=true" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/enrolled-courses"
);

const params = {
    "user_id": "1",
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at","direction":"desc"}",
    "search_param": "{"status":["Not Started","In Progress"],"nameOrEmail":"John Doe"}",
    "portalId": "1",
    "viewType": ""self"",
    "manage_course": "true",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 50,
    "recordsFiltered": 50,
    "records": [
        {
            "id": 1,
            "courseId": 1,
            "featuredImageUrl": "https://example.com/course1.jpg",
            "courseSlug": "course1",
            "courseName": "Course 1",
            "lastAccessed": "2 days ago",
            "status": "Not Started",
            "display_status": "Not Started",
            "accessStatus": "Allowed",
            "percentComplete": 0,
            "courseStatus": "publish",
            "registered_on": "Aug 09, 2020",
            "started_on": "",
            "completed_on": "",
            "expire_on": "Never",
            "isExpired": false,
            "canRecertify": false,
            "estimatedCompletionTime": "2 hours",
            "certificate_count": 0,
            "enableCourseRating": true,
            "rating": 4.5
        }
    ],
    "name": "John Doe",
    "email": "[email protected]",
    "userType": "learner",
    "avatar": "https://example.com/avatar.jpg",
    "isLearner": true
}
 

Request   

GET api/users/enrolled-courses

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

user_id   string   

ID of the user to retrieve enrolled courses for. Example: 1

page_size   string   

Number of records to return per page. Example: 10

page_number   string   

Current page number. Example: 1

order_by   string  optional  

optional Returns results in some order. Example: {"colName":"created_at","direction":"desc"}

search_param   string  optional  

optional Search parameters related to course. Example: {"status":["Not Started","In Progress"],"nameOrEmail":"John Doe"}

portalId   string   

ID of the portal to filter courses by portal and sub-portals. Use -1 to skip portal filtering. Example: 1

viewType   string   

"self" or "manage". If "self", then only the enrolled courses of the requesting user are returned. If "manage", then all enrolled courses of users managed by the requesting user are returned. Example: "self"

manage_course   string   

true or false. If true, then only courses with access type "manage" are returned. If false, then all courses are returned. Example: true

Get courses enrolled by a user in a particular portal

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/getPortalCourses" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalId\": 7,
    \"page_size\": 17,
    \"page_number\": 18,
    \"order_by\": [],
    \"search_param\": []
}"
const url = new URL(
    "https://demo.aomlms.com/api/users/getPortalCourses"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalId": 7,
    "page_size": 17,
    "page_number": 18,
    "order_by": [],
    "search_param": []
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "courses": [
        {
            "courseId": 1,
            "registrationId": 1,
            "type": "course",
            "contentName": "Course 1",
            "rating": 4.5,
            "enableCourseRating": true,
            "featureImage": "https://example.com/image.jpg",
            "launchUrl": "/portal/course/course-1/launch",
            "canRecertify": true,
            "isEnrolled": true,
            "lastAccessed": "3 days ago",
            "display_status": "In Progress",
            "percentComplete": 20,
            "isExpired": false,
            "registered_on": "2021-01-01 00:00:00",
            "estimatedCompletionTime": "3 hours",
            "status": "In Progress"
        }
    ],
    "totalRecords": 10,
    "recordsFiltered": 10
}
 

Request   

GET api/users/getPortalCourses

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalId   integer   

The ID of the portal Example: 7

page_size   integer   

The number of records per page Example: 17

page_number   integer   

The page number Example: 18

order_by   object   

The order by object with colName and direction properties

search_param   object   

The search object with name, categories, and status properties

Delete a user or multiple users

Deletes a specified user or multiple users in a single API call. Supports deleting users with or without enrollments. Does not delete users who have created courses or modules. Does not delete users who have portal access. Also deletes announcements, cart abandonment records, and user reviews associated with the user.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/user/delete?delete_ids=%22%5B1%2C2%2C3%5D%22&user_id=4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/delete"
);

const params = {
    "delete_ids": ""[1,2,3]"",
    "user_id": "4",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "string",
    "deletedStudents": [
        {
            "id": 2,
            "name": "John Doe"
        },
        {
            "id": 3,
            "name": "Jane Doe"
        }
    ],
    "notDeletedStudents": [
        {
            "id": 1,
            "name": "Adam Smith"
        }
    ],
    "usedInCourses": {
        "John Doe": [
            {
                "id": 1,
                "name": "Course 1"
            },
            {
                "id": 2,
                "name": "Course 2"
            }
        ]
    },
    "usedAsCourseAuthors": {
        "John Doe": [
            {
                "id": 1,
                "name": "Course 1"
            },
            {
                "id": 2,
                "name": "Course 2"
            }
        ]
    },
    "usedAsModuleAuthors": {
        "John Doe": [
            {
                "id": 1,
                "name": "Module 1"
            },
            {
                "id": 2,
                "name": "Module 2"
            }
        ]
    },
    "usedInPortals": {
        "John Doe": [
            {
                "id": 1,
                "name": "Portal 1"
            },
            {
                "id": 2,
                "name": "Portal 2"
            }
        ]
    }
}
 

Request   

POST api/user/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

delete_ids   string   

JSON string containing the IDs of the users to be deleted. Example: "[1,2,3]"

user_id   integer  optional  

optional ID of the user. Defaults to the authenticated user if not provided. Example: 4

Quick Edit

Updates user details in bulk based on the provided parameters. This function supports enabling/disabling users, enrolling users in courses and learning paths, and attaching users to memberships.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/user/quickEdit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"user_ids\": [
        1,
        2,
        3
    ],
    \"course_ids\": [
        10,
        20
    ],
    \"disabled\": true,
    \"learning_path_ids\": [
        5,
        6
    ],
    \"enrollMembershipId\": 2,
    \"portalId\": 1
}"
const url = new URL(
    "https://demo.aomlms.com/api/user/quickEdit"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "user_ids": [
        1,
        2,
        3
    ],
    "course_ids": [
        10,
        20
    ],
    "disabled": true,
    "learning_path_ids": [
        5,
        6
    ],
    "enrollMembershipId": 2,
    "portalId": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Users updated Successfully"
}
 

Request   

POST api/user/quickEdit

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

user_ids   string[]   

IDs of the users to be updated.

course_ids   string[]  optional  

Optional. IDs of the courses to enroll users in.

disabled   boolean  optional  

Optional. Whether to disable the users. Example: true

learning_path_ids   string[]  optional  

Optional. IDs of the learning paths to enroll users in.

enrollMembershipId   integer  optional  

Optional. ID of the membership to attach users to. Example: 2

portalId   integer  optional  

Optional. ID of the portal for membership attachment. Example: 1

Insert Address

Adds a new address for a specified user with the provided details. If the address is marked as default, it updates other addresses of the same type to not be default.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/user/{id}/addAddress" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"fullName\": \"John Doe\",
    \"orgName\": \"Acme Corp\",
    \"orgVatId\": \"VAT12345\",
    \"addressLine1\": \"Boring Street\",
    \"addressLine2\": \"Awesome Colony\",
    \"zipcode\": \"123456\",
    \"city\": \"Mumbai\",
    \"state\": \"NY\",
    \"country\": \"US\",
    \"isDefault\": true,
    \"userId\": 4,
    \"type\": \"billing\",
    \"billing_address_id\": 5
}"
const url = new URL(
    "https://demo.aomlms.com/api/user/{id}/addAddress"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "fullName": "John Doe",
    "orgName": "Acme Corp",
    "orgVatId": "VAT12345",
    "addressLine1": "Boring Street",
    "addressLine2": "Awesome Colony",
    "zipcode": "123456",
    "city": "Mumbai",
    "state": "NY",
    "country": "US",
    "isDefault": true,
    "userId": 4,
    "type": "billing",
    "billing_address_id": 5
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "Address added successfully"
}
 

Request   

POST api/user/{id}/addAddress

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

fullName   string   

Full Name of the user. Example: John Doe

orgName   string  optional  

optional Organization Name. Example: Acme Corp

orgVatId   string  optional  

optional Organization VAT ID. Example: VAT12345

addressLine1   string   

Address line1 of the user. Example: Boring Street

addressLine2   string  optional  

optional Address line2 of the user. Example: Awesome Colony

zipcode   string   

Zipcode of the user address. Example: 123456

city   string   

City of the user address. Example: Mumbai

state   string  optional  

optional State of the user address. Example: NY

country   string   

Country of the user address. Example: US

isDefault   boolean   

Is the address default for billing. Example: true

userId   integer   

ID of the user for whom the address is being added. Example: 4

type   string   

Type of address. Example: billing

billing_address_id   integer  optional  

optional Billing address ID if applicable. Example: 5

Retrieve all billing addresses of a user

Retrieves all the billing addresses which are added by the specified user.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/userAddress/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/userAddress/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "isDefault": false,
        "fullName": "John Doe",
        "addressLine1": "Boring Street",
        "addressLine2": "Awesome Colony",
        "zipcode": "123456",
        "city": "Mumbai",
        "state": "MH",
        "country": "IN"
    }
]
 

Request   

GET api/user/userAddress/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the user address row from UsersAddress Model. Example: 1

Get shipping address By ID.

Retrieves a list of all shipping addresses associated with a specific user ID.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/userShippingAddress/12" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/userShippingAddress/12"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "isDefault": true,
        "fullName": "John Doe",
        "orgName": "Acme Inc.",
        "orgVatId": "VAT123456",
        "addressLine1": "123 Main St",
        "addressLine2": "Suite 456",
        "zipcode": "12345",
        "city": "New York",
        "state": "NY",
        "country": "USA"
    }
]
 

Request   

GET api/user/userShippingAddress/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer   

The ID of the user. Example: 12

Retrieve User Dashboard Statistics

Returns user's dashboard statistics which includes Total Courses, Completed Courses, In Progress Courses, Not Started Courses, and Time Spent.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/dashboard/statistics?user_id=4&portalId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/dashboard/statistics"
);

const params = {
    "user_id": "4",
    "portalId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "totalCourses": 10,
    "completedCourses": 2,
    "inProgressCourses": 3,
    "notStartedCourses": 5,
    "timeSpent": 12
}
 

Request   

GET api/user/dashboard/statistics

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

user_id   string   

ID of the user. Example: 4

portalId   string   

ID of the portal. Example: 1

Retrieve User Activities

Returns all activities performed by a specified user in a paginated format. Supports filtering, sorting, and context-based queries.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user-activities?user_id=4&page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A%22desc%22%7D&search_param=%7B%22courseCategoryIds%22%3A%5B%5D%2C%22courseName%22%3A%22course-1%22%2C%22status%22%3A%22In+Progress%22%7D&context=%22admin%22&portalId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user-activities"
);

const params = {
    "user_id": "4",
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction":"desc"}",
    "search_param": "{"courseCategoryIds":[],"courseName":"course-1","status":"In Progress"}",
    "context": ""admin"",
    "portalId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 15,
            "verb": "ENROLLED",
            "created_at": "Aug 09, 2020 10:27 AM",
            "message": "John Doe is enrolled to course 1",
            "course": "course 1"
        }
    ]
}
 

Request   

GET api/user-activities

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

user_id   integer   

ID of the user. Defaults to the authenticated user if not provided. Example: 4

page_size   integer   

Number of records per page. Example: 10

page_number   integer   

Current page number. Example: 1

order_by   string  optional  

optional JSON string to specify the column and direction for ordering. Example: {"colName":"created_at", "direction":"desc"}

search_param   string  optional  

optional JSON string containing search parameters. Example: {"courseCategoryIds":[],"courseName":"course-1","status":"In Progress"}

context   string   

The context for the activities. Example: "admin"

portalId   integer   

The ID of the portal. Example: 1

Retrieve User Orders

Returns all orders of a specified user in a paginated format. Supports filtering, sorting, and context-based queries.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user-orders?user_id=4&page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A%22desc%22%7D&search_param=%7B%22courseCategoryIds%22%3A%5B%5D%2C%22courseName%22%3A%22course-1%22%2C%22status%22%3A%22In+Progress%22%7D&context=%22admin%22&portalId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user-orders"
);

const params = {
    "user_id": "4",
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction":"desc"}",
    "search_param": "{"courseCategoryIds":[],"courseName":"course-1","status":"In Progress"}",
    "context": ""admin"",
    "portalId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 15,
            "verb": "ENROLLED",
            "created_at": "Aug 09, 2020 10:27 AM",
            "message": "John Doe is enrolled to course 1",
            "course": "course 1"
        }
    ]
}
 

Request   

GET api/user-orders

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

user_id   integer   

ID of the user. Defaults to the authenticated user if not provided. Example: 4

page_size   integer   

Number of records per page. Example: 10

page_number   integer   

Current page number. Example: 1

order_by   string  optional  

optional JSON string to specify the column and direction for ordering. Example: {"colName":"created_at", "direction":"desc"}

search_param   string  optional  

optional JSON string containing search parameters. Example: {"courseCategoryIds":[],"courseName":"course-1","status":"In Progress"}

context   string   

The context for the activities. Example: "admin"

portalId   integer   

The ID of the portal. Example: 1

Get user certificates.

Retrieves a paginated list of certificates for a specific user, with optional filtering, sorting, and portal-based context.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user-certificates/42?page_size=10&page_number=1&order_by=%5B%7B%22field%22%3A%22issued_at%22%2C%22direction%22%3A%22desc%22%7D%5D&search_param=%5B%7B%22field%22%3A%22title%22%2C%22value%22%3A%22AWS%22%7D%5D&return_type=%22summary%22&portalId=3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user-certificates/42"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "[{"field":"issued_at","direction":"desc"}]",
    "search_param": "[{"field":"title","value":"AWS"}]",
    "return_type": ""summary"",
    "portalId": "3",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "title": "AWS Certified Solutions Architect",
        "issued_at": "2023-08-01",
        "valid_till": "2026-08-01",
        "issuer": "Amazon",
        "status": "active"
    }
]
 

Request   

GET api/user-certificates/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the user or "undefined" to use the authenticated user. Example: 42

Query Parameters

page_size   integer   

Number of records per page. Example: 10

page_number   integer   

Page number to retrieve. Example: 1

order_by   string  optional  

json Sort options in JSON format. Example: [{"field":"issued_at","direction":"desc"}]

search_param   string  optional  

json Search filters in JSON format. Example: [{"field":"title","value":"AWS"}]

return_type   string  optional  

Optional return type. Example: "summary"

portalId   integer  optional  

Optional portal ID for context. Example: 3

Deletes a certificate issued to a user.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/user/{id}/delete-certificate" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 1
}"
const url = new URL(
    "https://demo.aomlms.com/api/user/{id}/delete-certificate"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Certificate Deleted Successfully"
}
 

Request   

PUT api/user/{id}/delete-certificate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   integer   

ID of the user certificate. Example: 1

Update Certificate Issue and Expiry Dates

This API request is used to update the issue date and expiry date of a user's certificate.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/update-certificate-dates" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"rowId\": 1,
    \"newIssueDate\": \"2020-08-15 10:00:00\",
    \"newExpiryDate\": \"2020-08-15 10:00:00\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/update-certificate-dates"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "rowId": 1,
    "newIssueDate": "2020-08-15 10:00:00",
    "newExpiryDate": "2020-08-15 10:00:00"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Date Updated Successfully"
}
 

Request   

PUT api/update-certificate-dates

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

rowId   integer   

ID of the user certificate row. Example: 1

newIssueDate   string   

New issue date of the certificate in Y-m-d H:i:s format. Example: 2020-08-15 10:00:00

newExpiryDate   string   

New expiry date of the certificate in Y-m-d H:i:s format. Example: 2020-08-15 10:00:00

Retrieves the default address of a user.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/default-address/1?type=billing_address+or+shipping_address" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/default-address/1"
);

const params = {
    "type": "billing_address or shipping_address",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "isDefault": false,
    "fullName": "John Doe",
    "addressLine1": "Boring Street",
    "addressLine2": "Awesome Colony",
    "zipcode": "123456",
    "city": "Mumbai",
    "state": "MH",
    "country": "IN"
}
 

Request   

GET api/default-address/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the user. Example: 1

Query Parameters

type   string  optional  

optional Type of the address to be retrieved. Example: billing_address or shipping_address

Retrieves the address of a user by address ID.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/getaddress/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/getaddress/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "isDefault": false,
    "fullName": "John Doe",
    "addressLine1": "Boring Street",
    "addressLine2": "Awesome Colony",
    "zipcode": "123456",
    "city": "Mumbai",
    "state": "MH",
    "country": "IN"
}
 

Request   

GET api/getaddress/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the address. Example: 1

Update a user's address.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/user/updateAddress/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"fullName\": \"John Doe\",
    \"orgName\": \"ABC Company\",
    \"orgVatId\": \"1234567890\",
    \"addressLine1\": \"Boring Street\",
    \"addressLine2\": \"Awesome Colony\",
    \"zipcode\": \"123456\",
    \"city\": \"Mumbai\",
    \"state\": \"MH\",
    \"country\": \"IN\",
    \"isDefault\": \"true\",
    \"userId\": \"1\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/user/updateAddress/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "fullName": "John Doe",
    "orgName": "ABC Company",
    "orgVatId": "1234567890",
    "addressLine1": "Boring Street",
    "addressLine2": "Awesome Colony",
    "zipcode": "123456",
    "city": "Mumbai",
    "state": "MH",
    "country": "IN",
    "isDefault": "true",
    "userId": "1"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Address updated successfully"
}
 

Request   

POST api/user/updateAddress/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the address. Example: 1

Body Parameters

fullName   required  optional  

Full name of the user. Example: John Doe

orgName   optional  optional  

Organization Name. Example: ABC Company

orgVatId   optional  optional  

Organization VAT ID. Example: 1234567890

addressLine1   required  optional  

Address Line 1. Example: Boring Street

addressLine2   optional  optional  

Address Line 2. Example: Awesome Colony

zipcode   required  optional  

Zipcode. Example: 123456

city   required  optional  

City. Example: Mumbai

state   optional  optional  

State. Example: MH

country   required  optional  

Country. Example: IN

isDefault   required  optional  

Whether the address is default or not. Example: true

userId   required  optional  

ID of the user. Example: 1

Retrieves the detailed report for all courses of a user. Returned data contains information like total number of modules and number of courses in different status(In Progress, Not Started and Completed).

Example - [1,0]. You can use these data for graphs representation as well.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/reports/user-detailed?user_id=1&page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22registered_on%22%2C%22direction%22%3A%22desc%22%7D&search_param=%7B%22nameOrEmail%22%3A%22%22%2C%22status%22%3A%5B%5D%7D&portalId=%7B%22portalId%22%3A1%7D&searchPortalIds=%7B%22searchPortalIds%22%3A%5B1%2C2%5D%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/reports/user-detailed"
);

const params = {
    "user_id": "1",
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"registered_on","direction":"desc"}",
    "search_param": "{"nameOrEmail":"","status":[]}",
    "portalId": "{"portalId":1}",
    "searchPortalIds": "{"searchPortalIds":[1,2]}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "courseName": "course 1",
    "featuredImage": null,
    "recordsTotal": 3,
    "totalNotStarted": 1,
    "totalInProgress": 1,
    "totalCompleted": 1,
    "recordsFiltered": 3,
    "records": [
        {
            "first_name": "Aom",
            "last_name": "Staff",
            "email": "[email protected]",
            "status": "In Progress",
            "percent_complete": 45,
            "access_status": "Allowed",
            "registered_on": "10-Aug-2020",
            "started_on": "10-Aug-2020",
            "completed_on": "",
            "expire_on": "Never",
            "last_accessed_on": "1 hour ago",
            "percent_achieved": null,
            "total_time_spent": "0h 20m",
            "certifcate_issued": "No"
        },
        {
            "first_name": "Client",
            "last_name": "Admin",
            "email": "[email protected]",
            "status": "Not Started",
            "percent_complete": 0,
            "access_status": "Allowed",
            "registered_on": "09-Aug-2020",
            "started_on": "",
            "completed_on": "",
            "expire_on": "12-Aug-2023",
            "last_accessed_on": "Never",
            "percent_achieved": null,
            "total_time_spent": "0h 0m",
            "certifcate_issued": "Yes"
        },
        {
            "first_name": "Demo",
            "last_name": "Student",
            "email": "[email protected]",
            "status": "Completed",
            "percent_complete": 50,
            "access_status": "Allowed",
            "registered_on": "03-Aug-2020",
            "started_on": "03-Aug-2020",
            "completed_on": "03-Aug-2020",
            "expire_on": "Never",
            "last_accessed_on": "6 days ago",
            "percent_achieved": 0,
            "total_time_spent": "0h 0m",
            "certifcate_issued": "Yes"
        }
    ]
}
 

Request   

GET api/user/reports/user-detailed

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

user_id   string   

ID of the user. Example: 1

page_size   string   

The number of the submissions you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"registered_on","direction":"desc"}

search_param   string  optional  

For searching items based on students name or emaila and status of the course. Example: {"nameOrEmail":"","status":[]}

portalId   string  optional  

For listing courses assigned to a specific portal. Example: {"portalId":1}

searchPortalIds   string  optional  

For listing courses assigned to multiple portals. Example: {"searchPortalIds":[1,2]}

Retrieves a paginated report of users with custom user data.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/report?page_size=10&page_number=1&registered_between=%5B%222023-01-01%22%2C+%222023-12-31%22%5D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/report"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "registered_between": "["2023-01-01", "2023-12-31"]",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
  "records": [
    {
      "first_name": "John",
      "last_name": "Doe",
      "email": "[email protected]",
      "user_type": "General",
      "created_at": "2023-01-01 12:00:00",
      "last_login": "2 days ago",
}
  ],
  "headers": [
    "custom_field_1",
    "custom_field_2"
  ]
}
 

Request   

GET api/users/report

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

Number of the result row you want in each page. Example: 10

page_number   string   

Current page number. Example: 1

registered_between   string   

Date range filter for user registration. Example: ["2023-01-01", "2023-12-31"]

Retrieve User Subscriptions

Returns all subscriptions of a specified user in a paginated format. Supports filtering and sorting.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user-subscriptions?user_id=4&page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A%22desc%22%7D&search_param=%7B%22status%22%3A%22Active%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user-subscriptions"
);

const params = {
    "user_id": "4",
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction":"desc"}",
    "search_param": "{"status":"Active"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 5,
    "recordsFiltered": 5,
    "records": [
        {
            "id": 1,
            "subscription_name": "Premium Plan",
            "status": "Active",
            "start_date": "2023-01-01",
            "end_date": "2023-12-31"
        }
    ]
}
 

Request   

GET api/user-subscriptions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

user_id   integer  optional  

optional ID of the user. Defaults to the authenticated user if not provided. Example: 4

page_size   integer   

Number of records per page. Example: 10

page_number   integer   

Current page number. Example: 1

order_by   string  optional  

optional JSON string to specify the column and direction for ordering. Example: {"colName":"created_at", "direction":"desc"}

search_param   string  optional  

optional JSON string containing search parameters. Example: {"status":"Active"}

Get all User Sources

Retrieves all the sources for a portal with pagination mode. You can apply filter using search_param via name or identifier.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user-source?portalId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user-source"
);

const params = {
    "portalId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "records": [
        {
            "id": 1,
            "name": "Default",
            "identifier": "default",
            "description": "Default source of users.",
            "logoUrl": "https://example.com/default.png"
        }
    ]
}
 

Request   

GET api/user-source

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   string   

The id of the portal. Example: 1

Creates a new portal for a given user.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/user/portal-create?portalId=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"userId\": 12,
    \"portals\": [
        {
            \"name\": \"My New Portal\",
            \"referralCode\": \"REF123\",
            \"totalSeat\": 50,
            \"userType\": \"admin\",
            \"portalType\": \"education\",
            \"status\": \"active\",
            \"subscriptionId\": 101,
            \"expiryDate\": \"2025-12-31\",
            \"expiryMessage\": \"Subscription ends soon\",
            \"parentPortalId\": 1
        }
    ],
    \"clonePortalAdmins\": true,
    \"cloneBrandingNotifications\": false
}"
const url = new URL(
    "https://demo.aomlms.com/api/user/portal-create"
);

const params = {
    "portalId": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "userId": 12,
    "portals": [
        {
            "name": "My New Portal",
            "referralCode": "REF123",
            "totalSeat": 50,
            "userType": "admin",
            "portalType": "education",
            "status": "active",
            "subscriptionId": 101,
            "expiryDate": "2025-12-31",
            "expiryMessage": "Subscription ends soon",
            "parentPortalId": 1
        }
    ],
    "clonePortalAdmins": true,
    "cloneBrandingNotifications": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Portals created successfully"
}
 

Request   

POST api/user/portal-create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer  optional  

The portal ID to filter by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Body Parameters

userId   integer   

The ID of the user to create the portal for. Example: 12

portals   string[]   

The array of portals to create. Each portal should contain "name", "referralCode", "totalSeat", "userType", "portalType", "status", "subscriptionId", "expiryDate", "expiryMessage", and "parentPortalId".

clonePortalAdmins   boolean   

Whether to clone the portal admins or not. Example: true

cloneBrandingNotifications   boolean   

Whether to clone the branding notifications or not. Example: false

Retrieves all learning paths for a given user.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/enrolled-learningpaths?user_id=1&portalId=-1&viewType=self&page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22started_on%22%2C%22direction%22%3A%22desc%22%7D&search_param=%7B%22status%22%3A%5B%22Not+Started%22%2C%22In+Progress%22%5D%2C%22nameOrEmail%22%3A%22John+Doe%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/enrolled-learningpaths"
);

const params = {
    "user_id": "1",
    "portalId": "-1",
    "viewType": "self",
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"started_on","direction":"desc"}",
    "search_param": "{"status":["Not Started","In Progress"],"nameOrEmail":"John Doe"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 12,
    "recordsFiltered": 12,
    "records": [
        {
            "id": 1,
            "featuredImageUrl": "http://example.com/featured-image.jpg",
            "launchSlug": "http://example.com/launch-learning-path",
            "learningPathName": "Learning Path 1",
            "status": "Not Started",
            "display_status": "Not Started",
            "percentComplete": 0,
            "registered_on": "22-02-2022",
            "started_on": "",
            "completed_on": "",
            "certificateCount": 0,
            "totalLPCourses": 5,
            "completedLpCourses": 0,
            "rating": 4.5,
            "totalEstimatedTime": "2 hours"
        }
    ],
    "name": "John Doe",
    "email": "[email protected]",
    "userType": "Learner",
    "avatar": "http://example.com/avatar.jpg"
}
 

Request   

GET api/users/enrolled-learningpaths

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

user_id   string   

User ID to filter learning paths. Example: 1

portalId   string   

Portal ID to filter learning paths. If -1, it will return all learning paths. Example: -1

viewType   string   

View type of the user. Example: self

page_size   string   

Number of records to return per page. Example: 10

page_number   string   

Page number. Example: 1

order_by   string   

Order by parameters. Example: {"colName":"started_on","direction":"desc"}

search_param   string   

Search parameters related to learning path. Example: {"status":["Not Started","In Progress"],"nameOrEmail":"John Doe"}

Retrieves learning paths associated with the portal, filtered by the search parameters.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/portalLearningPaths?page_size=10&page_number=1&order_by=%7B%22colName%22%3A+%22name%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22name%22%3A+%22Learning+Path+1%22%2C+%22status%22%3A+%5B%22registered%22%2C+%22started%22%5D%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/portalLearningPaths"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName": "name", "direction": "desc"}",
    "search_param": "{"name": "Learning Path 1", "status": ["registered", "started"]}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "learningPaths": [
        {
            "id": 1,
            "learningPathId": 1,
            "type": "public",
            "learningPathName": "Learning Path 1",
            "featureImage": "http://example.com/learning-path-image.jpg",
            "display_status": "Registered",
            "percentComplete": 0,
            "isEnrolled": true,
            "certificateCount": 0,
            "launchSlug": "http://example.com/portal/learning-path/1/launch",
            "totalLPCourses": 5,
            "completedLpCourses": 2,
            "rating": 4.5,
            "totalEstimatedTime": "2 hours"
        },
        {
            "id": 2,
            "learningPathId": 2,
            "type": "private",
            "learningPathName": "Learning Path 2",
            "featureImage": "http://example.com/learning-path-image.jpg",
            "display_status": "Not Enrolled",
            "percentComplete": 0,
            "isEnrolled": false,
            "certificateCount": 0,
            "launchSlug": "http://example.com/portal/learning-path/2/launch",
            "totalLPCourses": 5,
            "completedLpCourses": 0,
            "rating": null,
            "totalEstimatedTime": "2 hours"
        }
    ],
    "totalRecords": 10,
    "recordsFiltered": 10
}
 

Request   

GET api/users/portalLearningPaths

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

portalId   string   

Portal ID of the user. Example: 1

Query Parameters

page_size   string   

The number of results per page. Example: 10

page_number   string   

The current page number. Example: 1

order_by   string  optional  

optional The column to sort the results by. Example: {"colName": "name", "direction": "desc"}

search_param   string  optional  

optional The search query parameters. Example: {"name": "Learning Path 1", "status": ["registered", "started"]}

Retrieve Membership Content

Fetches and returns a paginated list of content available to a user through their membership. The content includes courses and modules, which can be filtered and sorted based on the input parameters.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/membership/user-contents?page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A%22desc%22%7D&search_param=%7B%22type%22%3A%22video%22%2C+%22nameOrDescription%22%3A%22Introduction%22%7D&portalId=1&viewType=%22self%22" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/membership/user-contents"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction":"desc"}",
    "search_param": "{"type":"video", "nameOrDescription":"Introduction"}",
    "portalId": "1",
    "viewType": ""self"",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "activeMembership": true,
    "recordsTotal": 100,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "name": "Course 1",
            "slug": "course-1",
            "type": "Course",
            "description": "Course description",
            "enrollButton": null,
            "duration": "2 hours",
            "launchUrl": "http://example.com/launch",
            "user_id": [
                4
            ],
            "created_at": "2023-01-01"
        }
    ]
}
 

Request   

GET api/membership/user-contents

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   integer   

Number of records per page. Example: 10

page_number   integer   

Current page number. Example: 1

order_by   string  optional  

optional JSON string specifying the column and direction for ordering. Example: {"colName":"created_at", "direction":"desc"}

search_param   string  optional  

optional JSON string containing search parameters. Example: {"type":"video", "nameOrDescription":"Introduction"}

portalId   integer   

ID of the portal for filtering membership content. Use -1 for default behavior. Example: 1

viewType   string   

Specifies the view type. "self" for personal view, others for different portal settings. Example: "self"

Custom User Field Type Lookup

Provides a list of available custom user field types. Each type is represented by a database value and a display value.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/fieldtype/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/fieldtype/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "text",
        "display_value": "Text Field"
    },
    {
        "db_value": "textarea",
        "display_value": "Text Area"
    },
    {
        "db_value": "date",
        "display_value": "Date"
    },
    {
        "db_value": "radio",
        "display_value": "Single Select"
    },
    {
        "db_value": "checkbox",
        "display_value": "Multiple Select"
    },
    {
        "db_value": "dropdown",
        "display_value": "Drop Down"
    }
]
 

Request   

GET api/users/fieldtype/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieve Custom User Fields that needs to be shown on the Registration page

Retrieves the details of pre saved Custom User Fields.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/customUserFields" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/customUserFields"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "fields": [
        {
            "id": 1,
            "type": "text",
            "label": "How you left",
            "defaultValue": null,
            "isRequired": false,
            "optionLabel": [],
            "isFieldOnRegistrationPage": false,
            "isFieldOnCertificate": true,
            "includeInReportExports": [
                "export-users",
                "export-orders"
            ]
        },
        {
            "id": 2,
            "type": "textarea",
            "label": "What is your home address",
            "defaultValue": null,
            "isRequired": true,
            "optionLabel": [],
            "isFieldOnRegistrationPage": true,
            "isFieldOnCertificate": false,
            "includeInReportExports": []
        }
    ]
}
 

Request   

GET api/users/customUserFields

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update custom user fields.

Updates the details of the fields in "Custom User Fields" table. If the field is not present in the table, it will be added. If the field is not present in the request, it will be deleted from the table.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/users/customUserFields" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"fields\": [
        \"possimus\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/users/customUserFields"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "fields": [
        "possimus"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Fields updated successfully"
}
 

Request   

PUT api/users/customUserFields

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

fields   string[]   

List of fields to be saved.

*   object  optional  
label   string   

Field label Example: amet

type   string   

Field type, it can be text, textarea, date, radio, checkbox or dropdown Example: molestiae

optionLabel   string[]  optional  

required_if:fields..type,dropdown,radio,checkbox|exclude_if:fields..type,text,textarea,date Option label and value

*   object  optional  
value   string   

Option value Example: sed

isRequired   boolean   

Whether the field is required or not Example: true

isFieldOnRegistrationPage   boolean   

Whether the field should be shown on the registration page or not Example: false

isFieldOnCertificate   boolean   

Whether the field should be shown on the certificate or not Example: false

includeInReportExports   string[]   

Whether the field should be included in the report exports or not

Lookup for custom user fields report exports

Retrieves a list of reports that custom user fields can be included in.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/customUserFieldsReports/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/customUserFieldsReports/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {"db_value": "export-users", "display_value": "Export Users"},
    {"db_value": "course-insight", "display_value": "Course Insight"},
    {"db_value": "export-orders", "display_value": "Export Orders"},
]
 

Request   

GET api/users/customUserFieldsReports/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Checks if a custom user field can be deleted.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/can-delete-field?fieldToDelete=%7B%22userMetaKey%22%3A%22dob%22%2C%22label%22%3A%22Date+Of+Birth%22%2C%22type%22%3A%22date%22%2C%22isRequired%22%3Afalse%2C%22optionsLabel%22%3A%5B%5D%7D.+example%3A+%7B%22userMetaKey%22%3A%22custom_field_1%22%2C%22label%22%3A%22Custom+Field+1%22%2C%22type%22%3A%22text%22%2C%22isRequired%22%3Afalse%2C%22optionsLabel%22%3A%5B%5D%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/can-delete-field"
);

const params = {
    "fieldToDelete": "{"userMetaKey":"dob","label":"Date Of Birth","type":"date","isRequired":false,"optionsLabel":[]}. example: {"userMetaKey":"custom_field_1","label":"Custom Field 1","type":"text","isRequired":false,"optionsLabel":[]}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "canDeleteField": true,
    "message": "This field can not be deleted as some user data is associated with it. Please contact administrator.",
    "certificateTemplates": []
}
 

Request   

GET api/users/can-delete-field

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

fieldToDelete   string   

Field data in JSON format. Example: {"userMetaKey":"dob","label":"Date Of Birth","type":"date","isRequired":false,"optionsLabel":[]}. example: {"userMetaKey":"custom_field_1","label":"Custom Field 1","type":"text","isRequired":false,"optionsLabel":[]}

Retrieve the badges and the count of each badge a user has earned

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/badges/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/badges/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "title": "Gold",
        "badgeIconUrl": "/images/badges/Badge_1.png",
        "points": 1,
        "organizationId": 1,
        "count": 3
    },
    {
        "id": 2,
        "title": "Silver",
        "badgeIconUrl": "/images/badges/Badge_2.png",
        "points": 2,
        "organizationId": 1,
        "count": 1
    }
]
 

Request   

GET api/user/badges/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the user. Example: 1

Get the leaderboard information for a user

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/leaderboard/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user/leaderboard/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    "rankedUsers": [
        {
            "id": 1,
            "rank": 1,
            "firstName": "John",
            "lastName": "Doe",
            "points": 100,
            "badgeCount": 10
        },
        {
            "id": 2,
            "rank": 2,
            "firstName": "Jane",
            "lastName": "Doe",
            "points": 80,
            "badgeCount": 5
        }
    ],
    "userTier": "Gold",
    "userRank": 1
]
 

Request   

GET api/user/leaderboard/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the user. Example: 1

Returns 2FA details for a user.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user-meta/2fa?user_id=4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user-meta/2fa"
);

const params = {
    "user_id": "4",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "is2FactorAuthActive": true,
    "qr_code": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAE1pY3Jvc29mdCBPZmZpY2UgTWF0aXZpY2FsIEJ1aWx0aW5nIChNaW5pbnNpemUpd2l0aCBHZW5lcmF0b3Igd2l0aCBQb3NpdGljIFRleHQgLSBDb3B5cmlnaHQgTmFtZSBmcm9tIHVuaXF1ZSBpZGVudGl0eQAAABh0RVh0VGh1bWI6OkRTVEVYUWhUQyBjb250ZW50LW1vc3QgdGh1bWIh4NApweCt4M6rAAAAAElFTkSuQmCC",
    "string_code": "string code"
}
 

Request   

GET api/user-meta/2fa

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

user_id   integer  optional  

optional ID of the user. Example: 4

Prepares QR code for Two factor authentication.

Returns QR code, URI code and String code for users to authenticate themselves using their authenticator app.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/user/prepareTwoFactorAuth" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"user_id\": 4
}"
const url = new URL(
    "https://demo.aomlms.com/api/user/prepareTwoFactorAuth"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "user_id": 4
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "as_qr_code": "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAE1pY3Jvc29mdCBPZmZpY2UgTWF0aXZpY2FsIEJ1aWx0aW5nIChNaW5pbnNpemUpd2l0aCBHZW5lcmF0b3Igd2l0aCBQb3NpdGljIFRleHQgLSBDb3B5cmlnaHQgTmFtZSBmcm9tIHVuaXF1ZSBpZGVudGl0eQAAABh0RVh0VGh1bWI6OkRTVEVYUWhUQyBjb250ZW50LW1vc3QgdGh1bWIh4NApweCt4M6rAAAAAElFTkSuQmCC",
    "as_uri": "otpauth://totp/AOM?secret=base32secret&issuer=AOM",
    "as_string": "base32secret"
}
 

Request   

POST api/user/prepareTwoFactorAuth

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

user_id   integer  optional  

optional ID of the user. Example: 4

Confirms relation between AOM site and authenticator app for 2fa.

User need to provided secret code from authenticator app. It enables Two factor authentication feature in the system for users.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/user/confirmTwoFactorAuth" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"user_id\": 4,
    \"secretCode\": \"123456\",
    \"qrCode\": \"data:image\\/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAE1pY3Jvc29mdCBPZmZpY2UgTWF0aXZpY2FsIEJ1aWx0aW5nIChNaW5pbnNpemUpd2l0aCBHZW5lcmF0b3Igd2l0aCBQb3NpdGljIFRleHQgLSBDb3B5cmlnaHQgTmFtZSBmcm9tIHVuaXF1ZSBpZGVudGl0eQAAABh0RVh0VGh1bWI6OkRTVEVYUWhUQyBjb250ZW50LW1vc3QgdGh1bWIh4NApweCt4M6rAAAAAElFTkSuQmCC\",
    \"stringCode\": \"base32secret\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/user/confirmTwoFactorAuth"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "user_id": 4,
    "secretCode": "123456",
    "qrCode": "data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAE1pY3Jvc29mdCBPZmZpY2UgTWF0aXZpY2FsIEJ1aWx0aW5nIChNaW5pbnNpemUpd2l0aCBHZW5lcmF0b3Igd2l0aCBQb3NpdGljIFRleHQgLSBDb3B5cmlnaHQgTmFtZSBmcm9tIHVuaXF1ZSBpZGVudGl0eQAAABh0RVh0VGh1bWI6OkRTVEVYUWhUQyBjb250ZW50LW1vc3QgdGh1bWIh4NApweCt4M6rAAAAAElFTkSuQmCC",
    "stringCode": "base32secret"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "status": "success",
    "message": "Two Factor Authentication activated"
}
 

Request   

POST api/user/confirmTwoFactorAuth

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

user_id   integer  optional  

optional ID of the user. Example: 4

secretCode   string   

Secret code from users authenticator app. Example: 123456

qrCode   string   

QR code generated by prepareTwoFactor method. Example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAASwAAAEsCAYAAAB5fY51AAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAZdEVYdFNvZnR3YXJlAE1pY3Jvc29mdCBPZmZpY2UgTWF0aXZpY2FsIEJ1aWx0aW5nIChNaW5pbnNpemUpd2l0aCBHZW5lcmF0b3Igd2l0aCBQb3NpdGljIFRleHQgLSBDb3B5cmlnaHQgTmFtZSBmcm9tIHVuaXF1ZSBpZGVudGl0eQAAABh0RVh0VGh1bWI6OkRTVEVYUWhUQyBjb250ZW50LW1vc3QgdGh1bWIh4NApweCt4M6rAAAAAElFTkSuQmCC

stringCode   string   

String code generated by prepareTwoFactor method. Example: base32secret

Disable Two Factor Authentication for a user.

Disables Two factor authentication feature in the system for users.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/user/disableTwoFactorAuth" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"user_id\": 4
}"
const url = new URL(
    "https://demo.aomlms.com/api/user/disableTwoFactorAuth"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "user_id": 4
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "2factor authentication disabled successfully",
    "qrcode": null,
    "stringcode": null
}
 

Request   

POST api/user/disableTwoFactorAuth

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

user_id   integer  optional  

optional ID of the user. Example: 4

Sends a reminder email to a user about their abandoned cart.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/sendCartReminderEmail?id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/sendCartReminderEmail"
);

const params = {
    "id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Email send successfully"
}
 

Request   

POST api/sendCartReminderEmail

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

int The ID of the cart abandonment detail to send the reminder for. Example: 1

Resend New Account Email

Resends a new account email to the user. If the user is not found, it will be ignored.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/email/resendNewAccountEmail?portalId=1&user_id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/email/resendNewAccountEmail"
);

const params = {
    "portalId": "1",
    "user_id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "success",
    "message": "New Password is created and New Account Email Sent."
}
 

Request   

POST api/email/resendNewAccountEmail

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer   

The Portal ID to which the user belongs. Example: 1

user_id   integer  optional  

string|array required The ID of the user who needs to receive a new account email. Example: 1

Loads user consents based on pagination parameters.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user-consents/tabularlist?page_size=10&page_number=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/user-consents/tabularlist"
);

const params = {
    "page_size": "10",
    "page_number": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "userConsents": [
        {
            "id": 101,
            "consentDate": "2025-04-01T14:32:00Z",
            "consentId": "CONSENT-XYZ123",
            "country": "US",
            "ipAddress": "192.168.1.15",
            "status": "accepted",
            "userId": 2001,
            "userName": "johndoe",
            "createdAt": "2025-04-01T14:32:00Z"
        },
        {
            "id": 102,
            "consentDate": "2025-04-02T09:15:43Z",
            "consentId": "CONSENT-ABC456",
            "country": "DE",
            "ipAddress": "203.0.113.45",
            "status": "rejected",
            "userId": 2002,
            "userName": "janedoe",
            "createdAt": "2025-04-02T09:15:43Z"
        }
    ],
    "total": 50,
    "recordsFiltered": 10
}
 

Request   

GET api/user-consents/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   integer   

The number of records to return per page. Example: 10

page_number   integer   

The page number to return. Example: 1

Accredible

It allows users to receive digital credentials

Validate Accredible API Key

Validates the API Key provided with the request

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/accredible/validate-key/{key}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"key\": \"sunt\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/accredible/validate-key/{key}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "key": "sunt"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Success",
    "status": "success"
}
 

Request   

GET api/accredible/validate-key/{key}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

key   string   

The API key that needs to be validated Example: sunt

Accredible Groups Lookup

Retrieves all the accredible groups. Helps while showing group names in dropdown elements.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/accredible/group/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/accredible/group/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "isEnabled": true,
    "data": [
        {
            "id": 353767,
            "name": "group_aom_course"
        },
        {
            "id": 353282,
            "name": "intro-ce"
        },
        {
            "id": 352594,
            "name": "aom"
        }
    ]
}
 

Request   

GET api/accredible/group/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Announcements

The Announcements module allows you to manage announcement-related operations within the system.

Create an Announcement

Updates an existing announcement with new content, expiry, and sending rules. Also updates the recipient list depending on the sending rules.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/announcement" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 45,
    \"expiry\": \"2025-12-31 23:59:59\",
    \"heading\": \"System Maintenance\",
    \"content\": \"The system will be down for maintenance tonight.\",
    \"sending_rules\": \"specific_users\",
    \"course_ids\": [
        101,
        102
    ],
    \"portal_ids\": [
        201,
        202
    ],
    \"user_ids\": [
        1,
        2,
        3
    ],
    \"portalId\": 5
}"
const url = new URL(
    "https://demo.aomlms.com/api/announcement"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 45,
    "expiry": "2025-12-31 23:59:59",
    "heading": "System Maintenance",
    "content": "The system will be down for maintenance tonight.",
    "sending_rules": "specific_users",
    "course_ids": [
        101,
        102
    ],
    "portal_ids": [
        201,
        202
    ],
    "user_ids": [
        1,
        2,
        3
    ],
    "portalId": 5
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 45,
    "message": "Announcement Updated Successfully"
}
 

Request   

POST api/announcement

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer   

The ID of the announcement to update. Example: 45

Body Parameters

id   integer   

The ID of the announcement (used for permission check). Example: 45

expiry   string  optional  

nullable The expiration date of the announcement. Example: 2025-12-31 23:59:59

heading   string   

The title or heading of the announcement. Example: System Maintenance

content   string   

The message content of the announcement. Example: The system will be down for maintenance tonight.

sending_rules   string   

Must be one of: all, specific_users, specific_course_users, specific_class_users, specific_portals. Example: specific_users

course_ids   string[]  optional  

required_if:sending_rules,specific_course_users The list of course IDs if targeting specific course users.

portal_ids   string[]  optional  

required_if:sending_rules,specific_portals The list of portal IDs if targeting specific portals.

user_ids   string[]  optional  

required_if:sending_rules,specific_users The list of user IDs if targeting specific users.

portalId   integer  optional  

optional The portal ID for ownership context (nullable if -1). Example: 5

Announcement Tabular List

Returns all the announcements in a tabular list format in paginated mode. You can apply filter using search_param via heading(announcement heading).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/announcement/tabularlist?portalId=5&page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=%7B%22heading%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/announcement/tabularlist"
);

const params = {
    "portalId": "5",
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"heading":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "heading": "Test Announcement",
            "author": "John Doe",
            "created_at": "2020-08-26 09:08",
            "content": "This is a test announcement",
            "rules": "all"
        }
    ]
}
 

Request   

GET api/announcement/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer  optional  

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}}

search_param   string  optional  

For searching items based on field names. Example: {"heading":""}

Update an announcement.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/announcement/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 12,
    \"expiry\": \"2020-08-05\",
    \"heading\": \"New Announcement\",
    \"content\": \"The system will be down for maintenance tonight.\",
    \"sending_rules\": \"specific_users\",
    \"course_ids\": [
        101,
        102
    ],
    \"portal_ids\": [
        201,
        202
    ],
    \"user_ids\": [
        1,
        2,
        3
    ],
    \"portalId\": 5
}"
const url = new URL(
    "https://demo.aomlms.com/api/announcement/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 12,
    "expiry": "2020-08-05",
    "heading": "New Announcement",
    "content": "The system will be down for maintenance tonight.",
    "sending_rules": "specific_users",
    "course_ids": [
        101,
        102
    ],
    "portal_ids": [
        201,
        202
    ],
    "user_ids": [
        1,
        2,
        3
    ],
    "portalId": 5
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 45,
    "message": "Announcement Updated Successfully"
}
 

Request   

PUT api/announcement/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   integer   

ID of the announcement to be updated. Example: 12

expiry   string  optional  

optional Date of expiration of announcement in Y-m-d format. Example: 2020-08-05

heading   string   

The title of the announcement. Example: New Announcement

content   string   

The message content of the announcement. Example: The system will be down for maintenance tonight.

sending_rules   string   

Must be one of: all, specific_users, specific_course_users, specific_class_users, specific_portals. Example: specific_users

course_ids   string[]  optional  

required_if:sending_rules,specific_course_users The list of course IDs if targeting specific course users.

portal_ids   string[]  optional  

required_if:sending_rules,specific_portals The list of portal IDs if targeting specific portals.

user_ids   string[]  optional  

required_if:sending_rules,specific_users The list of user IDs if targeting specific users.

portalId   integer  optional  

optional The portal ID for ownership context (nullable if -1). Example: 5

Retrieve Announcement

Retrieves the details of the specified announcement. Helps in fetching announcement using its ID. (See Parameters)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/announcement/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/announcement/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "heading": "New Announcement",
    "content": "This is for test purpose",
    "sending_rules": "all",
    "expiry": "2020-08-05"
}
 

Request   

GET api/announcement/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the announcement you want to fetch the details of. Example: 1

Delete Announcement

To delete an announcement, you need to use this request. Returns number of announcement deleted. (See Response)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/announcement/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_ids\": [
        1,
        12,
        15
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/announcement/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_ids": [
        1,
        12,
        15
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "3 announcement(s) deleted "
}
 

Request   

POST api/announcement/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string[]   

All announcement IDs which needs to be deleted.

Learner Announcement List

Returns all the announcement in list format in paginated mode. You can apply filter using search_param via heading of the announcements. These annoucement list will appear in learner panel(dashboard) not admin panel.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/student/announcements?portalId=1&page_size=5&page_number=1&order_by[colName]=created_at&order_by[direction]=desc&search_param[heading]=&viewType=self" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/student/announcements"
);

const params = {
    "portalId": "1",
    "page_size": "5",
    "page_number": "1",
    "order_by[colName]": "created_at",
    "order_by[direction]": "desc",
    "search_param[heading]": "",
    "viewType": "self",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "avatar": "http://localhost:8000/storage/users/1/avatar.jpg",
    "recordsTotal": 100,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "heading": "Announcement 1",
            "author": "John Doe",
            "content": "<p>This is an example of announcement content</p>",
            "created_at": "21st Jan, 2020 12:00 PM"
        },
        {
            "id": 2,
            "heading": "Announcement 2",
            "author": "John Doe",
            "content": "<p>This is an example of announcement content</p>",
            "created_at": "21st Jan, 2020 12:00 PM"
        }
    ]
}
 

Request   

GET api/student/announcements

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer   

Portal ID. Example: 1

page_size   integer   

Records per page. Example: 5

page_number   integer   

Page number. Example: 1

order_by   object   

Order_by object.

search_param   object   

Search param object.

viewType   string   

View type. Example: self

Assignments

An Assignment Module is a lesson module used as course content. Helps to perform CRUD operation to and for Assignments modules.

Assignment Modules Tabular List

Returns all the assignment modules in a tabular list format in paginated mode. You can apply filter using search_param via associatedCourse(modules used in course) and moduleName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/assignment?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=%7B%22associatedCourse%22%3A%22%22%2C%22moduleName%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/assignment"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"associatedCourse":"","moduleName":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "name": "Assignment-1",
            "slug": "assignment-1",
            "type": "assignment",
            "submissionType": "file",
            "display_type": "File",
            "totalPoints": 20,
            "icon": "<i class=\"el-icon-document\"></i>",
            "author": "Aom Staff",
            "created_at": "Aug 03, 2020 09:56 AM",
            "showMappedCourses": false,
            "course_count": 1
        }
    ]
}
 

Request   

GET api/modules/assignment

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}}

search_param   string  optional  

For searching items based on field names. Example: {"associatedCourse":"","moduleName":""}

Create Assignment Module

Handles the creation of an assignment module as part of course content. Validates the request and saves a new module with the given parameters.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/modules/assignment" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Essay on LMS\",
    \"content\": \"An introduction to LMS.\",
    \"totalPoints\": 30,
    \"submission_type\": \"file\",
    \"allowed_filetypes\": \"[\\\"pdf\\\", \\\"docx\\\"]\",
    \"isLocked\": true,
    \"estimatedCompletion\": \"90\",
    \"estimationCompletedUnit\": \"minutes\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/assignment"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Essay on LMS",
    "content": "An introduction to LMS.",
    "totalPoints": 30,
    "submission_type": "file",
    "allowed_filetypes": "[\"pdf\", \"docx\"]",
    "isLocked": true,
    "estimatedCompletion": "90",
    "estimationCompletedUnit": "minutes"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 5,
    "message": "Module saved successfully"
}
 

Request   

POST api/modules/assignment

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

Name of the assignment module. Example: Essay on LMS

content   string   

Content for the assignment module. Example: An introduction to LMS.

totalPoints   integer  optional  

Points awarded for completing the assignment. Example: 30

submission_type   string   

Type of submission (text or file). Example: file

allowed_filetypes   string  optional  

Required if submission type is file. Example: ["pdf", "docx"]

isLocked   boolean  optional  

Indicates if the module is locked. Example: true

estimatedCompletion   nullable  optional  

Estimated time to complete the module. Example: 90

estimationCompletedUnit   nullable  optional  

Unit of time estimation (e.g., minutes, hours). Example: minutes

Update Assignment Module

Updates the details of a specified assignment module. (See parameters) Assignment modules can be used in the course as course content.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/modules/assignment/6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Getting Started\",
    \"content\": \"<p>This is the updated short content here<\\/p>\",
    \"totalPoints\": 20,
    \"submission_type\": \"file\",
    \"allowed_filetypes\": [
        \"pdf\",
        \"docx\"
    ],
    \"isLocked\": true,
    \"estimatedCompletion\": \"90\",
    \"estimationCompletedUnit\": \"minutes\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/assignment/6"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Getting Started",
    "content": "<p>This is the updated short content here<\/p>",
    "totalPoints": 20,
    "submission_type": "file",
    "allowed_filetypes": [
        "pdf",
        "docx"
    ],
    "isLocked": true,
    "estimatedCompletion": "90",
    "estimationCompletedUnit": "minutes"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Module updated successfully"
}
 

Request   

PUT api/modules/assignment/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the assignment module. Example: 6

Body Parameters

name   string   

Name of the assignment module. Example: Getting Started

content   string  optional  

Content for the assignment modules that students will see. Example: <p>This is the updated short content here</p>

totalPoints   integer  optional  

Total points a student can get by completing this assignment. Example: 20

submission_type   string   

Type for the assignment module(file based or text based). Submission type options: text or file. Example: file

allowed_filetypes   string[]   

Allowed file types that will be submitted by the students when the submission_type is file.

isLocked   boolean   

If true, the assignment is locked and students cannot submit it. Example: true

estimatedCompletion   nullable  optional  

Estimated time to complete the module. Example: 90

estimationCompletedUnit   nullable  optional  

Unit of time estimation (e.g., minutes, hours). Example: minutes

Retrieve Assignment Module

Retrieves the details of the specified assignment module using its ID. This includes the module's ID, name, slug, content, total points, submission type, allowed file types, estimated completion, and associated courses. If the module's details exist, it fetches additional information such as total points, submission type, lock status, and allowed file types.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/assignment/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": \"qui\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/assignment/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": "qui"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{"id": 1, "name": "Assignment-1", "slug": "assignment-1", "content": "Content description", "totalPoints": 100, "submission_type": "file", "allowed_filetypes": ["image", "pdf"], "estimatedCompletion": 5, "estimationCompletedUnit": hour,
"courses": [{"course_id": 1, "course_name": "Course Name"}]}
 

Request   

GET api/modules/assignment/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   required  optional  

The ID of the assignment module to fetch details for. Example: qui

Retrieve Detailed Assignment Module Info

Retrieves detailed information of an assignment module including course details, module details, and previous submissions. This function also checks if the module can be launched based on the current registration and updates the module's status if accessed.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/assignment/details?portalId=1&registrationId=1&moduleId=4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/assignment/details"
);

const params = {
    "portalId": "1",
    "registrationId": "1",
    "moduleId": "4",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "Assignment 1",
    "slug": "assignment-1",
    "content": "<p>Example content</p>",
    "courseName": "Course 1",
    "courseSlug": "http://localhost:8000/course/course-1",
    "min_time_spent": 120,
    "totalPoints": 100,
    "submissionType": "file",
    "maxUploadSize": 50,
    "allowedFileTypes": ".pdf,.docx",
    "otherModules": [
        {
            "module_id": 1,
            "name": "test",
            "slug": "test",
            "type": "text",
            "icon": "<i class=\"el-icon-tickets\"></i>",
            "is_locked": false,
            "lock_reason": "",
            "is_dripped": false,
            "drip_message": "",
            "is_current": false,
            "status_row_id": 1,
            "status": "Completed",
            "started_on": "2020-08-03T10:02:33.000000Z",
            "completed_on": "2020-08-03T10:02:41.000000Z",
            "last_accessed_on": "8 hours ago",
            "total_time_spent": {
                "hours": 0,
                "minutes": 0,
                "seconds": 6,
                "totalSeconds": 6
            },
            "completion_percentage": 100,
            "no_of_times_accessed": 3
        },
        {
            "module_id": 4,
            "name": "assign",
            "slug": "assign",
            "type": "assignment",
            "icon": "<i class=\"el-icon-edit-outline\"></i>",
            "is_locked": false,
            "lock_reason": "",
            "is_dripped": false,
            "drip_message": "",
            "is_current": true,
            "status_row_id": -1,
            "status": "Not Started",
            "started_on": "",
            "completed_on": "",
            "last_accessed_on": "Never",
            "total_time_spent": "",
            "points_awarded": "",
            "completion_percentage": 0,
            "no_of_times_accessed": 0
        },
        {
            "module_id": 7,
            "name": "First-quiz",
            "slug": "first-quiz",
            "type": "quiz",
            "icon": "<i class=\"el-icon-discover\"></i>",
            "is_locked": false,
            "lock_reason": "",
            "is_dripped": false,
            "drip_message": "",
            "is_current": false,
            "status_row_id": -1,
            "status": "Not Started",
            "started_on": "",
            "completed_on": "",
            "last_accessed_on": "Never",
            "total_time_spent": "",
            "points_awarded": "",
            "completion_percentage": 0,
            "no_of_times_accessed": 0
        },
        {
            "module_id": 9,
            "name": "My-video-lesson",
            "slug": "my-video-lesson",
            "type": "video",
            "icon": "<i class=\"el-icon-video-play\"></i>",
            "is_locked": false,
            "lock_reason": "",
            "is_dripped": false,
            "drip_message": "",
            "is_current": false,
            "status_row_id": 4,
            "status": "In Progress",
            "started_on": "2020-08-10T20:04:14.000000Z",
            "completed_on": null,
            "last_accessed_on": "6 hours ago",
            "total_time_spent": {
                "hours": 0,
                "minutes": 0,
                "seconds": 0,
                "totalSeconds": null
            },
            "completion_percentage": 0,
            "no_of_times_accessed": 1
        },
        {
            "module_id": 10,
            "name": "Essay on LMS",
            "slug": "essay-on-lms",
            "type": "assignment",
            "icon": "<i class=\"el-icon-edit-outline\"></i>",
            "is_locked": false,
            "lock_reason": "",
            "is_dripped": false,
            "drip_message": "",
            "is_current": false,
            "status_row_id": 5,
            "status": "Completed",
            "started_on": "2020-08-11T02:47:32.000000Z",
            "completed_on": "2020-08-11T02:47:32.000000Z",
            "last_accessed_on": "46 seconds ago",
            "total_time_spent": {
                "hours": 0,
                "minutes": 0,
                "seconds": 0,
                "totalSeconds": null
            },
            "completion_percentage": 100,
            "no_of_times_accessed": 1
        }
    ],
    "launchCheck": {
        "canbeLaunched": true,
        "errTitle": "",
        "errDesc": ""
    },
    "prevSlug": "previous-assignment",
    "nextSlug": "next-assignment",
    "status": "In Progress",
    "display_status": "In Progress",
    "statusRowId": 5,
    "timeSpent": 30,
    "prevSubmission": [],
    "timeToBeSpent": 2
}
 

Request   

GET api/module/assignment/details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer  optional  

ID of the portal for which the assignment is being submitted. Example: 1

registrationId   string   

ID of the course registration to which the module is attached. Example: 1

moduleId   string   

ID of the assignment module. Example: 4

Retrieve Assignment Submission Details

Retrieves the submission details of the assigment the student have given. Helps in grading a student. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/assignment/submissions?statusRowId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/assignment/submissions"
);

const params = {
    "statusRowId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "courseId": 1,
    "courseName": "course 1",
    "assignmentName": "assign",
    "status": "In Progress",
    "content": "Desc",
    "totalPoints": 50,
    "userFullName": "Aom Staff",
    "userEmail": "[email protected]",
    "submissions": [
        {
            "id": 1,
            "file_path": [
                "aom-uploads-test.s3.us-west-2.amazonaws.com/assignments/aom-sample-bulkupload_1597042007.csv"
            ],
            "student_message": null,
            "instructor_message": null,
            "points_awarded": null,
            "evaluated_by": "",
            "submitted_on": "Aug 10, 2020 11:33 AM",
            "evaluated_on": ""
        }
    ]
}
 

Request   

GET api/module/assignment/submissions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

statusRowId   string   

ID of the Module status of the current assignment. Example: 1

Submit Assignment

Submits the assignment after attempting all the aspects of the assignment.Updates the status of assignment to submitted if student is finished the assignment and submits. (See Parameters)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/module/assignment/submit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalId\": 1,
    \"statusRowId\": \"7\",
    \"submissions\": \"[1,2,3]\",
    \"studentMessage\": \"\\\"This is my assignment submission\\\"\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/module/assignment/submit"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalId": 1,
    "statusRowId": "7",
    "submissions": "[1,2,3]",
    "studentMessage": "\"This is my assignment submission\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Assignment submitted successfully"
}
 

Request   

POST api/module/assignment/submit

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalId   integer  optional  

ID of the portal for which the assignment is being submitted. Example: 1

statusRowId   required  optional  

ID of the Module status of the current assignment. Example: 7

submissions   required  optional  

Submission data(file or text). Example: [1,2,3]

studentMessage   required  optional  

Student message to instructor. Example: "This is my assignment submission"

Upload Assignment File

Handles the upload of an assignment file by students. You can use File form to upload a file to the system.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/module/assignment/upload" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"file\": \"aliquam\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/module/assignment/upload"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "file": "aliquam"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "s3_url": "https://s3.aws.com/wTsycTYRCLKIUVXXIYFYVXBXIXUGIXB"
}
 

Request   

POST api/module/assignment/upload

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

file   string   

File to be uploaded for current assignment. Example: aliquam

Evaluate Assignment

Evaluates the assignment from Instructor side.Updates the status of assignment to completed if Instructor thinks student's submission is upto the marks. (See Parameters)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/module/assignment/evaluate" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalId\": 1,
    \"statusRowId\": \"7\",
    \"evaluation\": \"{instructorMessage : \'You comments look good\', pointsAwarded: \'50\', isAccepted : true }\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/module/assignment/evaluate"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalId": 1,
    "statusRowId": "7",
    "evaluation": "{instructorMessage : 'You comments look good', pointsAwarded: '50', isAccepted : true }"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Assignment evaluated successfully"
}
 

Request   

POST api/module/assignment/evaluate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalId   integer  optional  

ID of the portal for which the assignment is being submitted. Example: 1

statusRowId   required  optional  

ID of the Module status of the current assignment. Example: 7

evaluation   required  optional  

Evaluation data by the Instructor(Completed or not). Example: {instructorMessage : 'You comments look good', pointsAwarded: '50', isAccepted : true }

Audit Logs

It allows you to track the user activity in the LMS.

Get Audit Activities

Fetches and paginates a list of audit log activities for the selected portal and date range. Supports filtering by user, activity type, date range, and model (performedOn). Also allows sorting.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/audit-activities?portalId=5&page_size=10&page_number=1&order_by[colName]=created_at&order_by[direction]=desc&search_param=%7B%22user_id%22%3A3%2C%22activityName%22%3A%22created%22%2C%22dates%22%3A%5B%222024-12-01%22%2C%222024-12-31%22%5D%2C%22performedOn%22%3A%22Course%22%7D&context=admin&selectedMonth=03-2024" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/audit-activities"
);

const params = {
    "portalId": "5",
    "page_size": "10",
    "page_number": "1",
    "order_by[colName]": "created_at",
    "order_by[direction]": "desc",
    "search_param": "{"user_id":3,"activityName":"created","dates":["2024-12-01","2024-12-31"],"performedOn":"Course"}",
    "context": "admin",
    "selectedMonth": "03-2024",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 135,
    "recordsFiltered": 23,
    "records": [
        {
            "performed_by": "Jane Doe",
            "effect_on": "Course",
            "subject": "Course: Laravel Basics",
            "action": "CREATED",
            "created_at": "13 Apr 2025 02:45 PM",
            "details": {
                "attributes": {
                    "name": "Laravel Basics",
                    "status": "active"
                }
            }
        }
    ],
    "performedOnList": [
        "Course",
        "Module",
        "User"
    ]
}
 

Request   

GET api/audit-activities

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer  optional  

optional Filter activities based on a specific portal and its sub-portals. Example: 5

page_size   integer   

Number of records per page. Example: 10

page_number   integer   

The current page number. Example: 1

order_by   object  optional  

optional Sorting details as a JSON object with colName and direction.

search_param   string  optional  

optional JSON-encoded object containing search filters (user_id, activityName, dates, performedOn). Example: {"user_id":3,"activityName":"created","dates":["2024-12-01","2024-12-31"],"performedOn":"Course"}

context   string  optional  

optional Custom context passed from frontend (not used internally). Example: admin

selectedMonth   string   

The selected month (in m-Y format) used to determine the date range for filtering. Example: 03-2024

Audit Activity Lookup

Retrieves all the activities performed by the user. This is a lookup request that helps in showing options in dropdowns elements.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/audit-activities/verb/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/audit-activities/verb/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "login",
        "display_value": "LOGIN"
    },
    {
        "db_value": "created",
        "display_value": "CREATED"
    },
    {
        "db_value": "updated",
        "display_value": "UPDATED"
    },
    {
        "db_value": "deleted",
        "display_value": "DELETED"
    }
]
 

Request   

GET api/audit-activities/verb/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Badge

Endpoints for handling and managing Gamification badges

Get a tabular list of badges, with pagination and search

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/badges/tabularlist?page_size=50&page_number=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/badges/tabularlist"
);

const params = {
    "page_size": "50",
    "page_number": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "title": "Badge 1",
            "badgeIconUrl": "https://example.com/badge1.png",
            "points": 10
        },
        {
            "id": 2,
            "title": "Badge 2",
            "badgeIconUrl": "https://example.com/badge2.png",
            "points": 20
        }
    ]
}
 

Request   

GET api/badges/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   integer  optional  

Number of records to return per page. Example: 50

page_number   integer  optional  

Page number to return. Example: 1

order_by   object  optional  

Sort the results by the given column and direction. e.g. {colName: 'title', direction: 'asc'}

search_param   object  optional  

Search for records with the given parameters. e.g. {title: 'test'}

Create a new badge

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/badge/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"title\": \"Gold\",
    \"points\": \"1\",
    \"badgeIconUrl\": \"\\/images\\/badges\\/Badge_1.png\",
    \"defaultIconUrl\": \"\\/images\\/default-badge.png\",
    \"organizationId\": \"97852067\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/badge/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "title": "Gold",
    "points": "1",
    "badgeIconUrl": "\/images\/badges\/Badge_1.png",
    "defaultIconUrl": "\/images\/default-badge.png",
    "organizationId": "97852067"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 3,
    "message": "Badge created successfully"
}
 

Request   

POST api/badge/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

title   required  optional  

string The title of the badge. Example: Gold

points   required  optional  

numeric The number of points the badge is worth. Example: 1

badgeIconUrl   required  optional  

string The URL of the icon for the badge. Example: /images/badges/Badge_1.png

defaultIconUrl   nullable  optional  

string The default icon URL to use if the badgeIconUrl is not available. Example: /images/default-badge.png

organizationId   nullable  optional  

string The ID of the organization the badge belongs to. Example: 97852067

Return default badges available in the system.

These badges are not stored in the database and are available for use as soon as the application is installed.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/badges/defaultBadgeLookUp" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/badges/defaultBadgeLookUp"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "value": "Badge 1",
    "url": "/images/badges/Badge_1.png"
}
 

Request   

GET api/badges/defaultBadgeLookUp

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieve a badge by its ID.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/badge/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/badge/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "title": "Gold",
    "points": 1,
    "organizationId": "97852067",
    "badgeIconUrl": "/images/badges/Badge_1.png"
}
 

Request   

GET api/badge/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the badge needs to be retrieved. Example: 1

Update an existing badge by its ID.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/badge/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"title\": \"Gold\",
    \"points\": \"1\",
    \"badgeIconUrl\": \"\\/images\\/badges\\/Badge_1.png\",
    \"defaultIconUrl\": \"\\/images\\/default-badge.png\",
    \"organizationId\": \"97852067\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/badge/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "title": "Gold",
    "points": "1",
    "badgeIconUrl": "\/images\/badges\/Badge_1.png",
    "defaultIconUrl": "\/images\/default-badge.png",
    "organizationId": "97852067"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Badge updated successfully"
}
 

Request   

PUT api/badge/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer   

The ID of the badge to be updated. Example: 1

Body Parameters

title   required  optional  

string The title of the badge. Example: Gold

points   nullable  optional  

numeric The number of points the badge is worth. Example: 1

badgeIconUrl   required  optional  

string The URL of the icon for the badge. Example: /images/badges/Badge_1.png

defaultIconUrl   nullable  optional  

string The default icon URL to use if the badgeIconUrl is not available. Example: /images/default-badge.png

organizationId   nullable  optional  

string The ID of the organization the badge belongs to. Example: 97852067

Delete specified badges.

Deletes badges that are not assigned to any users and not used in gamification events. Logs an activity for each deleted badge.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/badge/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_ids\": [
        1,
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/badge/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_ids": [
        1,
        2,
        3
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "1 badge(s) deleted. 0 badge(s) not deleted as they are assigned to users. 0 badge(s) not deleted as they are used in gamification events."
}
 

Request   

POST api/badge/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string[]   

An array of badge IDs to be deleted. The IDs must have permission to be deleted.

Categories

Categories represents Course category, Product category, Question category. Helps performimg operations in all these models.

Product Category Lookup

Retrieves all the product categories. This request helps in showing all product categories in form elements like dropdown, etc. Returns ID and name of the product category.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/categories/product/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/categories/product/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Product Category 1"
    }
]
 

Request   

GET api/categories/product/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Course Category Lookup

Retrieves all categories of the courses. If courseIds is provided, it will filter the categories for those courses. If categoryIds is provided, it will filter the categories with those IDs. Returns name and id of the category.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/categories/course/lookup?array=%5B1%2C2%5D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/categories/course/lookup"
);

const params = {
    "array": "[1,2]",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Category 1"
}
 

Request   

GET api/categories/course/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

array   string  optional  

categoryIds The IDs of the categories to filter. Example: [1,2]

Module Category Lookup

Retrieves all categories of the modules. Returns name and id of the category.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/categories/module/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/categories/module/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Category 1"
}
 

Request   

GET api/categories/module/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Question Category Lookup

Retrieves all the categories of the questions user has ever created. This request helps in showing all question categories in form elements like dropdown, etc. Returns ID and name of the question category.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/categories/question/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/categories/question/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 4,
        "name": "Question-cat"
    }
]
 

Request   

GET api/categories/question/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

User Category Lookup

Retrieves all the categories of the users user has ever created. This request helps in showing all user categories in form elements like dropdown, etc. Returns ID and name of the user category.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/categories/user/lookup?search_term=numquam" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/categories/user/lookup"
);

const params = {
    "search_term": "numquam",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "User Category 1"
    }
]
 

Request   

GET api/categories/user/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

search_term   string  optional  

optional The name or substring of the user category name to search for that user category. example: user Example: numquam

Learning Path Category Lookup

Retrieves all the categories of the learning paths user has ever created. This request helps in showing all learning path categories in form elements like dropdown, etc. Returns ID and name of the learning path category.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/categories/learning-path/lookup?search_term=sed" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/categories/learning-path/lookup"
);

const params = {
    "search_term": "sed",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Learning Path Category 1"
    }
]
 

Request   

GET api/categories/learning-path/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

search_term   string  optional  

optional The name or substring of the learning path category name to search for that learning path category. example: learning Example: sed

Course Category Tabular List

Returns all the course categories in a tabular list format in paginated mode. You can apply filter using search_param via categoryName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/coursecategory/tabularlist?page_size=9&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22categoryName%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/coursecategory/tabularlist"
);

const params = {
    "page_size": "9",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"categoryName":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 4,
    "recordsFiltered": 3,
    "records": [
        {
            "id": 3,
            "name": "superman_postman",
            "author": "Client Admin",
            "count": 0,
            "created_at": "Aug 10, 2020 12:43 PM"
        },
        {
            "id": 2,
            "name": "category-new",
            "author": "Aom Staff",
            "count": 0,
            "created_at": "Aug 10, 2020 12:37 PM"
        },
        {
            "id": 1,
            "name": "Category-1",
            "author": "Aom Staff",
            "count": 1,
            "created_at": "Aug 09, 2020 06:20 PM"
        }
    ]
}
 

Request   

GET api/coursecategory/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 9

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

For searching items based on category name. Example: {"categoryName":""}

Module Category Tabular List

Returns all the module categories in a tabular list format in paginated mode. You can apply a filter using search_param via categoryName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modulecategory/tabularlist?page_size=9&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22categoryName%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modulecategory/tabularlist"
);

const params = {
    "page_size": "9",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"categoryName":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 4,
    "recordsFiltered": 2,
    "records": [
        {
            "id": 1,
            "name": "module-category-1",
            "author": "Aom Staff",
            "count": 3,
            "created_at": "Aug 10, 2020 12:43 PM"
        },
        {
            "id": 2,
            "name": "module-category-2",
            "author": "Client Admin",
            "count": 1,
            "created_at": "Aug 09, 2020 06:20 PM"
        }
    ]
}
 

Request   

GET api/modulecategory/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 9

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

For searching items based on category name. Example: {"categoryName":""}

Product Category Tabular List

Returns all the product categories in a tabular list format in paginated mode. You can apply a filter using search_param via categoryName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/productcategory/tabularlist?page_size=9&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22categoryName%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/productcategory/tabularlist"
);

const params = {
    "page_size": "9",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"categoryName":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 2,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 2,
            "name": "product memberships",
            "author": "Aom Staff",
            "count": 1,
            "created_at": "May 10, 2022 03:39 AM"
        }
    ]
}
 

Request   

GET api/productcategory/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 9

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

For searching items based on category name. Example: {"categoryName":""}

Question Category Tabular List

Returns all the question categories in a tabular list format in paginated mode. You can apply filter using search_param via categoryName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/questioncategory/tabularlist?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=%7B%22categoryName%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/questioncategory/tabularlist"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"categoryName":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 3,
    "recordsFiltered": 3,
    "records": [
        {
            "id": 1,
            "name": "Question Category-1",
            "author": "Aom Staff",
            "count": 4,
            "created_at": "Aug 10, 2020 12:43 PM"
        },
        {
            "id": 2,
            "name": "Question Category-2",
            "author": "Client Admin",
            "count": 2,
            "created_at": "Aug 09, 2020 06:20 PM"
        },
        {
            "id": 3,
            "name": "Question Category-3",
            "author": "Aom Staff",
            "count": 1,
            "created_at": "Aug 10, 2020 06:34 PM"
        }
    ]
}
 

Request   

GET api/questioncategory/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}}

search_param   string  optional  

For searching items based on field names. Example: {"categoryName":""}

Create Category

Creates a new category using parameters mentioned. (See parameters) Creates the course/question/product category details using category name and category type.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/category/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"category_name\": \"category-new\",
    \"categoryType\": \"course\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/category/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "category_name": "category-new",
    "categoryType": "course"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Category Created Successfully"
}
 

Request   

POST api/category/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

category_name   string   

Name of the category. Example: category-new

categoryType   string   

Type of the category to be created. Example: course

Update Category

Updates a category using parameters mentioned. (See parameters) Updates the course/question/product category details using category name and category type.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/category/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"category_name\": \"category-new\",
    \"categoryType\": \"course\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/category/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "category_name": "category-new",
    "categoryType": "course"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Category Updated Successfully"
}
 

Request   

PUT api/category/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the category. Example: 3

Body Parameters

category_name   string   

Name of the category. Example: category-new

categoryType   string   

Type of the category to be updated. Example: course

Get Category

Retrieves a category by its ID.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/category/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/category/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 3,
    "name": "superman_postman",
    "type": "course",
    "created_by": 2,
    "updated_by": null,
    "deleted_by": null,
    "created_at": "2020-08-10 12:43:12",
    "updated_at": "2020-08-10 12:56:37",
    "deleted_at": null
}
 

Request   

GET api/category/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the category. Example: 3

Delete categories of given type

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/category/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"type\": \"question\",
    \"delete_ids\": \"[1,2,3]\",
    \"categoryName\": \"Question Category-1\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/category/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "type": "question",
    "delete_ids": "[1,2,3]",
    "categoryName": "Question Category-1"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "3 category(s) deleted. 2 category(s) not deleted as it is used in dynamic quiz(s). Please remove the category from the quiz and try again.",
    "deletedCategories": [
        4
    ],
    "notDeletedCategories": [
        1,
        2
    ],
    "usedInPlaces": [
        {
            "Question Category-1": [
                {
                    "id": 1,
                    "name": "Quiz Name 1"
                },
                {
                    "id": 2,
                    "name": "Quiz Name 2"
                }
            ]
        },
        {
            "Question Category-2": [
                {
                    "id": 3,
                    "name": "Quiz Name 3"
                }
            ]
        }
    ]
}
 

Request   

POST api/category/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

type   required  optional  

Type of category to be deleted. Example: question

delete_ids   required  optional  

Ids of categories to be deleted. Example: [1,2,3]

categoryName   required  optional  

Name of category to be deleted. Example: Question Category-1

Get the count of questions in a category

Get the count of questions in a category.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/categories/question-count" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/categories/question-count"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "questionCount": 10
}
 

Request   

GET api/categories/question-count

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

categoryId   string   

The category id. Example: 1

Learning Path Category Tabular List

Returns all the learning path categories in a tabular list format in paginated mode. You can apply a filter using search_param via categoryName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/learning-pathcategory/tabularlist?page_size=9&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22categoryName%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-pathcategory/tabularlist"
);

const params = {
    "page_size": "9",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"categoryName":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "name": "learning path category 1",
            "author": "Aom Staff",
            "count": 1,
            "created_at": "May 16, 2022 07:00 AM"
        }
    ]
}
 

Request   

GET api/learning-pathcategory/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the item you want for a page. Example: 9

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

For searching items based on category name. Example: {"categoryName":""}

Certificate Templates

A Certificate template is used to provide to learners. learners can achieve this award by completing the course. Helps in performing CRUD operations for and to certificates

Certificate Template Lookup

Returns all the certificate templates in a list format.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/certificate_templates/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/certificate_templates/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "cert 1"
}
 

Request   

GET api/certificate_templates/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Certificate Template Tabular List

Returns all the certificate templates in a tabular list format in paginated mode. You can apply filter using search_param via templateName(certificate template name) and courseId(course Id).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/certificate_templates/tabularlist?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=%7B%22templateName%22%3A%22abc%22%2C%22courseId%22%3A%221%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/certificate_templates/tabularlist"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"templateName":"abc","courseId":"1"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "name": "cert 1",
            "slug": "cert-1",
            "status": "publish",
            "categories": "",
            "author": "Aom Staff",
            "created_at": "03 Aug 2020 09:08 AM"
        }
    ]
}
 

Request   

GET api/certificate_templates/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the item you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}}

search_param   string  optional  

For searching items based on Course category ids, course name. Example: {"templateName":"abc","courseId":"1"}

Quick Edit Certificate Templates

Updates the instructor/author for the selected certificate templates.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/certificate_templates/quickEdit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"template_ids\": \"explicabo\",
    \"author_id\": \"commodi\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/certificate_templates/quickEdit"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "template_ids": "explicabo",
    "author_id": "commodi"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Certificate Templates updated Successfully"
}
 

Request   

POST api/certificate_templates/quickEdit

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

template_ids   required  optional  

array The list of ids of the certificate templates you want to perform the action on. Example: explicabo

author_id   required  optional  

integer The ID of the new instructor/author. Example: commodi

Field Keys Lookup

Retrieves all the fields that can be available on the certificate template. Helps while showing fields in form elements like dropdown while creating certificate template. Returns a list of all fields that can be used on the certificate template. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/certificate_template/keysLookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/certificate_template/keysLookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "student_first_name",
        "display_value": "Student First Name"
    },
    {
        "db_value": "student_last_name",
        "display_value": "Student Last Name"
    },
    {
        "db_value": "student_full_name",
        "display_value": "Student Full Name"
    },
    {
        "db_value": "course_name",
        "display_value": "Course Name"
    },
    {
        "db_value": "issue_date",
        "display_value": "Date of Issue"
    },
    {
        "db_value": "expiry_date",
        "display_value": "Date of Expiry"
    },
    {
        "db_value": "instructor_name",
        "display_value": "Instructor Name"
    },
    {
        "db_value": "certificate_code",
        "display_value": "Certificate Code"
    },
    {
        "db_value": "course_credit",
        "display_value": "Course Credit"
    },
    {
        "db_value": "learning_path_name",
        "display_value": "Learning Path Name"
    },
    {
        "db_value": "learning_path_credit",
        "display_value": "Learning Path Credit"
    },
    {
        "db_value": "custom_text",
        "display_value": "Custom Text"
    }
]
 

Request   

GET api/certificate_template/keysLookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Font Families Lookup

Retrieves all the font families that can be used on the certificate template. Helps while showing font families in form elements like dropdown while creating certificate template. Returns a list of all font families that can be used on the certificate template. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/certificate_template/fontFamilyLookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/certificate_template/fontFamilyLookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "Lato",
        "display_value": "Arial",
        "is_selected": "true"
    },
    {
        "db_value": "Courier",
        "display_value": "Courier"
    },
    {
        "db_value": "Source Sans Pro",
        "display_value": "Helvetica"
    },
    {
        "db_value": "Montserrat",
        "display_value": "Montserrat"
    },
    {
        "db_value": "Roboto Condensed",
        "display_value": "Roboto"
    },
    {
        "db_value": "Space Mono",
        "display_value": "Space Mono"
    },
    {
        "db_value": "Roboto Slab",
        "display_value": "Roboto Slab"
    }
]
 

Request   

GET api/certificate_template/fontFamilyLookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Create Certificate Template

Creates a new certificate template and stores it in the database. The template can be used to assign to students upon course completion.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/certificate_template" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Completion-Certificate\",
    \"organization_id\": 12,
    \"bg_url\": \"http:\\/\\/aom.com\\/images\\/default-certificate.png\",
    \"height\": 680,
    \"width\": 1075,
    \"fields\": [
        \"est\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/certificate_template"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Completion-Certificate",
    "organization_id": 12,
    "bg_url": "http:\/\/aom.com\/images\/default-certificate.png",
    "height": 680,
    "width": 1075,
    "fields": [
        "est"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 2,
    "message": "Certificate Template created successfully"
}
 

Request   

POST api/certificate_template

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

The name of the certificate template. Example: Completion-Certificate

organization_id   integer  optional  

optional The ID of the organization associated with the certificate template. Example: 12

bg_url   string  optional  

optional The URL of the background image for the certificate template. Example: http://aom.com/images/default-certificate.png

height   integer   

The height of the certificate template. Example: 680

width   integer   

The width of the certificate template. Example: 1075

fields   string[]   

The array of fields to be included in the certificate. Each field contains its properties like key, font size, font family, etc.

Retrieves a single certificate template.

Returns a single certificate template based on the id provided. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/certificate_template/facilis" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/certificate_template/facilis"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Completion-Certificate",
    "organization_id": 1,
    "bg_url": "http://aom.com/images/default-certificate.png",
    "height": 680,
    "width": 1075,
    "fields": [
        {
            "key": "course_name",
            "value": "Course Name",
            "font_size": 20,
            "font_family": "Arial",
            "font_color": "#222",
            "top": 432,
            "left": 469,
            "align_center": false,
            "width": 200,
            "height": 40
        }
    ]
}
 

Request   

GET api/certificate_template/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the certificate template. Example: facilis

Preview Certificate Template

Allows users to preview a certificate template by downloading it with demo data. Simulates 100% completion and marks the text module as completed.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/certificate_template/preview/2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/certificate_template/preview/2"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


PDF file as a download
 

Request   

GET api/certificate_template/preview/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the certificate template. Example: 2

Update Certificate Template

Updates the details of a specified certificate template.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/certificate_template/4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Completion-Certificate\",
    \"organization_id\": 19,
    \"bg_url\": \"http:\\/\\/aom.com\\/images\\/default-certificate.png\",
    \"height\": 680,
    \"width\": 1075,
    \"fields\": [
        \"praesentium\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/certificate_template/4"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Completion-Certificate",
    "organization_id": 19,
    "bg_url": "http:\/\/aom.com\/images\/default-certificate.png",
    "height": 680,
    "width": 1075,
    "fields": [
        "praesentium"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Certificate Template updated successfully"
}
 

Request   

PUT api/certificate_template/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer   

The ID of the certificate template to be updated. Example: 4

Body Parameters

name   string   

The name of the certificate template. Example: Completion-Certificate

organization_id   integer  optional  

optional The ID of the organization associated with the certificate template. Example: 19

bg_url   string  optional  

optional The URL of the background image for the certificate template. Example: http://aom.com/images/default-certificate.png

height   integer   

The height of the certificate template. Example: 680

width   integer   

The width of the certificate template. Example: 1075

fields   string[]   

The array of fields to be included in the certificate. Each field contains its properties like key, font size, font family, etc.

Deletes a certificate template or multiple templates.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/certificate_template/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_ids\": \"[1,2,3]\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/certificate_template/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_ids": "[1,2,3]"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "1 template(s) deleted. 2 template(s) not deleted as it is used in course. Please remove the template(s) from the course and try again.",
    "deletedTemplates": [1],
    "notDeletedTemplates": [2,3],
    "coursesWithTemplates": { "2": [{"id": 2, "name": "Course 2"}, {"id": 3, "name": "Course 3"}]
}
 

Request   

POST api/certificate_template/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string   

The IDs of the certificate templates to be deleted. Example: [1,2,3]

Clone Certificate Template

Clones the selected certificate template to create a new one with same settings. The new template name is set as "_copy"

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/certificate/clone" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"templateId\": \"porro\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/certificate/clone"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "templateId": "porro"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Certificate Template Cloned Successfully"
}
 

Request   

POST api/certificate/clone

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

templateId   required  optional  

integer The ID of the certificate template you want to clone. Example: porro

Courses

You can perform operations like create, edit, delete on courses and its contents.

Load Course Rating Details

Retrieves the course ratings with details. The response includes course name, course ID, rating, reviews, user ID, user display name, user avatar, and submission date.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course/ratings/details?page_size=10&page_number=1&courseIds=%5B1%2C2%2C3%5D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course/ratings/details"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "courseIds": "[1,2,3]",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "ratings": [
        {
            "id": 1,
            "courseName": "Course 1",
            "courseId": 1,
            "rating": 4.5,
            "userId": 1,
            "reviews": "This is a sample review",
            "userDisplayName": "John Doe",
            "avatar": "<svg...>",
            "submissionDate": "Feb 2020"
        }
    ],
    "total": 20,
    "recordsFiltered": 10
}
 

Request   

GET api/course/ratings/details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

Number of records to return per page. Example: 10

page_number   string   

Current page number. Example: 1

courseIds   string   

An array of course IDs to filter the ratings by. Example: [1,2,3]

Retrieve course curriculum details

Retrieves the course curriculum details given a set of course IDs. The response includes course name, modules, and sections.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/courses/curriculum?courseIds=placeat" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/courses/curriculum"
);

const params = {
    "courseIds": "placeat",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "name": "Course 1",
        "modules": [
            {
                "module_id": 1,
                "name": "Test Module 1",
                "type": "text",
                "display_type": "Text",
                "icon": "el-icon-tickets"
            },
            {
                "section_name": "Section 1",
                "modules": [
                    {
                        "module_id": 2,
                        "name": "Test Module 2",
                        "type": "video",
                        "display_type": "Video",
                        "icon": "el-icon-video-camera"
                    }
                ]
            }
        ]
    }
]
 

Request   

GET api/courses/curriculum

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

courseIds   string   

An array of course IDs to retrieve their curriculum details. example: [1,2,3] Example: placeat

Tabular List

Retrieves all the courses in a tabular list format with pagination mode. You can apply filter using search_param via courseName, courseCategoryIds and status.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/courses/tabularlist?page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C%22direction%22%3A%22desc%22%7D&search_param=%7B%22courseCategoryIds%22%3A+%5B1%2C2%5D%2C+%22courseName%22%3A+%22%22%2C+%22status%22%3A+%22DRAFT%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/courses/tabularlist"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at","direction":"desc"}",
    "search_param": "{"courseCategoryIds": [1,2], "courseName": "", "status": "DRAFT"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "name": "Test Course",
            "slug": "test-course",
            "status": "DRAFT",
            "display_status": "Draft",
            "categories": "Category 1, Category 2",
            "author": "John Doe",
            "created_at": "Aug 26, 2020 12:00 AM",
            "certificate_template_id": 1,
            "accredible_group_id": []
        }
    ]
}
 

Request   

GET api/courses/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 10

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at","direction":"desc"}

search_param   string  optional  

for searching items based on field names. Example: {"courseCategoryIds": [1,2], "courseName": "", "status": "DRAFT"}

Dropdown List

Retrieves all the courses in a dropdown format in paginated mode. You can apply filter using portal_id via query param.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/courses/dropdownlist?portalId=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/courses/dropdownlist"
);

const params = {
    "portalId": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Course 1"
    },
    {
        "id": 2,
        "name": "Course 2"
    }
]
 

Request   

GET api/courses/dropdownlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer  optional  

The portal ID used for additional filtering. Example: 5

Enrolled Learners

Retrieves all enrolled students for a course.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course/enrolled-students?course_id=1&portalId=5&page_size=10&page_number=1&order_by=registered_on&search_param=%7B%22status%22%3A%5B%22Not+Started%22%2C%22In+Progress%22%5D%2C%22nameOrEmail%22%3A%22John+Doe%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course/enrolled-students"
);

const params = {
    "course_id": "1",
    "portalId": "5",
    "page_size": "10",
    "page_number": "1",
    "order_by": "registered_on",
    "search_param": "{"status":["Not Started","In Progress"],"nameOrEmail":"John Doe"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "courseName": "course 1",
    "featuredImage": "http://localhost:8000/storage/courses/1/featured_image.jpg",
    "recordsTotal": 12,
    "totalNotStarted": 3,
    "totalInProgress": 4,
    "totalCompleted": 5,
    "recordsFiltered": 12,
    "records": [
        {
            "id": 1,
            "user_id": 2,
            "first_name": "John",
            "last_name": "Doe",
            "email": "[email protected]",
            "avatar": "http://localhost:8000/storage/users/2/avatar.jpg",
            "status": "Not Started",
            "display_status": "Not Started",
            "percentComplete": 0,
            "access_status": "Allowed",
            "registered_on": "Aug 09, 2020",
            "started_on": "",
            "completed_on": "",
            "expire_on": "Never",
            "last_accessed_on": "Never",
            "certificate_count": 0,
            "user_type": "Learner",
            "raw_user_type": "learner"
        }
    ]
}
 

Request   

GET api/course/enrolled-students

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

course_id   string   

The ID of course. Example: 1

portalId   string   

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

page_size   string   

Number of the results you want in each page. Example: 10

page_number   string   

Current Page number. Example: 1

order_by   string  optional  

Returns details in some order. Example: registered_on

search_param   string  optional  

Search parameters related to course. Example: {"status":["Not Started","In Progress"],"nameOrEmail":"John Doe"}

Retrieve the list of webinars for a given course

This API retrieves the list of webinars for a given course ID. The response includes the webinar name, start date, end date, duration, location, instructor, and other relevant information.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course/webinars?search_param=%7B%22dates%22%3A+%5B%222020-07-01%22%2C+%222020-07-31%22%5D%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course/webinars"
);

const params = {
    "search_param": "{"dates": ["2020-07-01", "2020-07-31"]}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Webinar 1",
        "startDate": "2020-07-01",
        "endDate": "2020-07-01",
        "duration": "1 hour",
        "location": "New York",
        "instructor": "John Doe"
    },
    {
        "id": 2,
        "name": "Webinar 2",
        "startDate": "2020-07-01",
        "endDate": "2020-07-01",
        "duration": "1 hour",
        "location": "New York",
        "instructor": "Jane Doe"
    }
]
 

Request   

GET api/course/webinars

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

course_id   string   

The ID of the course to retrieve webinars for. Example: 1

Query Parameters

search_param   string  optional  

JSON object containing search parameters. Example: {"dates": ["2020-07-01", "2020-07-31"]}

Retrieve the list of learning resources for a given course

This API retrieves the list of learning resources for a given course ID. The response includes the learning resource name, type, file name, file type, status, s3_url, mux_url, mux_id, bunny_video_id, bunny_video_url, mime_type, created at.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course/learning-resources?search_param=%7B%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course/learning-resources"
);

const params = {
    "search_param": "{}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Learning Resource 1",
        "type": "video",
        "file_name": "LR1.mp4",
        "file_type": "mp4",
        "status": "active",
        "s3_url": "https://example.com/LR1.mp4",
        "mux_url": "https://example.com/LR1.mux",
        "mux_id": "mux-id-1",
        "bunny_video_id": "bunny-video-id-1",
        "bunny_video_url": "https://example.com/LR1.bunny",
        "mime_type": "video/mp4",
        "created_at": "2020-07-01 10:00:00"
    },
    {
        "id": 2,
        "name": "Learning Resource 2",
        "type": "document",
        "file_name": "LR2.pdf",
        "file_type": "pdf",
        "status": "active",
        "s3_url": "https://example.com/LR2.pdf",
        "mux_url": "https://example.com/LR2.mux",
        "mux_id": "mux-id-2",
        "bunny_video_id": "bunny-video-id-2",
        "bunny_video_url": "https://example.com/LR2.bunny",
        "mime_type": "application/pdf",
        "created_at": "2020-07-01 10:00:00"
    }
]
 

Request   

GET api/course/learning-resources

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

course_id   string   

The ID of the course to retrieve learning resources for. Example: 1

Query Parameters

search_param   string  optional  

JSON object containing search parameters. Example: {}

Retrieves all the submissions for all the courses a user is enrolled in, for a given portal

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course/submissions?page_size=10&page_number=1&order_by[column]=name&order_by[direction]=asc&search_param[name]=John+Doe&search_param[type]=assignment&search_param[status]=Submitted&portalId=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course/submissions"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by[column]": "name",
    "order_by[direction]": "asc",
    "search_param[name]": "John Doe",
    "search_param[type]": "assignment",
    "search_param[status]": "Submitted",
    "portalId": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "courseName": "course name",
    "featuredImage": "http://localhost:8000/storage/courses/1/featured_image.jpg",
    "totalPending": 5,
    "recordsTotal": 12,
    "recordsFiltered": 12,
    "records": [
        {
            "status_row_id": 1,
            "module_id": 1,
            "module_name": "Assignment 1",
            "module_type": "assignment",
            "module_status": "Submitted",
            "first_name": "John",
            "last_name": "Doe",
            "email": "[email protected]",
            "avatar": "https://example.com/avatar.jpg",
            "submission_id": 1,
            "submitted_on": "2020-01-01"
        },
        {
            "status_row_id": 2,
            "module_id": 2,
            "module_name": "Discussion 1",
            "module_type": "discussion",
            "module_status": "Submitted",
            "first_name": "Jane",
            "last_name": "Doe",
            "email": "[email protected]",
            "avatar": "https://example.com/avatar.jpg",
            "submission_id": 2,
            "submitted_on": "2020-01-01"
        }
    ]
}
 

Request   

GET api/course/submissions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   integer   

Number of results per page. Example: 10

page_number   integer   

The current page number. Example: 1

order_by   object  optional  

JSON object specifying the column and direction to sort by.

search_param   object  optional  

JSON object containing search criteria.

portalId   integer   

ID of the portal to filter results. Example: 5

Retrieves all the submissions for all the courses a user is enrolled in, for a given portal

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course/all-submissions?page_size=10&page_number=1&order_by[column]=name&order_by[direction]=asc&search_param[name]=Course+Name&portalId=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course/all-submissions"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by[column]": "name",
    "order_by[direction]": "asc",
    "search_param[name]": "Course Name",
    "portalId": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "totalPending": 5,
    "records": [
        {
            "course_name": "Course 1",
            "status_row_id": 1,
            "module_id": 1,
            "module_name": "Assignment 1",
            "module_type": "assignment",
            "module_status": "Submitted",
            "first_name": "John",
            "last_name": "Doe",
            "email": "[email protected]",
            "avatar": "https://example.com/avatar.jpg",
            "submission_id": 1,
            "submitted_on": "2020-01-01"
        },
        {
            "course_name": "Course 2",
            "status_row_id": 2,
            "module_id": 2,
            "module_name": "Discussion 1",
            "module_type": "discussion",
            "module_status": "Submitted",
            "first_name": "Jane",
            "last_name": "Doe",
            "email": "[email protected]",
            "avatar": "https://example.com/avatar.jpg",
            "submission_id": 2,
            "submitted_on": "2020-01-01"
        }
    ]
}
 

Request   

GET api/course/all-submissions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   integer   

Number of results per page. Example: 10

page_number   integer   

The current page number. Example: 1

order_by   object  optional  

JSON object specifying the column and direction to sort by.

search_param   object  optional  

JSON object containing search criteria.

portalId   integer   

ID of the portal to filter results. Example: 5

API to fetch LMS Overview Report

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course/reports/overview" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"searchPortalIds\": [
        \"est\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/reports/overview"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "searchPortalIds": [
        "est"
    ]
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "labels": [],
    "totalNotStarted": [],
    "totalInProgress": [],
    "totalCompleted": [],
    "percentageCompleted": [],
    "sumNotStarted": 0,
    "sumInProgress": 0,
    "sumCompleted": 0,
    "sumPercentageCompleted": 0
}
 

Request   

GET api/course/reports/overview

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

searchPortalIds   string[]   

Portal Ids

API to get Course Detail Report

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course/reports/course-detailed" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"course_ids\": [
        \"qui\"
    ],
    \"page_size\": 12,
    \"page_number\": 12,
    \"order_by\": [],
    \"search_param\": [],
    \"userCategoryId\": 18,
    \"registered_between\": [
        \"mollitia\"
    ],
    \"searchPortalIds\": [
        \"sapiente\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/reports/course-detailed"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "course_ids": [
        "qui"
    ],
    "page_size": 12,
    "page_number": 12,
    "order_by": [],
    "search_param": [],
    "userCategoryId": 18,
    "registered_between": [
        "mollitia"
    ],
    "searchPortalIds": [
        "sapiente"
    ]
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 0,
    "totalNotStarted": 0,
    "totalInProgress": 0,
    "totalCompleted": 0,
    "recordsFiltered": 0,
    "records": [
        {
            "user_id": 0,
            "course_id": 0,
            "first_name": "",
            "last_name": "",
            "email": "",
            "course_name": "",
            "portal_name": "",
            "status": "",
            "display_status": "",
            "percent_complete": 0,
            "access_status": "",
            "registered_on": "",
            "started_on": "",
            "completed_on": "",
            "expire_on": "",
            "last_accessed_on": "",
            "percent_achieved": 0,
            "total_time_spent": "",
            "certifcate_issued": "",
            "certifcate_count": "",
            "certifcate_issued_date": "",
            "certificate_expire": ""
        }
    ]
}
 

Request   

GET api/course/reports/course-detailed

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

course_ids   string[]   

The course ids to filter the report

page_size   integer   

The number of records per page Example: 12

page_number   integer   

The page number to request Example: 12

order_by   object   

The column name and direction to order the report by

search_param   object   

The search parameters to filter the report by

userCategoryId   integer   

The user category id to filter the report by Example: 18

registered_between   string[]   

The date range to filter the report by

searchPortalIds   string[]   

The portal ids to filter the report by

Get the list of custom user metas that needs to be printed on the Course Insight Export report

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course/reports/course-detailed-custom-headers" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course/reports/course-detailed-custom-headers"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    "user_meta_key_1" => "Label 1",
    "user_meta_key_2" => "Label 2"
]
 

Request   

GET api/course/reports/course-detailed-custom-headers

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieve Course Details

Fetches detailed information for a specific course, including metadata, modules, categories, learning paths, and associated resources.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Course Name",
    "slug": "course-name",
    "featuredImageUrl": "https://example.com/image.jpg",
    "instructions": "Course instructions",
    "credits": 3,
    "estimatedCompletion": 10,
    "estimationCompletedUnit": "hours",
    "minPassingPercentage": 70,
    "gradingRule": "average",
    "durationRule": "fixed",
    "durationSpecificDate": "2025-06-01",
    "durationDays": 30,
    "selectedBadgeId": 1,
    "isBadgeSelected": "badge",
    "points": 100,
    "status": "published",
    "certificateTemplates": [
        1,
        2
    ],
    "associatedProduct": [],
    "shopifyProducts": [
        101,
        102
    ],
    "completionRedirectionUrl": "https://example.com/completion",
    "certificateExpiresAfter": 365,
    "certificateExpiresAfterGracePeriod": 30,
    "accredibleGroupId": [
        5,
        6
    ],
    "enableCourseRating": true,
    "completionCriteria": "all_modules",
    "hasAssociatedProduct": false,
    "modules": [
        {
            "module_id": 1,
            "display_order": 1,
            "name": "Module Name",
            "type": "text",
            "icon": "<i class=\"el-icon-tickets\"></i>",
            "is_locked": false,
            "drip_rules": "immediately",
            "drip_fixed_date": null,
            "drip_interval": null,
            "drip_interval_unit": "day",
            "drip_calculation_reference": "registration_date",
            "selectedModuleBadgeId": 1,
            "modulePoints": 10,
            "isModuleBadgeSelected": "badge",
            "minSpentHour": 0,
            "minSpentMinutes": 0
        }
    ],
    "categories": [
        1,
        2
    ],
    "gradeModules": [
        1,
        2
    ],
    "selectedModules": [
        1,
        -999
    ],
    "learningPaths": [
        {
            "learning_path_id": 1,
            "learning_path_name": "Learning Path Name"
        }
    ],
    "learningResources": [],
    "webinarList": [],
    "selectedWebinars": [
        -999
    ]
}
 

Request   

GET api/course/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the course to retrieve. Example: 1

Save Course

Creates or updates a course with associated modules, categories, certificates, webinars, and settings. This endpoint handles both draft and publish modes. It validates different fields based on the mode. In draft mode, only the course name is required. In publish mode, full validation is enforced including modules, certificates, completion criteria, badges, and grading settings.

It also links categories (creating new ones if needed), associates selected certificate templates, handles Shopify product mappings, and processes webinar integrations.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/course" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"\\\"Professional Development and Training\\\"\",
    \"status\": \"\\\"published\\\"\",
    \"featuredImageUrl\": \"\\\"https:\\/\\/example.com\\/image.jpg\\\"\",
    \"instructions\": \"\\\"Complete all modules.\\\"\",
    \"credits\": 3,
    \"estimatedCompletion\": 10,
    \"estimationCompletedUnit\": \"\\\"hours\\\"\",
    \"minPassingPercentage\": \"70\",
    \"gradingRule\": [
        {
            \"type\": \"average\",
            \"weight\": 50
        }
    ],
    \"durationRule\": \"\\\"fixed\\\"\",
    \"durationSpecificDate\": \"\\\"2025-06-01\\\"\",
    \"durationDays\": 30,
    \"points\": 100,
    \"certificateTemplates\": 2,
    \"certificateExpiresAfter\": 365,
    \"certificateExpiresAfterGracePeriod\": 30,
    \"completionRedirectionUrl\": \"\\\"https:\\/\\/example.com\\/congrats\\\"\",
    \"enableCourseRating\": true,
    \"completionCriteria\": \"\\\"all_modules\\\"\",
    \"selectedModules\": [
        1,
        3,
        5
    ],
    \"selectedWebinars\": [
        10,
        11
    ],
    \"shopifyProducts\": [
        101,
        102
    ],
    \"learningResources\": [
        201,
        202
    ],
    \"accredibleGroupId\": 55,
    \"isBadgeSelected\": \"\\\"badge\\\"\",
    \"selectedBadgeId\": 7,
    \"modules\": [
        \"consequatur\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/course"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "\"Professional Development and Training\"",
    "status": "\"published\"",
    "featuredImageUrl": "\"https:\/\/example.com\/image.jpg\"",
    "instructions": "\"Complete all modules.\"",
    "credits": 3,
    "estimatedCompletion": 10,
    "estimationCompletedUnit": "\"hours\"",
    "minPassingPercentage": "70",
    "gradingRule": [
        {
            "type": "average",
            "weight": 50
        }
    ],
    "durationRule": "\"fixed\"",
    "durationSpecificDate": "\"2025-06-01\"",
    "durationDays": 30,
    "points": 100,
    "certificateTemplates": 2,
    "certificateExpiresAfter": 365,
    "certificateExpiresAfterGracePeriod": 30,
    "completionRedirectionUrl": "\"https:\/\/example.com\/congrats\"",
    "enableCourseRating": true,
    "completionCriteria": "\"all_modules\"",
    "selectedModules": [
        1,
        3,
        5
    ],
    "selectedWebinars": [
        10,
        11
    ],
    "shopifyProducts": [
        101,
        102
    ],
    "learningResources": [
        201,
        202
    ],
    "accredibleGroupId": 55,
    "isBadgeSelected": "\"badge\"",
    "selectedBadgeId": 7,
    "modules": [
        "consequatur"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Request   

POST api/course

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the course to be updated. Example: 1

Body Parameters

name   string  optional  

The course title. Example: "Professional Development and Training"

status   string  optional  

The course status (e.g., draft, published). Example: "published"

featuredImageUrl   string  optional  

URL of the course's featured image. Example: "https://example.com/image.jpg"

instructions   string  optional  

Additional instructions for the course. Example: "Complete all modules."

credits   integer  optional  

Number of credits assigned to the course. Example: 3

estimatedCompletion   integer  optional  

Estimated time to complete the course. Example: 10

estimationCompletedUnit   string  optional  

Unit for estimated completion (e.g., hours, days). Example: "hours"

minPassingPercentage   numeric  optional  

Minimum passing score percentage. Example: 70

gradingRule   string[]  optional  

Rules for course grading.

durationRule   string  optional  

Type of duration rule. Example: "fixed"

durationSpecificDate   date  optional  

The specific date when course access ends (if applicable). Example: "2025-06-01"

durationDays   integer  optional  

Number of days the course is accessible. Example: 30

points   integer  optional  

Points rewarded upon completion. Example: 100

certificateTemplates   integer  optional  

ID of the certificate template. Example: 2

certificateExpiresAfter   integer  optional  

Certificate validity period in days. Example: 365

certificateExpiresAfterGracePeriod   integer  optional  

Grace period after expiry in days. Example: 30

completionRedirectionUrl   string  optional  

URL to redirect upon course completion. Example: "https://example.com/congrats"

enableCourseRating   boolean  optional  

Whether course rating is enabled. Example: true

completionCriteria   string  optional  

Criteria for course completion. Example: "all_modules"

selectedModules   string[]  optional  

Selected module IDs.

selectedWebinars   string[]  optional  

Selected webinar IDs.

shopifyProducts   string[]  optional  

Shopify product IDs linked to the course.

learningResources   string[]  optional  

Associated learning resource IDs.

accredibleGroupId   integer  optional  

Accredible group ID for certification. Example: 55

isBadgeSelected   string  optional  

Indicates if badge is selected. Should be 'badge' to use selectedBadgeId. Example: "badge"

selectedBadgeId   integer  optional  

ID of the badge to be assigned if isBadgeSelected is 'badge'. Example: 7

modules   string[]  optional  

The list of modules added to the course with section and drip settings. Each module object can contain the following:

  • module_id: integer ID of the module. Example: 1
  • name: string Name of the module. Example: "Introduction Text Module"
  • type: string Type of the module. Example: "text"
  • section_name: string Name of the section the module belongs to. Example: "Section 1"
  • is_locked: boolean Whether the module is locked. Example: false
  • modulePoints: integer Points assigned to the module. Example: 10
  • icon: string Icon HTML used for UI. Example: "<i class=\"el-icon-tickets\">"
  • selectedModuleBadgeId: integer Badge ID assigned to the module. Example: 4
  • drip_rules: string Rule for content drip. Example: "immediately"
  • drip_interval: integer Interval before the module is unlocked. Example: 2
  • drip_interval_unit: string Unit of the interval (day/week/month). Example: "day"
  • drip_fixed_date: date Fixed date to unlock the module (if applicable). Example: "2025-01-01"
  • drip_calculation_reference: string Base date for drip logic (e.g., registration_date).

Update Course Details

Use this endpoint to update a course's settings, including curriculum, certification, grading, duration, and other metadata.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/course/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"\\\"Professional Development and Training\\\"\",
    \"status\": \"\\\"published\\\"\",
    \"featuredImageUrl\": \"\\\"https:\\/\\/example.com\\/image.jpg\\\"\",
    \"instructions\": \"\\\"Complete all modules.\\\"\",
    \"credits\": 3,
    \"estimatedCompletion\": 10,
    \"estimationCompletedUnit\": \"\\\"hours\\\"\",
    \"minPassingPercentage\": \"70\",
    \"gradingRule\": [
        {
            \"type\": \"average\",
            \"weight\": 50
        }
    ],
    \"durationRule\": \"\\\"fixed\\\"\",
    \"durationSpecificDate\": \"\\\"2025-06-01\\\"\",
    \"durationDays\": 30,
    \"points\": 100,
    \"certificateTemplates\": 2,
    \"certificateExpiresAfter\": 365,
    \"certificateExpiresAfterGracePeriod\": 30,
    \"completionRedirectionUrl\": \"\\\"https:\\/\\/example.com\\/congrats\\\"\",
    \"enableCourseRating\": true,
    \"completionCriteria\": \"\\\"all_modules\\\"\",
    \"selectedModules\": [
        1,
        3,
        5
    ],
    \"selectedWebinars\": [
        10,
        11
    ],
    \"shopifyProducts\": [
        101,
        102
    ],
    \"learningResources\": [
        201,
        202
    ],
    \"accredibleGroupId\": 55,
    \"isBadgeSelected\": \"\\\"badge\\\"\",
    \"selectedBadgeId\": 7,
    \"modules\": \"registration_date\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "\"Professional Development and Training\"",
    "status": "\"published\"",
    "featuredImageUrl": "\"https:\/\/example.com\/image.jpg\"",
    "instructions": "\"Complete all modules.\"",
    "credits": 3,
    "estimatedCompletion": 10,
    "estimationCompletedUnit": "\"hours\"",
    "minPassingPercentage": "70",
    "gradingRule": [
        {
            "type": "average",
            "weight": 50
        }
    ],
    "durationRule": "\"fixed\"",
    "durationSpecificDate": "\"2025-06-01\"",
    "durationDays": 30,
    "points": 100,
    "certificateTemplates": 2,
    "certificateExpiresAfter": 365,
    "certificateExpiresAfterGracePeriod": 30,
    "completionRedirectionUrl": "\"https:\/\/example.com\/congrats\"",
    "enableCourseRating": true,
    "completionCriteria": "\"all_modules\"",
    "selectedModules": [
        1,
        3,
        5
    ],
    "selectedWebinars": [
        10,
        11
    ],
    "shopifyProducts": [
        101,
        102
    ],
    "learningResources": [
        201,
        202
    ],
    "accredibleGroupId": 55,
    "isBadgeSelected": "\"badge\"",
    "selectedBadgeId": 7,
    "modules": "registration_date"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Course updated successfully"
}
 

Request   

PUT api/course/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the course to be updated. Example: 1

Body Parameters

name   string  optional  

The course title. Example: "Professional Development and Training"

status   string  optional  

The course status (e.g., draft, published). Example: "published"

featuredImageUrl   string  optional  

URL of the course's featured image. Example: "https://example.com/image.jpg"

instructions   string  optional  

Additional instructions for the course. Example: "Complete all modules."

credits   integer  optional  

Number of credits assigned to the course. Example: 3

estimatedCompletion   integer  optional  

Estimated time to complete the course. Example: 10

estimationCompletedUnit   string  optional  

Unit for estimated completion (e.g., hours, days). Example: "hours"

minPassingPercentage   numeric  optional  

Minimum passing score percentage. Example: 70

gradingRule   string[]  optional  

Rules for course grading.

durationRule   string  optional  

Type of duration rule. Example: "fixed"

durationSpecificDate   date  optional  

The specific date when course access ends (if applicable). Example: "2025-06-01"

durationDays   integer  optional  

Number of days the course is accessible. Example: 30

points   integer  optional  

Points rewarded upon completion. Example: 100

certificateTemplates   integer  optional  

ID of the certificate template. Example: 2

certificateExpiresAfter   integer  optional  

Certificate validity period in days. Example: 365

certificateExpiresAfterGracePeriod   integer  optional  

Grace period after expiry in days. Example: 30

completionRedirectionUrl   string  optional  

URL to redirect upon course completion. Example: "https://example.com/congrats"

enableCourseRating   boolean  optional  

Whether course rating is enabled. Example: true

completionCriteria   string  optional  

Criteria for course completion. Example: "all_modules"

selectedModules   string[]  optional  

Selected module IDs.

selectedWebinars   string[]  optional  

Selected webinar IDs.

shopifyProducts   string[]  optional  

Shopify product IDs linked to the course.

learningResources   string[]  optional  

Associated learning resource IDs.

accredibleGroupId   integer  optional  

Accredible group ID for certification. Example: 55

isBadgeSelected   string  optional  

Indicates if badge is selected. Should be 'badge' to use selectedBadgeId. Example: "badge"

selectedBadgeId   integer  optional  

ID of the badge to be assigned if isBadgeSelected is 'badge'. Example: 7

modules   string[]  optional  

The list of modules added to the course with section and drip settings. Each module object can contain the following:

  • module_id: integer ID of the module. Example: 1
  • name: string Name of the module. Example: "Introduction Text Module"
  • type: string Type of the module. Example: "text"
  • section_name: string Name of the section the module belongs to. Example: "Section 1"
  • is_locked: boolean Whether the module is locked. Example: false
  • modulePoints: integer Points assigned to the module. Example: 10
  • icon: string Icon HTML used for UI. Example: "<i class=\"el-icon-tickets\">"
  • selectedModuleBadgeId: integer Badge ID assigned to the module. Example: 4
  • drip_rules: string Rule for content drip. Example: "immediately"
  • drip_interval: integer Interval before the module is unlocked. Example: 2
  • drip_interval_unit: string Unit of the interval (day/week/month). Example: "day"
  • drip_fixed_date: date Fixed date to unlock the module (if applicable). Example: "2025-01-01"
  • drip_calculation_reference: string Base date for drip logic (e.g., registration_date). Example: registration_date

Course Lookup

Retrieves the courses matching the search term provided in the request. If the portalId is provided, it will fetch courses which are attached to the portal. If the type is report, it will fetch all the courses attached to the membership and the courses attached to the learning path attached to the portal as well.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/course/lookup?search_term=course+1&portalId=5&type=report" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course/lookup"
);

const params = {
    "search_term": "course 1",
    "portalId": "5",
    "type": "report",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "value": 1,
        "label": "course 1"
    },
    {
        "value": 2,
        "label": "course 2"
    }
]
 

Request   

POST api/course/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

search_term   string   

The search term to search for courses. Example: course 1

portalId   string   

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

type   string  optional  

optional The type of the call. Example: report

Deletes courses

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/course/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_ids\": [
        1,
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_ids": [
        1,
        2,
        3
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "3 course(s) deleted, 2 course(s) not deleted as it has enrollments. Please remove the students from the course and try again.",
    "deletedCourses": [
        1,
        2
    ],
    "notDeletedCourses": [
        3,
        4
    ],
    "enrolledCourses": [
        {
            "id": 3,
            "name": "Course 3"
        },
        {
            "id": 4,
            "name": "Course 4"
        }
    ],
    "notDeletedProductCourses": [
        1,
        3
    ],
    "productCourses": {
        "Course 1": [
            {
                "id": 1,
                "title": "Product 1"
            }
        ],
        "Course 3": [
            {
                "id": 2,
                "title": "Product 2"
            }
        ]
    },
    "notDeletedAutoEnrolledCourses": [
        2
    ],
    "autoEnrolledCourses": [
        {
            "courseId": 2,
            "courseName": "Course 2"
        }
    ],
    "notDeletedLearningPathCourses": [
        4
    ],
    "learningPathCourses": {
        "Course 4": [
            {
                "id": 1,
                "title": "Learning Path 1"
            }
        ]
    },
    "notDeletedPortalCourses": [
        1
    ],
    "portalCourses": {
        "Course 1": [
            {
                "id": 1,
                "name": "Portal 1"
            }
        ]
    }
}
 

Request   

POST api/course/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string[]   

The course IDs to delete.

Quick Edit

Updates the details of specified courses in bulk. The parameters to be updated are provided in the request.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/course/quickEdit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"course_ids\": [
        1,
        2
    ],
    \"author_id\": 1,
    \"categories_id\": [
        3,
        4
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/quickEdit"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "course_ids": [
        1,
        2
    ],
    "author_id": 1,
    "categories_id": [
        3,
        4
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Courses updated Successfully"
}
 

Request   

POST api/course/quickEdit

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

course_ids   string[]   

IDs of the courses to be updated.

author_id   integer  optional  

ID of the new instructor/author for the specified courses. Example: 1

categories_id   string[]  optional  

IDs of the categories to update the specified courses with.

Drip Option Lookup

Retrieves all the options for the drip feature that the platform offers like Immediately, On a Fixed Date, At Fixed Intervals. Helps showing options in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/courses/drip/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/courses/drip/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "options": [
            {
                "db_value": "immediately",
                "display_value": "Immediately"
            },
            {
                "db_value": "fixed_date",
                "display_value": "On a Fixed Date"
            },
            {
                "db_value": "specific_interval",
                "display_value": "At Fixed Intervals"
            }
        ],
        "intervals": [
            {
                "db_value": "day",
                "display_value": "Day(s)"
            },
            {
                "db_value": "week",
                "display_value": "Week(s)"
            },
            {
                "db_value": "month",
                "display_value": "Month(s)"
            }
        ],
        "calculation_ref": [
            {
                "db_value": "registration_date",
                "display_value": "Enrollment Date"
            },
            {
                "db_value": "started_date",
                "display_value": "Course Start Date"
            }
        ]
    }
]
 

Request   

GET api/courses/drip/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Course Status Lookup

Retrieves all the statuses for a course the platform offers like Not Started, In Progress, Completed. Helps showing options in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/courses/status/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/courses/status/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "Not Started",
        "display_value": "Not Started"
    },
    {
        "db_value": "In Progress",
        "display_value": "In Progress"
    },
    {
        "db_value": "Completed",
        "display_value": "Completed"
    }
]
 

Request   

GET api/courses/status/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Grading Rules Lookup

Retrieves all the grading rules available for course creation. Helps showing options in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/courses/grading-rules/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/courses/grading-rules/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "no_grading",
        "display_value": "No Grading"
    },
    {
        "db_value": "avg_all_modules",
        "display_value": "Average of all Quiz/Assignment/Discussions/Scorm"
    },
    {
        "db_value": "avg_specific_modules",
        "display_value": "Average of specific Quiz/Assignment/Discussions/Scorm"
    }
]
 

Request   

GET api/courses/grading-rules/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Duration Rules Lookup

Retrieves all the duration rules for the courses. Helps showing options in dropdowns elements

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/courses/duration-rules/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/courses/duration-rules/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "unlimited",
        "display_value": "Unlimited"
    },
    {
        "db_value": "on_specific_date",
        "display_value": "Till Specific Date"
    },
    {
        "db_value": "x_days_after_start",
        "display_value": "Till X day(s) after a student starts the course"
    },
    {
        "db_value": "x_days_after_enrollment",
        "display_value": "Till X day(s) after a student registers in the course"
    }
]
 

Request   

GET api/courses/duration-rules/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieve Course Activities

Retrieves paginated activities for a specified course based on various parameters.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course-activities?course_id=1&page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A%22asc%22%7D&search_param=%7B%22nameOrEmail%22%3A%22John+Doe%22%7D&context=%22overview%22&portalId=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course-activities"
);

const params = {
    "course_id": "1",
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction":"asc"}",
    "search_param": "{"nameOrEmail":"John Doe"}",
    "context": ""overview"",
    "portalId": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "courseName": "course 1",
    "featuredImage": null,
    "recordsTotal": 40,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 10,
            "verb": "ACCESSED",
            "created_at": "Aug 03, 2020 10:07 AM",
            "message": "Demo Student has accessed course 1",
            "student": "Demo Student"
        },
        {
            "id": 9,
            "verb": "ACHIEVED CERTIFICATE",
            "created_at": "Aug 03, 2020 10:02 AM",
            "message": "Demo Student has achieved certificate for course 1",
            "student": "Demo Student"
        },
        {
            "id": 8,
            "verb": "COMPLETED",
            "created_at": "Aug 03, 2020 10:02 AM",
            "message": "course 1 was completed",
            "student": "Demo Student"
        },
        {
            "id": 7,
            "verb": "COMPLETED",
            "created_at": "Aug 03, 2020 10:02 AM",
            "message": "course 1 was completed",
            "student": "Demo Student"
        },
        {
            "id": 6,
            "verb": "ACHIEVED CERTIFICATE",
            "created_at": "Aug 03, 2020 10:02 AM",
            "message": "Demo Student has achieved certificate for course 1",
            "student": "Demo Student"
        },
        {
            "id": 5,
            "verb": "COMPLETED",
            "created_at": "Aug 03, 2020 10:02 AM",
            "message": "course 1 was completed",
            "student": "Demo Student"
        },
        {
            "id": 4,
            "verb": "COMPLETED",
            "created_at": "Aug 03, 2020 10:02 AM",
            "message": "course 1 was completed",
            "student": "Demo Student"
        },
        {
            "id": 3,
            "verb": "STARTED",
            "created_at": "Aug 03, 2020 10:02 AM",
            "message": "Demo Student has started test",
            "student": "Demo Student"
        },
        {
            "id": 2,
            "verb": "STARTED",
            "created_at": "Aug 03, 2020 10:01 AM",
            "message": "Demo Student has started course 1",
            "student": "Demo Student"
        },
        {
            "id": 1,
            "verb": "ENROLLED",
            "created_at": "Aug 03, 2020 10:00 AM",
            "message": "Demo Student is enrolled to course 1",
            "student": "Demo Student"
        }
    ]
}
 

Request   

GET api/course-activities

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

course_id   string   

The ID of the course. Example: 1

page_size   string   

The number of activities you want in each page. Example: 10

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

JSON object to order the activities. Example: {"colName":"created_at", "direction":"asc"}

search_param   string  optional  

JSON object for searching activities by specific criteria. Example: {"nameOrEmail":"John Doe"}

context   string  optional  

Context in which activities are retrieved. Example: "overview"

portalId   string  optional  

The portal ID to filter activities by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Retrieves the course details for given course ID and user ID

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course-progress/edit/1?userId=3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course-progress/edit/1"
);

const params = {
    "userId": "3",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "course 1",
    "course_id": 1,
    "userId": 3,
    "userName": "John Doe",
    "email": "[email protected]",
    "featuredImageUrl": null,
    "status": "Not Started",
    "completionPercentage": 0,
    "enrollmentDate": "2020-08-03T10:00:00.000000Z",
    "expiryDate": "2020-08-04T10:00:00.000000Z",
    "completionDate": null,
    "startDate": null,
    "lastAccessed": null,
    "modules": [
        {
            "module_id": 1,
            "name": "test",
            "slug": "test",
            "type": "text",
            "icon": "<i class=\"el-icon-tickets\"></i>",
            "status_row_id": -1,
            "status": "Not Started",
            "started_on": null,
            "completed_on": null,
            "last_accessed_on": null,
            "total_time_spent": null,
            "completion_percentage": 0,
            "no_of_times_accessed": 0,
            "totalMarks": null,
            "obtainedMarks": null
        },
        {
            "module_id": 4,
            "name": "assign",
            "slug": "assign",
            "type": "assignment",
            "icon": "<i class=\"el-icon-edit-outline\"></i>",
            "status_row_id": -1,
            "status": "Not Started",
            "started_on": null,
            "completed_on": null,
            "last_accessed_on": null,
            "total_time_spent": null,
            "completion_percentage": 0,
            "no_of_times_accessed": 0,
            "totalMarks": 50,
            "obtainedMarks": null
        }
    ],
    "hasSection": false
}
 

Request   

GET api/course-progress/edit/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

Course registration ID for the student of the course you want to see progress. Example: 1

Query Parameters

userId   string   

ID of the user. Example: 3

Update Course Progress

Updates the course progress for given course.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/course-progress/update/6?userId=3&enrollmentDate=2020-01-01+00%3A00%3A00&expiryDate=2020-01-01+00%3A00%3A00&startDate=2020-01-01+00%3A00%3A00&completionDate=2020-01-01+00%3A00%3A00&lastAccessed=2020-01-01+00%3A00%3A00&status=Completed&modules=%5B%7B%22module_id%22%3A+16%2C+%22status%22%3A+%22Not+Started%22%7D%5D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course-progress/update/6"
);

const params = {
    "userId": "3",
    "enrollmentDate": "2020-01-01 00:00:00",
    "expiryDate": "2020-01-01 00:00:00",
    "startDate": "2020-01-01 00:00:00",
    "completionDate": "2020-01-01 00:00:00",
    "lastAccessed": "2020-01-01 00:00:00",
    "status": "Completed",
    "modules": "[{"module_id": 16, "status": "Not Started"}]",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Course updated Successfully"
}
 

Request   

PUT api/course-progress/update/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string  optional  

The The ID of the course. Example: 6

Query Parameters

userId   string  optional  

The ID of the user. Example: 3

enrollmentDate   string  optional  

The enrollment date for the course. Format Y-m-d H:i:s. Example: 2020-01-01 00:00:00

expiryDate   string  optional  

The expiry date for the course. Format Y-m-d H:i:s. Example: 2020-01-01 00:00:00

startDate   string  optional  

The start date for the course. Format Y-m-d H:i:s. Example: 2020-01-01 00:00:00

completionDate   string  optional  

The completion date for the course. Format Y-m-d H:i:s. Example: 2020-01-01 00:00:00

lastAccessed   string  optional  

The last accessed date for the course. Format Y-m-d H:i:s. Example: 2020-01-01 00:00:00

status   string  optional  

The status of the course. Example: Completed

modules   string  optional  

The modules status for the course. Example: [{"module_id": 16, "status": "Not Started"}]

Retrieves the name of the course for given course ID

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course/name/{id}?id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course/name/{id}"
);

const params = {
    "id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


string Course name
 

Request   

GET api/course/name/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

The ID of course. Example: 1

Enroll learners

To enroll users in a course, you need to use this request.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/course/enroll/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"studentIds\": [
        2,
        3
    ],
    \"portalId\": 5
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/enroll/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "studentIds": [
        2,
        3
    ],
    "portalId": 5
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "2 student(s) enrolled successfully",
    "enrolledUsersCount": 2,
    "notEnrolledUsers": 0
}
 

Request   

POST api/course/enroll/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the course. Example: 1

Body Parameters

studentIds   string[]   

User IDs needs to be enrolled in this course.

portalId   integer  optional  

optional The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Remove Learners

To remove users from a course, you need to use this request.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/course/remove/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"enrollmentIds\": [
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/remove/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "enrollmentIds": [
        2,
        3
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "2 student(s) removed successfully"
}
 

Request   

POST api/course/remove/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the course. Example: 1

Body Parameters

enrollmentIds   string[]   

Enrollment IDs needs to be removed from this course.

Reset Progress

To reset the progress of students for course, you need to use this request.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/course/reset/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"enrollmentIds\": [
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/reset/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "enrollmentIds": [
        2,
        3
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "2 student(s) progress is reset successfully"
}
 

Request   

POST api/course/reset/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the course. Example: 1

Body Parameters

enrollmentIds   string[]   

Enrollment IDs needs to be reset from this course.

Revoke Access

To revoke the access of course from students, you need to use this request.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/course/revoke/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"enrollmentIds\": [
        8,
        7
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/revoke/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "enrollmentIds": [
        8,
        7
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "2 learner(s) access has been revoked successfully"
}
 

Request   

PUT api/course/revoke/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the course. Example: 1

Body Parameters

enrollmentIds   string[]   

Course Registration/Enrollment IDs whose access needs to be revoked.

Grant Access

To grant the access of course to students, you need to use this request.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/course/grant/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"enrollmentIds\": [
        9,
        6
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/grant/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "enrollmentIds": [
        9,
        6
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "2 learner(s) access has been granted successfully"
}
 

Request   

PUT api/course/grant/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the course. Example: 1

Body Parameters

enrollmentIds   string[]   

Course Registration/Enrollment IDs needs access to be granted from this course.

Set Expiry

To update the expiry date for the learners of a course, you need to use this request.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/course/setExpiry/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"enrollmentIds\": [
        \"fugiat\"
    ],
    \"expiryDate\": \"porro\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/setExpiry/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "enrollmentIds": [
        "fugiat"
    ],
    "expiryDate": "porro"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Expiration date is successfully updated for 2 student(s)"
}
 

Request   

PUT api/course/setExpiry/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the course. Example: 1

Body Parameters

enrollmentIds   string[]   

Course Registration/Enrollment IDs needs setting expiry date for course.

expiryDate   required  optional  

Date on which the course is going to be expired. Example: porro

Assign Certificate

To assign certificate to the user for the course, you need to use this request.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/course/assignCertificate/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"enrollmentIds\": [
        \"qui\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/assignCertificate/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "enrollmentIds": [
        "qui"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Certificate is successfully assigned to 2 student(s)"
}
 

Request   

POST api/course/assignCertificate/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the course. Example: 1

Body Parameters

enrollmentIds   string[]   

Course Registration/Enrollment IDs needs certificate to be assigned for this course.

Course Activity Lookup

Retrieves all the activities performed in a course. Helps showing options in dropdowns elements

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/activities/verb/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/activities/verb/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "ENROLLED",
        "display_value": "ENROLLED"
    },
    {
        "db_value": "STARTED",
        "display_value": "STARTED"
    },
    {
        "db_value": "ACCESSED",
        "display_value": "ACCESSED"
    },
    {
        "db_value": "COMPLETED",
        "display_value": "COMPLETED"
    },
    {
        "db_value": "SUBMITTED",
        "display_value": "SUBMITTED"
    },
    {
        "db_value": "EVALUATED",
        "display_value": "EVALUATED"
    },
    {
        "db_value": "REJECTED",
        "display_value": "REJECTED"
    },
    {
        "db_value": "RETAKE",
        "display_value": "RETAKEN"
    },
    {
        "db_value": "ACHIEVED CERTIFICATE",
        "display_value": "ACHIEVED CERTIFICATE"
    },
    {
        "db_value": "RESET",
        "display_value": "RESET"
    },
    {
        "db_value": "REMOVED",
        "display_value": "REMOVED"
    },
    {
        "db_value": "REVOKED",
        "display_value": "REVOKED"
    },
    {
        "db_value": "GRANTED",
        "display_value": "GRANTED"
    },
    {
        "db_value": "UPDATED EXPIRY DATE",
        "display_value": "UPDATED EXPIRY DATE"
    },
    {
        "db_value": "FAILED",
        "display_value": "FAILED"
    },
    {
        "db_value": "MANUALLY UPDATED",
        "display_value": "MANUALLY UPDATED"
    },
    {
        "db_value": "REGISTERED",
        "display_value": "REGISTERED"
    },
    {
        "db_value": "ATTENDED",
        "display_value": "ATTENDED"
    },
    {
        "db_value": "NO SHOW",
        "display_value": "NO SHOW"
    },
    {
        "db_value": "CANCELLED",
        "display_value": "CANCELLED"
    },
    {
        "db_value": "ACHIEVED BADGE",
        "display_value": "ACHIEVED BADGE"
    }
]
 

Request   

GET api/activities/verb/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Gradebook Data

Retrieves all the progress achieved by a learner on the course. Details will be returned in paginated mode. You can use the userId parameter to get details for different Learners.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/progress/course/1?userId=3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/progress/course/1"
);

const params = {
    "userId": "3",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "course 1",
    "modules": [
        {
            "module_id": 1,
            "name": "test",
            "slug": "test",
            "type": "text",
            "icon": "<i class=\"el-icon-tickets\"></i>",
            "status_row_id": 1,
            "status": "Completed",
            "started_on": "2020-08-03T10:02:33.000000Z",
            "completed_on": "2020-08-03T10:02:41.000000Z",
            "last_accessed_on": "6 days ago",
            "total_time_spent": {
                "hours": 0,
                "minutes": 0,
                "seconds": 6,
                "totalSeconds": 6
            },
            "completion_percentage": 100,
            "no_of_times_accessed": 1,
            "totalMarks": null,
            "obtainedMarks": null
        },
        {
            "module_id": 4,
            "name": "assign",
            "slug": "assign",
            "type": "assignment",
            "icon": "<i class=\"el-icon-edit-outline\"></i>",
            "status_row_id": -1,
            "status": "Not Started",
            "started_on": "",
            "completed_on": "",
            "last_accessed_on": "Never",
            "total_time_spent": "",
            "points_awarded": "",
            "completion_percentage": 0,
            "no_of_times_accessed": 0,
            "totalMarks": 50,
            "obtainedMarks": null
        }
    ],
    "id": 1,
    "userId": 3,
    "permalink": "http://localhost:8000/course/course-1",
    "featuredImageUrl": null,
    "instructions": null,
    "accessStatus": "Allowed",
    "status": "Completed",
    "completionPercentage": 50,
    "timeSpent": {
        "hours": 0,
        "minutes": 0,
        "seconds": 6,
        "totalSeconds": 6
    },
    "enrollmentDate": "03 Aug 2020",
    "isExpired": false,
    "daysToExpire": "Unlimited days",
    "lastAccessed": "6 days ago",
    "isCertificateAvailable": true,
    "totalMarks": 50,
    "obtainedMarks": 0,
    "percentage": 0
}
 

Request   

GET api/progress/course/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

Course registration ID for the Learner of the course you want to see progress. Example: 1

Query Parameters

userId   string   

ID of the user. Example: 3

Enrolled User Lookup

Retrieves a list of users enrolled in a specified course, optionally filtered by portal ID and search term. The search term can match first name, last name, email, or full name.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/enrolled/course/{id}?search_term=%22John+Doe%22&id=1&portalId=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/enrolled/course/{id}"
);

const params = {
    "search_term": ""John Doe"",
    "id": "1",
    "portalId": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "full_name": "John Doe",
        "email": "[email protected]"
    }
]
 

Request   

GET api/enrolled/course/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

search_term   string   

The search term to search for users. Example: "John Doe"

id   integer   

The ID of the course to filter users by. Example: 1

portalId   integer  optional  

optional The ID of the portal to filter users by. Use -1 to skip portal filtering. Example: 5

Clone a course.

This function clones a course and its associated categories and modules. It allows for a deep copy, which clones all course content, including modules and their details. The cloned course will have a new name suffixed with "_copy" and the requesting user will be recorded as the creator and updater.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/course/clone" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"course_id\": 1,
    \"isDeepCopy\": true
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/clone"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "course_id": 1,
    "isDeepCopy": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Course Cloned Successfully"
}
 

Request   

POST api/course/clone

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

course_id   integer   

The ID of the course to clone. Example: 1

isDeepCopy   boolean   

If true, all content will be deeply copied. Example: true

Update the list of courses which are auto-enrolled for free to users after registration.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/courses/auto-enroll-courses/update" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"courses\": [
        1,
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/courses/auto-enroll-courses/update"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "courses": [
        1,
        2,
        3
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Course Updated Successfully",
    "type": "success",
    "title": "Success"
}
 

Request   

POST api/courses/auto-enroll-courses/update

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

courses   string[]   

The list of course IDs to auto enroll.

Get the list of courses which are auto-enrolled for free to users after registration.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/courses/auto-enroll-courses" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/courses/auto-enroll-courses"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "value": 1,
        "label": "Course 1"
    },
    {
        "value": 2,
        "label": "Course 2"
    },
    {
        "value": 3,
        "label": "Course 3"
    }
]
 

Request   

GET api/courses/auto-enroll-courses

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieve the list of students enrolled in a given webinar

This API retrieves the list of students enrolled in a given webinar ID and portal ID. The response includes the student name, email, avatar, status, registered on, last accessed on, attendance recording type, notes.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/webinar/enrolled-students?page_size=10&page_number=1&order_by=%7B%22colName%22%3A+%22name%22%2C+%22direction%22%3A+%22asc%22%7D&search_param=%7B%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/webinar/enrolled-students"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName": "name", "direction": "asc"}",
    "search_param": "{}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "user_id": 1,
        "first_name": "John",
        "last_name": "Doe",
        "email": "[email protected]",
        "avatar": "https://example.com/john.jpg",
        "status": "active",
        "registered_on": "2020-07-01 10:00:00",
        "last_accessed_on": "2020-07-01 11:00:00",
        "attendance_recording_type": "video",
        "notes": "Some notes"
    },
    {
        "id": 2,
        "user_id": 2,
        "first_name": "Jane",
        "last_name": "Smith",
        "email": "[email protected]",
        "avatar": "https://example.com/jane.jpg",
        "status": "inactive",
        "registered_on": "2020-07-01 10:00:00",
        "last_accessed_on": "2020-07-01 11:00:00",
        "attendance_recording_type": "audio",
        "notes": "Some notes"
    }
]
 

Request   

GET api/webinar/enrolled-students

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

course_id   string   

The ID of the course to retrieve enrollments for. Example: 1

webinar_id   string   

The ID of the webinar to retrieve enrollments for. Example: 1

portal_id   string   

The ID of the portal for which the course is being accessed. Example: 1

Query Parameters

page_size   string   

The number of records to return per page. Example: 10

page_number   string   

The page number. Example: 1

order_by   string  optional  

Order by column and direction. Example: {"colName": "name", "direction": "asc"}

search_param   string  optional  

JSON object containing search parameters. Example: {}

Save Course Rating

Saves the course rating given by user and fires an event to send notification to the course creator.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/courses/rating" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"user_id\": \"1\",
    \"course_id\": \"1\",
    \"reviews\": \"\\\"This course is awesome\\\"\",
    \"rating\": 5,
    \"display_name\": \"\\\"John Doe\\\"\",
    \"portal_id\": \"1\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/courses/rating"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "user_id": "1",
    "course_id": "1",
    "reviews": "\"This course is awesome\"",
    "rating": 5,
    "display_name": "\"John Doe\"",
    "portal_id": "1"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


[
    "message" => "Course Rating submitted successfully."
]
 

Request   

POST api/courses/rating

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

user_id   required  optional  

The ID of the user who is submitting the review. Example: 1

course_id   required  optional  

The ID of the course for which the review is being submitted. Example: 1

reviews   string  optional  

The reviews given by the user. Example: "This course is awesome"

rating   integer  optional  

The rating given by the user. Example: 5

display_name   string  optional  

The display name of the user. Example: "John Doe"

portal_id   required  optional  

The ID of the portal for which the course is being accessed. Example: 1

Retrieves all the course ratings in a tabular list format in paginated mode.

You can apply filter using search_param via associatedCourse(modules used in course) and moduleName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/course/ratings/listing?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22associatedCourse%22%3A%22%22%2C%22moduleName%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/course/ratings/listing"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"associatedCourse":"","moduleName":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "total": 1,
    "recordsFiltered": 1,
    "ratings": [
        {
            "id": 1,
            "courseName": "Course Name",
            "courseId": 1,
            "rating": 5,
            "userId": 1,
            "reviews": "My first comment",
            "userdisplayName": "John Doe",
            "submissionDate": "Aug 11, 2020 05:56 AM"
        }
    ]
}
 

Request   

GET api/course/ratings/listing

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

for searching items based on field names. Example: {"associatedCourse":"","moduleName":""}

Delete Course Rating

Deletes the specified course rating and updates the average rating of the course.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/course/ratings/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": \"1\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/course/ratings/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": "1"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "status": "success",
    "message": "Course Rating deleted successfully!"
}
 

Request   

POST api/course/ratings/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   required  optional  

The ID of the course rating to delete. Example: 1

Launch

This API is used to launch a course and get the modules associated with the course.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/courses/launch?info=info%3Dtrue&portalId=1&moduleIds[]=1&moduleIds[]=2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/courses/launch"
);

const params = {
    "info": "info=true",
    "portalId": "1",
    "moduleIds[0]": "1",
    "moduleIds[1]": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "Course Name",
    "id": 2,
    "permalink": "http://example.com/course/launch",
    "featuredImageUrl": "http://example.com/featured-image.jpg",
    "instructions": "Course Instructions",
    "rating": 4.5,
    "enableCourseRating": true,
    "accessStatus": "Allowed",
    "status": "Not Started",
    "display_status": "Not Started",
    "completionPercentage": 0,
    "timeSpent": "00:00:00",
    "enrollmentDate": "22-02-2022",
    "isExpired": false,
    "lastAccessed": "Never",
    "estimatedCompletionTime": "2 hours",
    "expireOn": "22-02-2022",
    "modules": [],
    "daysToExpire": 10
}
 

Request   

GET api/courses/launch

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

registrationId   string   

Registration ID of the course. Example: 2

Query Parameters

info   string  optional  

optional If the API is called with info parameter, the API will not start the course, but will return the information of the course. Example: info=true

portalId   string   

Portal ID of the user. Example: 1

moduleIds   string[]  optional  

optional If you want to get the status of specific modules, you can pass the module IDs.

Retrieve course information (name, modules, webinars, etc.)

This API retrieves course information for a given course ID, portal ID, and user ID. The response includes the course name, modules, webinars, learning resources, and other relevant information.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/courses/portalCourseInfo?courseId=1&portalId=1&userId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/courses/portalCourseInfo"
);

const params = {
    "courseId": "1",
    "portalId": "1",
    "userId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "Course 1",
    "modules": [
        {
            "module_id": 1,
            "name": "Test Module 1",
            "slug": "test-module-1",
            "type": "text",
            "icon": "el-icon-tickets",
            "display_type": "Text",
            "last_accessed_on": "Never",
            "status": "Not Enrolled",
            "display_status": "Not Enrolled",
            "completion_percentage": 0,
            "estimatedCompletion_time": "1 hour"
        }
    ],
    "webinarList": [
        {
            "id": 1,
            "name": "Test Webinar 1",
            "start_date": "2020-08-03T10:02:33.000000Z",
            "end_date": "2020-08-03T10:02:33.000000Z",
            "description": "Test webinar description",
            "duration": "1 hour",
            "is_registered": false
        }
    ],
    "learningResources": [
        {
            "id": 1,
            "name": "Test Resource 1",
            "url": "http://example.com/test-resource-1.pdf",
            "description": "Test resource description"
        }
    ]
}
 

Request   

GET api/courses/portalCourseInfo

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

courseId   string   

ID of the course. Example: 1

portalId   string   

ID of the portal for which the course is being accessed. Example: 1

userId   string   

ID of the user accessing the course. Example: 1

Discount Coupons

A Coupon is used by the learners to reduce ther price by some discount, provided by the Instructor. It helps for adding/updating/editing discount coupons applied on products.

Coupons Tabular List

Returns all the coupons in a tabular list format with pagination. Allows filtering using the search_param via code (coupon code).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/coupons/tabularlist?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A%22desc%22%7D&search_param=0" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/coupons/tabularlist"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction":"desc"}",
    "search_param": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "code": "code75",
            "type": "percent_amount",
            "value": 1500,
            "total_limit": 12,
            "expired_at": "Aug 26, 2020"
        }
    ]
}
 

Request   

GET api/coupons/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of items you want per page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

optional JSON object for ordering items based on columns. Example: {"colName":"created_at", "direction":"desc"}

search_param   integer  optional  

optional JSON object for searching items based on coupon code. Example: 0

Coupon Lookup

Retrieves all coupons whose code matches the search term provided. This is useful for displaying coupons in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/coupons/lookup?search_term=%22SUMMER%22" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/coupons/lookup"
);

const params = {
    "search_term": ""SUMMER"",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "code": "code75"
    }
]
 

Request   

GET api/coupons/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

search_term   string   

The term to search for in coupon codes. Example: "SUMMER"

Retrieves all the type of the coupons.

Helps showing options in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/coupons/type/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/coupons/type/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "fixed_amount",
        "display_value": "Fixed Cart Discount"
    },
    {
        "db_value": "percent_amount",
        "display_value": "Percentage Discount"
    }
]
 

Request   

GET api/coupons/type/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Create Coupon

Creates a coupon based on the request data. Coupons can be used by the students to get some discount while purchasing the course.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/coupon/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"code\": \"code75\",
    \"value\": \"1500\",
    \"type\": \"percent_amount\",
    \"expiry\": \"2020-08-26\",
    \"allowed_emails\": \"null\",
    \"usage_limit\": 2000,
    \"notes\": \"Discount upto 75%\",
    \"allowed_products\": [
        1,
        2,
        3
    ],
    \"allowed_product_categories\": [
        1,
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/coupon/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "code": "code75",
    "value": "1500",
    "type": "percent_amount",
    "expiry": "2020-08-26",
    "allowed_emails": "null",
    "usage_limit": 2000,
    "notes": "Discount upto 75%",
    "allowed_products": [
        1,
        2,
        3
    ],
    "allowed_product_categories": [
        1,
        2,
        3
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Coupon created successfully"
}
 

Request   

POST api/coupon/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

code   string   

code for the coupon. Example: code75

value   numeric   

Value of the coupon(discount price or percentage). Example: 1500

type   string   

Types of the coupon. Type options: fixed_amount or percent_amount. Example: percent_amount

expiry   date  optional  

On this date, this coupon will get expired. Example: 2020-08-26

allowed_emails   string  optional  

All allowed email comma seprated. Example: null

usage_limit   integer  optional  

How many times this coupon can be used?. Example: 2000

notes   string  optional  

Notes for the coupon. Example: Discount upto 75%

allowed_products   string[]  optional  

allowed products.

allowed_product_categories   string[]  optional  

allowed product categories.

Get Coupon

Retrieves a coupon based on its ID. Useful for displaying a coupon's details.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/coupon/{id}?id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/coupon/{id}"
);

const params = {
    "id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "code": "code75",
    "type": "percent_amount",
    "value": 1500,
    "usage_limit": 12,
    "expiry": "2020-08-26",
    "allowed_emails": null,
    "note_privacy": null,
    "notes": "Discount upto 75%",
    "allowed_products": [],
    "excluded_products": [],
    "allowed_product_categories": []
}
 

Request   

GET api/coupon/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

The ID of the coupon. Example: 1

Update Coupon

Updates a coupon based on the id provided as parameter.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/coupon/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": \"1\",
    \"code\": \"code75\",
    \"value\": \"1500\",
    \"type\": \"percent_amount\",
    \"expiry\": \"2020-08-26\",
    \"allowed_emails\": \"null\",
    \"usage_limit\": 2000,
    \"notes\": \"Discount upto 75%\",
    \"allowed_products\": [
        1,
        2,
        3
    ],
    \"allowed_product_categories\": [
        1,
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/coupon/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": "1",
    "code": "code75",
    "value": "1500",
    "type": "percent_amount",
    "expiry": "2020-08-26",
    "allowed_emails": "null",
    "usage_limit": 2000,
    "notes": "Discount upto 75%",
    "allowed_products": [
        1,
        2,
        3
    ],
    "allowed_product_categories": [
        1,
        2,
        3
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Coupon updated successfully"
}
 

Request   

PUT api/coupon/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the coupon. Example: 1

Body Parameters

id   required  optional  

The ID of the coupon. Example: 1

code   required  optional  

Code for the coupon. Example: code75

value   required  optional  

Value of the coupon(discount price or percentage). Example: 1500

type   required  optional  

Types of the coupon. Type options: fixed_amount or percent_amount. Example: percent_amount

expiry   date  optional  

On this date, this coupon will get expired. Example: 2020-08-26

allowed_emails   string  optional  

All allowed email comma seprated. Example: null

usage_limit   integer  optional  

How many times this coupon can be used?. Example: 2000

notes   string  optional  

Notes for the coupon. Example: Discount upto 75%

allowed_products   string[]  optional  

allowed products.

allowed_product_categories   string[]  optional  

allowed product categories.

Delete Coupon

Deletes a coupon based on the id provided as parameter.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/coupon/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_ids\": \"[1,2,3]\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/coupon/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_ids": "[1,2,3]"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "1 coupon(s) deleted. 1 coupon(s) not deleted as they are associated with orders"
}
 

Example response (500):


{
    "message": "Something went wrong"
}
 

Request   

POST api/coupon/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   required  optional  

The ID of the coupon. Example: [1,2,3]

List of all coupons.

Returns a list of all coupons. Response contains coupon id and coupon code.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/coupon/list" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/coupon/list"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "0": {
        "id": 1,
        "code": "code1"
    },
    "1": {
        "id": 2,
        "code": "code2"
    }
}
 

Example response (500):


{
    "message": "Something went wrong"
}
 

Request   

GET api/settings/coupon/list

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Discussions

A Discussion module is used as course content and a platform where learners can have discussions. Helps to perform CRUD operation to and for discussion modules.

Discussion Modules Tabular List

Returns all discussion modules in a tabular list format with pagination. Filters can be applied using search parameters for associated courses and module names.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/discussion?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22associatedCourse%22%3A+%22%22%2C+%22moduleName%22%3A+%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/discussion"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"associatedCourse": "", "moduleName": ""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 5,
    "records": [
        {
            "id": 1,
            "name": "Discussion 1",
            "slug": "discussion-1",
            "type": "discussion",
            "totalPoints": 100,
            "icon": "<i class=\"el-icon-chat\"></i>",
            "author": "John Doe",
            "showMappedCourses": false,
            "created_at": "Aug 03, 2020 09:56 AM",
            "course_count": 2
        }
    ]
}
 

Request   

GET api/modules/discussion

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of items per page. Example: 50

page_number   string   

Current page number for pagination. Example: 1

order_by   string  optional  

Optional JSON for sorting items by column. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

Optional JSON for searching by associatedCourse and moduleName. Example: {"associatedCourse": "", "moduleName": ""}

Create Discussion Module

To create a discussion module, you need to use this request. (See parameters) Created discussion modules can be used in the course as course content/lesson.

Returns : id of the discussion created and successfull message

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/modules/discussion" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"First-discussion\",
    \"content\": \"A brief description\",
    \"should_be_evaluated\": true,
    \"totalPoints\": 20,
    \"minComments\": 5,
    \"estimatedCompletion\": \"90\",
    \"estimationCompletedUnit\": \"minutes\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/discussion"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "First-discussion",
    "content": "A brief description",
    "should_be_evaluated": true,
    "totalPoints": 20,
    "minComments": 5,
    "estimatedCompletion": "90",
    "estimationCompletedUnit": "minutes"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 8,
    "message": "Module saved successfully"
}
 

Request   

POST api/modules/discussion

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

Name of the discussion module. Example: First-discussion

content   string   

Content for the discussion modules that learners will see. Example: A brief description

should_be_evaluated   boolean   

If true, the discussion will be graded on course evaluation. Example: true

totalPoints   integer  optional  

Total points a student can get by completing this discussion. Example: 20

minComments   integer  optional  

At least these many comments should be provided by the student to pass the discussion(required if should_be_evaluated is true). Example: 5

estimatedCompletion   nullable  optional  

Estimated time to complete the module. Example: 90

estimationCompletedUnit   nullable  optional  

Unit of time estimation (e.g., minutes, hours). Example: minutes

Update Discussion Module

Updates the details of a specified discussion module. Validates the request and updates the module with the given parameters if it exists.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/modules/discussion/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"First Discussion\",
    \"content\": \"An updated brief description\",
    \"should_be_evaluated\": true,
    \"totalPoints\": 20,
    \"minComments\": 5,
    \"estimatedCompletion\": \"90\",
    \"estimationCompletedUnit\": \"minutes\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/discussion/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "First Discussion",
    "content": "An updated brief description",
    "should_be_evaluated": true,
    "totalPoints": 20,
    "minComments": 5,
    "estimatedCompletion": "90",
    "estimationCompletedUnit": "minutes"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Module updated successfully"
}
 

Request   

PUT api/modules/discussion/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the discussion module. Example: 1

Body Parameters

name   string   

Name of the discussion module. Example: First Discussion

content   string   

Content for the discussion module. Example: An updated brief description

should_be_evaluated   boolean   

If true, the discussion will be graded on course evaluation. Example: true

totalPoints   integer  optional  

optional Total points a student can get by completing this discussion. Example: 20

minComments   integer  optional  

At least these many comments should be provided by the student to pass the discussion. Required if should_be_evaluated is true. Example: 5

estimatedCompletion   nullable  optional  

Estimated time to complete the module. Example: 90

estimationCompletedUnit   nullable  optional  

Unit of time estimation (e.g., minutes, hours). Example: minutes

Get Discussion Module

Returns a discussion module based on its ID.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/discussion/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/discussion/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Discussion 1",
    "slug": "discussion-1",
    "content": "A brief description",
    "totalPoints": 100,
    "should_be_evaluated": true,
    "minComments": 2,
    "estimatedCompletion": 2,
    "estimationCompletedUnit": "hours",
    "courses": [
        {
            "course_id": 1,
            "course_name": "Course 1"
        }
    ]
}
 

Request   

GET api/modules/discussion/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the discussion module. Example: 1

Get Discussion Module Details

To get the details of a discussion module, you need to use this request. (See parameters)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/discussion/details" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/discussion/details"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
"name": "First Discussion",
"slug": "first-discussion",
"content": "A brief description",
"courseName": "First Course",
"courseSlug": "http://localhost:8000/courses/1/launch",
"url": "http://localhost:8000/courses/1/modules/2/launch",
"totalPoints": 20,
"shouldBeEvaluated": true,
"min_time_spent": 90,
"otherModules": [],
"launchCheck": {...},
"prevSlug": "first-video",
"nextSlug": "second-video",
"currentUserId": 1,
"currentStudentAvatar": "http://localhost:8000/storage/avatars/1.png",
"currentUserName": "John Doe",
"status": "In Progress",
"statusRowId": 1,
"timeSpent": 0,
"course_newly_completed": false,
"timeToBeSpent": 1,
"instructorResponse": null
}
 

Request   

GET api/module/discussion/details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

registrationId   string   

ID of the course registration. Example: 1

moduleId   string   

ID of the discussion module. Example: 2

portalId   integer  optional  

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Retrieve Comments

Returns all the discussion comments in a tabular list format in paginated mode. You can apply filter using search_param via associatedCourse(modules used in course) and moduleName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/discussion/loadComments?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=%7B%22associatedCourse%22%3A%22%22%2C%22moduleName%22%3A%22%22%7D&moduleId=2&registrationId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/discussion/loadComments"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"associatedCourse":"","moduleName":""}",
    "moduleId": "2",
    "registrationId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{"recordsTotal":1,"recordsFiltered":1,"records":[{"id":1,"comment":"My first comment","userAvatar":"<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"40\" height=\"40\" viewBox=\"0 0 40 40\"><circle cx=\"20\" cy=\"20\" r=\"20\" stroke=\"background\" stroke-width=\"0\" fill=\"#00BCD4\" \/><text x=\"20\" y=\"20\" font-size=\"14\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">AS<\/text><\/svg>","userFullName":"Aom Staff","date":"Aug 11, 2020 05:56 AM", "replies":[]}]
 

Request   

GET api/module/discussion/loadComments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}}

search_param   string  optional  

for searching items based on field names. Example: {"associatedCourse":"","moduleName":""}

moduleId   string   

ID of the discussion module. Example: 2

registrationId   string   

ID of the course registration. Example: 1

Post Comment for Discussion Module

Post a comment for the discussion module. The comment is for the given module under the given course registration. If the comment meets the submission conditions, then the module status is updated to 'Submitted' and an entry is made in discussion evaluation table and an email is sent to the instructor.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/module/discussion/postComment" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"statusRowId\": \"7\",
    \"currentUserId\": \"1\",
    \"comment\": \"This is my first comment.\",
    \"parentId\": \"1\",
    \"portalId\": 5
}"
const url = new URL(
    "https://demo.aomlms.com/api/module/discussion/postComment"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "statusRowId": "7",
    "currentUserId": "1",
    "comment": "This is my first comment.",
    "parentId": "1",
    "portalId": 5
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "status": "Submitted",
    "message": "Comment Posted"
}
 

Request   

POST api/module/discussion/postComment

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

statusRowId   required  optional  

ID of the Module status of the current discussion submission. Example: 7

currentUserId   required  optional  

ID of the user who commented. Example: 1

comment   required  optional  

Comment posted by the user for current discussion. Example: This is my first comment.

parentId   optional  optional  

Parent ID of the discussion. Example: 1

portalId   integer  optional  

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Retrieve Discussion Submission Details

Retrieves the submission details of the discussion the student have given. Helps in grading a student. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/discussion/submissions?statusRowId=delectus" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/discussion/submissions"
);

const params = {
    "statusRowId": "delectus",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "courseId": 1,
    "courseName": "course 1",
    "discussionName": "assign",
    "status": "In Progress",
    "content": "Desc",
    "totalPoints": 50,
    "shouldBeEvaluated": true,
    "userAvatar": "avatar.jpg",
    "userFullName": "Aom Staff",
    "userEmail": "[email protected]",
    "comments": [
        {
            "id": 1,
            "comment": "This is my first comment.",
            "date": "Aug 10, 2020 11:33 AM"
        }
    ],
    "replies": [
        {
            "id": 1,
            "comment": "This is my first reply.",
            "date": "Aug 10, 2020 11:33 AM"
        }
    ]
}
 

Request   

GET api/module/discussion/submissions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

statusRowId   string   

ID of the Module status of the current discussion submission. example: 1 Example: delectus

Evaluate Discussion

Evaluates the discussion from Instructor side.Updates the status of discussion to completed if Instructor thinks student's submission is upto the marks. (See Parameters)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/module/discussion/evaluate" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalId\": 1,
    \"statusRowId\": \"7\",
    \"evaluation\": \"{instructorMessage : \'You comments look good\', pointsAwarded: \'50\' }\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/module/discussion/evaluate"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalId": 1,
    "statusRowId": "7",
    "evaluation": "{instructorMessage : 'You comments look good', pointsAwarded: '50' }"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Discussion evaluated successfully"
}
 

Request   

POST api/module/discussion/evaluate

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalId   integer  optional  

ID of the portal for which the assignment is being submitted. Example: 1

statusRowId   required  optional  

ID of the Module status of the current assignment. Example: 7

evaluation   required  optional  

Evaluation data by the Instructor(Completed or not). Example: {instructorMessage : 'You comments look good', pointsAwarded: '50' }

Retrieve Discussion Comments

Retrieves all the discussion comments in a nested tree format in paginated mode. You can apply filter using search_param via associatedCourse(modules used in course) and moduleName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/discussion/comments?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22associatedCourse%22%3A%22%22%2C%22moduleName%22%3A%22%22%7D&moduleId=2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/discussion/comments"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"associatedCourse":"","moduleName":""}",
    "moduleId": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "comment": "My first comment",
            "courseName": "course 1",
            "userAvatar": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"40\" viewBox=\"0 0 40 40\"><circle cx=\"20\" cy=\"20\" r=\"20\" stroke=\"background\" stroke-width=\"0\" fill=\"#00BCD4\" /><text x=\"20\" y=\"20\" font-size=\"14\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">AS</text></svg>",
            "userFullName": "Aom Staff",
            "date": "Aug 11, 2020 05:56 AM",
            "replies": [
                {
                    "id": 1,
                    "comment": "My first reply",
                    "userAvatar": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"40\" viewBox=\"0 0 40 40\"><circle cx=\"20\" cy=\"20\" r=\"20\" stroke=\"background\" stroke-width=\"0\" fill=\"#00BCD4\" /><text x=\"20\" y=\"20\" font-size=\"14\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">AS</text></svg>",
                    "userFullName": "Aom Staff",
                    "date": "Aug 11, 2020 05:56 AM",
                    "replies": [
                        {
                            "id": 1,
                            "comment": "My second reply",
                            "userAvatar": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"40\" viewBox=\"0 0 40 40\"><circle cx=\"20\" cy=\"20\" r=\"20\" stroke=\"background\" stroke-width=\"0\" fill=\"#00BCD4\" /><text x=\"20\" y=\"20\" font-size=\"14\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">AS</text></svg>",
                            "userFullName": "Aom Staff",
                            "date": "Aug 11, 2020 05:56 AM",
                            "replies": []
                        }
                    ]
                }
            ]
        }
    ]
}
 

Request   

GET api/module/discussion/comments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

for searching items based on field names. Example: {"associatedCourse":"","moduleName":""}

moduleId   string   

ID of the discussion module. Example: 2

Delete Discussion Comments

Deletes the given comments and its children too.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/module/discussion/deleteComments" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_ids\": \"[1,2,3]\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/module/discussion/deleteComments"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_ids": "[1,2,3]"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Comment(s) deleted successfully"
}
 

Request   

POST api/module/discussion/deleteComments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   required  optional  

An array of IDs of comments to be deleted. Example: [1,2,3]

ECommerce

Endpoints for managing ecommerce settings. Getting and setting items status and values for the platform and the products.

Retrieves the global ecommerce product settings.

Fetches the settings of global products, including the color of product price and call to action names for free, simple and subscription products.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/ecommerce/global" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/global"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "product_price_color": {
        "content": {
            "backgroundColor": "#fff"
        }
    },
    "free_product_cta": "Enroll Now",
    "simple_product_cta": "Add to Cart",
    "subscription_product_cta": "Subscribe"
}
 

Request   

GET api/settings/ecommerce/global

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieve Ecommerce Cart Abandonment Settings

Fetches the settings related to cart abandonment tracking, including whether tracking is enabled and the UTM parameters used for tracking.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/ecommerce/cartAbandonment" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/cartAbandonment"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "enable_cart_abandoned_tracking": true,
    "enable_tracking_staff": false,
    "utm_parameters": "utm_source=google&utm_medium=cpc"
}
 

Request   

GET api/settings/ecommerce/cartAbandonment

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Country Lookup

Retrieves all the countries in list format. Helps while showing countries in form elements like dropdown.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/countries/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/countries/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "AF": "Afghanistan",
    "AX": "Aland Islands",
    "AL": "Albania",
    "DZ": "Algeria",
    "AS": "American Samoa",
    "AD": "Andorra",
    "AO": "Angola",
    "AI": "Anguilla",
    "AQ": "Antarctica",
    "AG": "Antigua and Barbuda",
    "AR": "Argentina",
    "AM": "Armenia",
    "AW": "Aruba",
    "AU": "Australia",
    "AT": "Austria",
    "AZ": "Azerbaijan",
    "BS": "Bahamas",
    "BH": "Bahrain",
    "BD": "Bangladesh",
    "BB": "Barbados",
    "BY": "Belarus",
    "BE": "Belgium",
    "BZ": "Belize",
    "BJ": "Benin",
    "BM": "Bermuda",
    "BT": "Bhutan",
    "BO": "Bolivia",
    "BA": "Bosnia and Herzegovina",
    "BW": "Botswana",
    "BV": "Bouvet Island",
    "BR": "Brazil",
    "VG": "Virgin Islands, British",
    "BN": "Brunei",
    "BG": "Bulgaria",
    "BF": "Burkina Faso",
    "BI": "Burundi",
    "KH": "Cambodia",
    "CM": "Cameroon",
    "CA": "Canada",
    "CV": "Cape Verde",
    "KY": "Cayman Islands",
    "CF": "Central African Republic",
    "TD": "Chad",
    "CL": "Chile",
    "CN": "China",
    "CX": "Christmas Island",
    "CC": "Cocos (Keeling) Islands",
    "CO": "Colombia",
    "KM": "Comoros",
    "CG": "Congo",
    "CD": "Congo, The Democratic Republic of the",
    "CK": "Cook Islands",
    "CR": "Costa Rica",
    "CI": "Cote d'Ivoire",
    "HR": "Croatia",
    "CU": "Cuba",
    "CW": "Curacao",
    "CY": "Cyprus",
    "CZ": "Czech Republic",
    "DK": "Denmark",
    "DJ": "Djibouti",
    "DM": "Dominica",
    "DO": "Dominican Republic",
    "EC": "Ecuador",
    "EG": "Egypt",
    "SV": "El Salvador",
    "GQ": "Equatorial Guinea",
    "ER": "Eritrea",
    "EE": "Estonia",
    "ET": "Ethiopia",
    "FK": "Falkland Islands (Malvinas)",
    "FO": "Faroe Islands",
    "FJ": "Fiji",
    "FI": "Finland",
    "FR": "France",
    "GF": "French Guiana",
    "PF": "French Polynesia",
    "TF": "French Southern Territories",
    "GA": "Gabon",
    "GM": "Gambia",
    "GE": "Georgia",
    "DE": "Germany",
    "GH": "Ghana",
    "GI": "Gibraltar",
    "GR": "Greece",
    "GL": "Greenland",
    "GD": "Grenada",
    "GP": "Guadeloupe",
    "GU": "Guam",
    "GT": "Guatemala",
    "GG": "Guernsey",
    "GN": "Guinea",
    "GW": "Guinea-Bissau",
    "GY": "Guyana",
    "HT": "Haiti",
    "HM": "Heard Island and McDonald Islands",
    "VA": "Holy See (Vatican City)",
    "HN": "Honduras",
    "HK": "Hong Kong",
    "HU": "Hungary",
    "IS": "Iceland",
    "IN": "India",
    "ID": "Indonesia",
    "IR": "Iran, Islamic Republic of",
    "IQ": "Iraq",
    "IE": "Ireland",
    "IM": "Isle of Man",
    "IL": "Israel",
    "IT": "Italy",
    "JM": "Jamaica",
    "JP": "Japan",
    "JE": "Jersey",
    "JO": "Jordan",
    "KZ": "Kazakhstan",
    "KE": "Kenya",
    "KI": "Kiribati",
    "KP": "Korea, Democratic People's Republic of",
    "KR": "Korea, Republic of",
    "KW": "Kuwait",
    "KG": "Kyrgyzstan",
    "LA": "Lao People's Democratic Republic",
    "LV": "Latvia",
    "LB": "Lebanon",
    "LS": "Lesotho",
    "LR": "Liberia",
    "LY": "Libyan Arab Jamahiriya",
    "LT": "Lithuania",
    "LU": "Luxembourg",
    "MO": "Macao",
    "MK": "Macedonia, The Former Yugoslav Republic of",
    "MG": "Madagascar",
    "MW": "Malawi",
    "MY": "Malaysia",
    "MV": "Maldives",
    "ML": "Mali",
    "MT": "Malta",
    "MH": "Marshall Islands",
    "MQ": "Martinique",
    "MR": "Mauritania",
    "MU": "Mauritius",
    "YT": "Mayotte",
    "MX": "Mexico",
    "FM": "Micronesia, Federated States of",
    "MD": "Moldova, Republic of",
    "MC": "Monaco",
    "MN": "Mongolia",
    "ME": "Montenegro",
    "MS": "Montserrat",
    "MA": "Morocco",
    "MZ": "Mozambique",
    "MM": "Myanmar",
    "NA": "Namibia",
    "NR": "Nauru",
    "NP": "Nepal",
    "NL": "Netherlands",
    "NC": "New Caledonia",
    "NZ": "New Zealand",
    "NI": "Nicaragua",
    "NE": "Niger",
    "NG": "Nigeria",
    "NU": "Niue",
    "NF": "Norfolk Island",
    "MP": "Northern Mariana Islands",
    "NO": "Norway",
    "OM": "Oman",
    "PK": "Pakistan",
    "PW": "Palau",
    "PS": "Palestinian Territory, Occupied",
    "PA": "Panama",
    "PG": "Papua New Guinea",
    "PY": "Paraguay",
    "PE": "Peru",
    "PH": "Philippines",
    "PN": "Pitcairn",
    "PL": "Poland",
    "PT": "Portugal",
    "PR": "Puerto Rico",
    "QA": "Qatar",
    "RE": "Reunion",
    "RO": "Romania",
    "RU": "Russian Federation",
    "RW": "Rwanda",
    "BL": "Saint Barthelemy",
    "SH": "Saint Helena, Ascension and Tristan da Cunha",
    "KN": "Saint Kitts and Nevis",
    "LC": "Saint Lucia",
    "MF": "Saint Martin (French part)",
    "PM": "Saint Pierre and Miquelon",
    "VC": "Saint Vincent and the Grenadines",
    "WS": "Samoa",
    "SM": "San Marino",
    "ST": "Sao Tome and Principe",
    "SA": "Saudi Arabia",
    "SN": "Senegal",
    "RS": "Serbia",
    "SC": "Seychelles",
    "SL": "Sierra Leone",
    "SG": "Singapore",
    "SX": "Sint Maarten (Dutch part)",
    "SK": "Slovakia",
    "SI": "Slovenia",
    "SB": "Solomon Islands",
    "SO": "Somalia",
    "ZA": "South Africa",
    "GS": "South Georgia and the South Sandwich Islands",
    "SS": "South Sudan",
    "ES": "Spain",
    "LK": "Sri Lanka",
    "SD": "Sudan",
    "SR": "Suriname",
    "SJ": "Svalbard and Jan Mayen",
    "SZ": "Swaziland",
    "SE": "Sweden",
    "CH": "Switzerland",
    "SY": "Syrian Arab Republic",
    "TW": "Taiwan, Province of China",
    "TJ": "Tajikistan",
    "TZ": "Tanzania, United Republic of",
    "TH": "Thailand",
    "TL": "Timor-Leste",
    "TG": "Togo",
    "TK": "Tokelau",
    "TO": "Tonga",
    "TT": "Trinidad and Tobago",
    "TN": "Tunisia",
    "TR": "Turkey",
    "TM": "Turkmenistan",
    "TC": "Turks and Caicos Islands",
    "TV": "Tuvalu",
    "UG": "Uganda",
    "UA": "Ukraine",
    "AE": "United Arab Emirates",
    "GB": "United Kingdom",
    "US": "United States",
    "UM": "United States Minor Outlying Islands",
    "UY": "Uruguay",
    "UZ": "Uzbekistan",
    "VU": "Vanuatu",
    "VE": "Venezuela, Bolivarian Republic of",
    "VN": "Viet Nam",
    "VI": "Virgin Islands, U.S.",
    "WF": "Wallis and Futuna",
    "EH": "Western Sahara",
    "YE": "Yemen",
    "ZM": "Zambia",
    "ZW": "Zimbabwe"
}
 

Request   

GET api/countries/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

States Lookup

Retrieves all the states for a given country code in list format. Helps while showing states in form elements like dropdown.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/states/lookup?countryCode=IN" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/states/lookup"
);

const params = {
    "countryCode": "IN",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{"KA":"Karnataka","KL":"Kerala","TN":"Tamil Nadu",...}
 

Request   

GET api/states/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

countryCode   string   

The country code for which the states are needed. Example: IN

Retrieves all the currencies.

Fetches the list of all the currencies supported by the platform.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/currency/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/currency/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{"USD":"United States (US) dollar","EUR":"Euro","INR":"Indian rupee",...}
 

Request   

GET api/currency/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieves the general ecommerce settings. Helps in fetching items of the ecommerce settings, like country, city, address, location, etc(See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/ecommerce/general" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/general"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
     "addressLine1": "1234 Lorem Ipsum Drive",
     "addressLine2": "omnis",
     "city": "New Jersey",
     "state": "vel",
     "country": "country",
     "zipcode": "08053",
     "selling_location": "all_countries",
     "some_countries_excluded": [],
     "some_countries": [],
     "enableTaxes": true,
     "enableCoupons": true,
     "currency": "USD",
     "productionMode": true,
     "enableSaleTax": true,
     "enableShipping": true,
}
 

Request   

GET api/settings/ecommerce/general

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Set General Ecommerce Settings

To save the general ecommerce settings with updated values, you need to use this request. (See parameters)

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/ecommerce/general" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"addressLine1\": \"1234 Lorem Ipsum Drive\",
    \"addressLine2\": \"omnis\",
    \"city\": \"New Jersey\",
    \"state\": \"vel\",
    \"country\": \"country\",
    \"zipcode\": \"08053\",
    \"enableCoupons\": true,
    \"currency\": \"USD\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/general"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "addressLine1": "1234 Lorem Ipsum Drive",
    "addressLine2": "omnis",
    "city": "New Jersey",
    "state": "vel",
    "country": "country",
    "zipcode": "08053",
    "enableCoupons": true,
    "currency": "USD"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated"
}
 

Request   

PUT api/settings/ecommerce/general

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

addressLine1   string   

Address Line 1 of shop. Example: 1234 Lorem Ipsum Drive

addressLine2   string   

Address Line 2 of shop. Example: omnis

city   string   

City of shop. Example: New Jersey

state   string   

State of shop. Example: vel

country   string   

Country of shop. Example: country

zipcode   string   

Zipcode of shop. Example: 08053

enableCoupons   boolean   

If true, coupons are enabled. Example: true

currency   string   

Currency of shop. Example: USD

Retrieves the invoice settings. Helps in fetching items of the invoice settings, like invoice business name, business name, tax settings, business info, etc(See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/ecommerce/invoice" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/invoice"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
     "invoiceBusinessName": "defaultBusinessName",
     "businessName": "Business Name",
     "taxSettings": "inclusive",
     "businessInfo": {
         "addressLine1": "1234 Lorem Ipsum Drive",
         "addressLine2": "omnis",
         "city": "New Jersey",
         "state": "vel",
         "country": "country",
         "zipcode": "08053",
     },
}
 

Request   

GET api/settings/ecommerce/invoice

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Set Invoice Settings

Updates the settings for Invoice. Setting needs to be updated is mentioned in parameter. (See Parameter)

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/ecommerce/invoice" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"invoiceBusinessName\": \"customBusinessName\",
    \"businessName\": \"Business Name\",
    \"taxSettings\": \"inclusive\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/invoice"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "invoiceBusinessName": "customBusinessName",
    "businessName": "Business Name",
    "taxSettings": "inclusive"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Order Invoice Settings Updated Successfully"
}
 

Request   

PUT api/settings/ecommerce/invoice

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

invoiceBusinessName   string   

Whether to use default business name or a custom business name. Example: customBusinessName

businessName   string  optional  

required_if:invoiceBusinessName,customBusinessName Business name to be used in the invoice. Example: Business Name

taxSettings   string  optional  

Tax settings of the invoice. Example: inclusive

Set Global Ecommerce Product Settings

Updates the settings of global products, including the color of product price and call to action names for free, simple and subscription products.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/ecommerce/global" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"freeProductCta\": \"Enroll Now\",
    \"simpleProductCta\": \"Add to Cart\",
    \"subscriptionProductCta\": \"Subscribe\",
    \"productPriceColor\": {
        \"content\": {
            \"backgroundColor\": \"#fff\"
        }
    }
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/global"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "freeProductCta": "Enroll Now",
    "simpleProductCta": "Add to Cart",
    "subscriptionProductCta": "Subscribe",
    "productPriceColor": {
        "content": {
            "backgroundColor": "#fff"
        }
    }
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated"
}
 

Request   

PUT api/settings/ecommerce/global

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

freeProductCta   string   

Call to action name for free products. Example: Enroll Now

simpleProductCta   string   

Call to action name for simple products. Example: Add to Cart

subscriptionProductCta   string   

Call to action name for subscription products. Example: Subscribe

productPriceColor   object   

Object containing a single key "content" with a single key "backgroundColor" which is the color of the product price.

Set Ecommerce Cart Abandonment Setting

Updates the ecommerce settings related to cart abandonment tracking. Allows enabling/disabling of cart abandonment tracking and tracking by staff. Also updates UTM parameters used for tracking.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/ecommerce/cartAbandonment" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"enableTracking\": true,
    \"enableTrackingStaff\": false,
    \"utmParameters\": \"utm_source=google&utm_medium=cpc\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/cartAbandonment"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "enableTracking": true,
    "enableTrackingStaff": false,
    "utmParameters": "utm_source=google&utm_medium=cpc"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Cart Settings Updated Successfully"
}
 

Request   

PUT api/settings/ecommerce/cartAbandonment

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

enableTracking   boolean   

Enable or disable cart abandonment tracking. Example: true

enableTrackingStaff   boolean   

Enable or disable tracking by staff. Example: false

utmParameters   string  optional  

UTM parameters for cart abandonment tracking. Example: utm_source=google&utm_medium=cpc

Retrieve Cart Abandonment Details

Fetches the cart abandonment details, including the cart total, status, abandoned at date, completed at date and products in the cart.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/cartAbandonmentDetails" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"search_param\": {
        \"abandonedAt\": [
            \"provident\"
        ],
        \"status\": [
            \"veritatis\"
        ],
        \"nameOrEmail\": \"[email protected]\"
    }
}"
const url = new URL(
    "https://demo.aomlms.com/api/cartAbandonmentDetails"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "search_param": {
        "abandonedAt": [
            "provident"
        ],
        "status": [
            "veritatis"
        ],
        "nameOrEmail": "[email protected]"
    }
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "recoverableOrders": 0,
    "recoveredOrders": 0,
    "recoverableRevenue": "0.00",
    "recoveredRevenue": "0.00",
    "currency": "USD",
    "enableTracking": true,
    "records": [
        {
            "id": 1,
            "firstName": "John",
            "lastName": "Doe",
            "email": "[email protected]",
            "cartTotal": "100.00",
            "cartTotalNumber": 100,
            "status": "Abandoned",
            "abandonedAt": "2022-01-01 12:00:00",
            "completedAt": null,
            "orderId": null,
            "products": [
                "Product 1",
                "Product 2"
            ]
        }
    ]
}
 

Request   

GET api/cartAbandonmentDetails

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

search_param   object   

The search parameters, including the abandoned at date range, status and name or email.

abandonedAt   string[]   

The abandoned at date range.

status   string[]   

The status of the cart abandonment.

nameOrEmail   string   

The name or email of the user. Example: [email protected]

Retrieves the base currency of the shop.

Fetches the base currency set in the Ecommerce settings.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/get-shop-base-currency" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/get-shop-base-currency"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "currency": "USD"
}
 

Request   

GET api/get-shop-base-currency

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Returns a list of all tax classes and their associated tax rates.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/taxClasses/tabularlist" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/taxClasses/tabularlist"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Standard",
        "description": "Default tax class for general products",
        "showDetails": true,
        "taxRates": [
            {
                "taxClassId": 1,
                "rate_id": 101,
                "name": "US Standard Rate",
                "country": "US",
                "state": [
                    "CA",
                    "NY"
                ],
                "zipCode": [
                    "90001",
                    "10001"
                ],
                "rate": 7.25
            },
            {
                "taxClassId": 1,
                "rate_id": 102,
                "name": "US Reduced Rate",
                "country": "US",
                "state": [
                    "TX"
                ],
                "zipCode": [
                    "73301"
                ],
                "rate": 6.5
            }
        ]
    }
]
 

Request   

GET api/settings/taxClasses/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Creates a sales tax configuration.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/settings/salesTax" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"pricesIncludeTax\": true,
    \"taxCalculationBasedOn\": \"\\\"shipping\\\"\",
    \"shippingTaxClass\": 1,
    \"taxDisplaySuffix\": \"\\\"Incl. Tax\\\"\",
    \"displayTaxTotals\": true
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/salesTax"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "pricesIncludeTax": true,
    "taxCalculationBasedOn": "\"shipping\"",
    "shippingTaxClass": 1,
    "taxDisplaySuffix": "\"Incl. Tax\"",
    "displayTaxTotals": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
     "message": "Sales tax created successfully",
}
 

Request   

POST api/settings/salesTax

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

pricesIncludeTax   boolean   

Whether prices include tax. Example: true

taxCalculationBasedOn   string   

Whether to calculate tax based on shipping or billing. Example: "shipping"

shippingTaxClass   integer   

The tax class for shipping. Example: 1

taxDisplaySuffix   string   

The suffix to display after tax. Example: "Incl. Tax"

displayTaxTotals   boolean   

Whether to display tax totals. Example: true

Retrieves the sales tax settings.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/getSalesTax" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/getSalesTax"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "pricesIncludeTax": true,
    "taxCalculationBasedOn": "shipping",
    "shippingTaxClass": 1,
    "taxDisplaySuffix": "Incl. Tax",
    "displayTaxTotals": true
}
 

Request   

GET api/settings/getSalesTax

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update a tax class.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/taxClass/update/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"\\\"Sales Tax\\\"\",
    \"description\": \"\\\"This is a sales tax\\\"\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/taxClass/update/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "\"Sales Tax\"",
    "description": "\"This is a sales tax\""
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
     "message": "Tax Class updated successfully",
}
 

Request   

PUT api/settings/taxClass/update/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

The name of the tax class. Example: "Sales Tax"

description   string   

The description of the tax class. Example: "This is a sales tax"

Deletes a tax class and its associated tax rates.

If a tax class is associated with a product, it will not be deleted.

If a tax class is associated with an order, it will not be deleted.

If a tax class is associated with an order item, it will not be deleted.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/settings/taxClasses/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_ids\": [
        1,
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/taxClasses/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_ids": [
        1,
        2,
        3
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "deletedTaxClasses": [
        1,
        3
    ],
    "notDeletedTaxClasses": [
        {
            "order_id": 5001,
            "tax_rate_id": 102,
            "tax_rate_name": "US Reduced Rate"
        },
        {
            "order_id": 5002,
            "tax_rate_id": 201,
            "tax_rate_name": "EU Reduced Rate"
        }
    ],
    "notDeletedTaxClassesProduct": [
        {
            "product_id": 3001,
            "product_name": "Wireless Mouse",
            "tax_class_id": 2
        },
        {
            "product_id": 3002,
            "product_name": "E-book Subscription",
            "tax_class_id": 2
        }
    ]
}
 

Request   

POST api/settings/taxClasses/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string[]  optional  

of integers required The ids of the tax classes to delete.

Update a tax rate.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/taxRate/update/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"tax_class_id\": 1,
    \"name\": \"\\\"Sales Tax\\\"\",
    \"country\": \"\\\"United States\\\"\",
    \"state\": \"\\\"California\\\"\",
    \"zipCode\": [
        \"10001\",
        \"10002\",
        \"10003\"
    ],
    \"rate\": 0.2,
    \"appliedRateOn\": \"\\\"all_states\\\"\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/taxRate/update/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "tax_class_id": 1,
    "name": "\"Sales Tax\"",
    "country": "\"United States\"",
    "state": "\"California\"",
    "zipCode": [
        "10001",
        "10002",
        "10003"
    ],
    "rate": 0.2,
    "appliedRateOn": "\"all_states\""
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
     "message": "Tax rates updated successfully!",
}
 

Request   

PUT api/settings/taxRate/update/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

tax_class_id   integer  optional  

optional The id of the tax class the tax rate belongs to. Example: 1

name   string   

The name of the tax rate. Example: "Sales Tax"

country   string   

The country of the tax rate. Example: "United States"

state   string  optional  

optional The state of the tax rate. Example: "California"

zipCode   string[]  optional  

of strings optional The zip codes of the tax rate.

rate   number  optional  

optional The rate of the tax rate. Example: 0.2

appliedRateOn   string  optional  

optional The rate on which the tax rate is applied. Example: "all_states"

Retrieves the sales tax settings.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/enablesalesTax" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/enablesalesTax"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
     "enableSalesTaxes": true,
}
 

Request   

GET api/settings/enablesalesTax

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Updates the sales tax setting.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/enablesalesTax" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"enableSalesTaxes\": true
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/enablesalesTax"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "enableSalesTaxes": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated",
    "type": "success",
    "title": "Success"
}
 

Request   

PUT api/settings/enablesalesTax

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

enableSalesTaxes   boolean   

Whether to enable sales tax. Example: true

Creates a new tax class and associated tax rates.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/settings/taxClasses/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"\\\"Sales Tax\\\"\",
    \"description\": \"\\\"Sales tax\\\"\",
    \"taxRates\": [
        {
            \"name\": \"Sales Tax\",
            \"country\": \"United States\",
            \"state\": \"California\",
            \"zipCode\": [
                \"10001\",
                \"10002\",
                \"10003\"
            ],
            \"rate\": 0.2,
            \"appliedRateON\": \"specific_states\"
        }
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/taxClasses/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "\"Sales Tax\"",
    "description": "\"Sales tax\"",
    "taxRates": [
        {
            "name": "Sales Tax",
            "country": "United States",
            "state": "California",
            "zipCode": [
                "10001",
                "10002",
                "10003"
            ],
            "rate": 0.2,
            "appliedRateON": "specific_states"
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "success": true,
    "message": "Tax Class and Rates created successfully.",
    "tax_class_id": 1
}
 

Request   

POST api/settings/taxClasses/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

The name of the tax class. Example: "Sales Tax"

description   string  optional  

optional The description of the tax class. Example: "Sales tax"

taxRates   string[]  optional  

of objects required The tax rates associated with the tax class.

Delete a tax rate.

If a tax rate is associated with any order, it will not be deleted and the API will return a list of orders which use the tax rate.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/settings/taxRate/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_id\": 1
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/taxRate/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_id": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "status": "failed",
    "message": "Tax rate could not be deleted as it is associated with existing orders.",
    "notDeletedTaxRates": [
        {
            "order_id": 4501,
            "tax_rate_id": 1,
            "tax_rate_name": "US Standard Rate"
        },
        {
            "order_id": 4502,
            "tax_rate_id": 1,
            "tax_rate_name": "US Standard Rate"
        }
    ]
}
 

Request   

POST api/settings/taxRate/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_id   integer   

The ID of the tax rate to delete. Example: 1

Loads a tax class by its ID.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/getTaxClass/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 1
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/getTaxClass/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 1
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "name": "Standard",
    "description": "Default tax class for general products",
    "taxRates": [
        {
            "id": 101,
            "name": "US Standard Rate",
            "country": "US",
            "state": [
                "CA",
                "NY"
            ],
            "zipCode": [
                "90001",
                "10001"
            ],
            "rate": 7.25,
            "appliedRateON": "2025-01-01T00:00:00Z"
        },
        {
            "id": 102,
            "name": "US Reduced Rate",
            "country": "US",
            "state": [
                "TX"
            ],
            "zipCode": [
                "73301"
            ],
            "rate": 6.5,
            "appliedRateON": "2025-03-15T00:00:00Z"
        }
    ]
}
 

Request   

GET api/settings/getTaxClass/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   integer   

The ID of the tax class. Example: 1

Add a tax rate.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/settings/taxRate/add" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"tax_class_id\": 1,
    \"name\": \"\\\"Sales Tax\\\"\",
    \"country\": \"\\\"United States\\\"\",
    \"state\": [
        \"California\"
    ],
    \"zipCode\": [
        \"10001\",
        \"10002\",
        \"10003\"
    ],
    \"rate\": 0.2,
    \"appliedRateOn\": \"\\\"all_states\\\"\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/taxRate/add"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "tax_class_id": 1,
    "name": "\"Sales Tax\"",
    "country": "\"United States\"",
    "state": [
        "California"
    ],
    "zipCode": [
        "10001",
        "10002",
        "10003"
    ],
    "rate": 0.2,
    "appliedRateOn": "\"all_states\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
     "message": "Tax rate added successfully!",
}
 

Request   

POST api/settings/taxRate/add

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

tax_class_id   integer   

The ID of the tax class. Example: 1

name   string   

The name of the tax rate. Example: "Sales Tax"

country   string   

The country of the tax rate. Example: "United States"

state   string[]  optional  

of strings optional The state of the tax rate.

zipCode   string[]  optional  

of strings optional The zip codes of the tax rate.

rate   number   

The rate of the tax rate. Example: 0.2

appliedRateOn   string   

The rate on which the tax rate is applied. Example: "all_states"

Toggle Shipping Settings

Updates the shipping settings to enable or disable shipping based on the provided request parameter.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/ecommerce/toggleShippingSettings" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"enableShipping\": true
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/toggleShippingSettings"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "enableShipping": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated",
    "type": "success",
    "title": "Success"
}
 

Request   

PUT api/settings/ecommerce/toggleShippingSettings

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

enableShipping   boolean   

Whether to enable or disable shipping. Example: true

Set Shipping Setting

Updates the settings for shipping. Setting needs to be updated is mentioned in parameter. (See Parameter)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/settings/ecommerce/shipping" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"shippingDestination\": \"billing_address\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/shipping"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "shippingDestination": "billing_address"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Sales Tax Updated Successfully"
}
 

Request   

POST api/settings/ecommerce/shipping

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

shippingDestination   string   

Shipping destination of order. Example: billing_address

Retrieves the shipping settings.

Helps in fetching items of the shipping settings, like shipping destination and whether shipping is enabled or disabled.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/ecommerce/shipping" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/shipping"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "shippingDestination": "123 Main Street, Springfield, IL 62704, USA",
    "enableShipping": true
}
 

Request   

GET api/settings/ecommerce/shipping

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Get all shipping zones.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/ecommerce/shipping-zones" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-zones"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "name": "Shipping Zone 1",
            "country": "India",
            "state": [
                "Delhi",
                "Punjab"
            ],
            "zip_code": [
                "110000",
                "110001"
            ],
            "shippingMethods": "Flat Rate, Free Shipping",
            "shippingMethod": {
                "Flat Rate": {
                    "cost": 0,
                    "minAmountRequired": 0,
                    "taxStatus": "Taxable"
                },
                "Free Shipping": {
                    "cost": 0,
                    "minAmountRequired": 0,
                    "taxStatus": "Taxable"
                }
            }
        }
    ],
    "currency": "INR"
}
 

Request   

GET api/settings/ecommerce/shipping-zones

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieve Shipping Zone Methods

Fetches details of a specific shipping zone, including its name, country, state, zip code, applied zone criteria, and associated shipping methods.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/ecommerce/shipping-zones-methods/{id}?id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-zones-methods/{id}"
);

const params = {
    "id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "California",
    "country": "US",
    "state": [
        "CA"
    ],
    "zip_code": [
        "94000",
        "95000"
    ],
    "appliedZoneOn": "specific_states",
    "shippingMethods": [
        {
            "id": 1,
            "name": "Flat Rate Shipping",
            "isEnabled": true,
            "shippingMethod": "flat_rate",
            "taxStatus": "taxable",
            "cost": "10.00",
            "minAmountRequired": true,
            "minimumOrderAmount": 50
        }
    ]
}
 

Request   

GET api/settings/ecommerce/shipping-zones-methods/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   integer   

The ID of the shipping zone to retrieve. Example: 1

Creates a new shipping zone.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-zone" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"USA\",
    \"country\": \"US\",
    \"appliedZoneOn\": \"specific_states\",
    \"zip_code\": \"5600556, 5658666, 8474841\",
    \"state\": [
        \"AL\",
        \"AK\",
        \"AZ\",
        \"AR\",
        \"CA\"
    ],
    \"shippingMethod\": [
        {
            \"name\": \"Flat Rate\",
            \"isEnabled\": true,
            \"shippingMethod\": \"flat_rate\",
            \"taxStatus\": \"taxable\",
            \"cost\": 10.99,
            \"minAmountRequired\": 100,
            \"minimumOrderAmount\": 150
        }
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-zone"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "USA",
    "country": "US",
    "appliedZoneOn": "specific_states",
    "zip_code": "5600556, 5658666, 8474841",
    "state": [
        "AL",
        "AK",
        "AZ",
        "AR",
        "CA"
    ],
    "shippingMethod": [
        {
            "name": "Flat Rate",
            "isEnabled": true,
            "shippingMethod": "flat_rate",
            "taxStatus": "taxable",
            "cost": 10.99,
            "minAmountRequired": 100,
            "minimumOrderAmount": 150
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "success": true,
    "message": "Shipping Zone Created Successfully",
    "shippingZoneId": 1
}
 

Request   

POST api/settings/ecommerce/shipping-zone

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

The name of the shipping zone. Example: USA

country   string   

The country to associate the shipping zone with. Example: US

appliedZoneOn   string   

The type of shipping zone. Example: specific_states

zip_code   string   

The zip code(s) to associate with the shipping zone. Example: 5600556, 5658666, 8474841

state   string[]   

The state(s) to associate with the shipping zone.

shippingMethod   string[]   

The shipping method details.

Updates a shipping zone.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-zone/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 1,
    \"name\": \"US East Zone\",
    \"country\": \"US\",
    \"appliedZoneOn\": \"zip_code\",
    \"zip_code\": \"12345,67890\",
    \"state\": [
        \"NY\",
        \"NJ\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-zone/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 1,
    "name": "US East Zone",
    "country": "US",
    "appliedZoneOn": "zip_code",
    "zip_code": "12345,67890",
    "state": [
        "NY",
        "NJ"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Shipping Zone Updated Successfully"
}
 

Request   

PUT api/settings/ecommerce/shipping-zone/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   integer   

The ID of the shipping zone. Example: 1

name   string   

The name of the shipping zone. Example: US East Zone

country   string   

The country of the shipping zone. Example: US

appliedZoneOn   string   

The application scope of the zone, either 'zip_code', 'specific_states', or 'all_states'. Example: zip_code

zip_code   string  optional  

optional Comma-separated zip codes if the zone applies to zip codes. Example: 12345,67890

state   string[]  optional  

optional States if the zone applies to specific states.

Delete a shipping zone.

If the shipping zone is associated with one or more shipping methods, the method is not deleted and the response contains a list of orders that prevents the deletion.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-zone/delete/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 1
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-zone/delete/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "status": true,
    "message": "Shipping Zone deleted successfully",
    "notDeletedShippingZone": []
}
 

Request   

POST api/settings/ecommerce/shipping-zone/delete/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   integer   

The ID of the shipping method to delete. Example: 1

Delete a shipping method.

If the shipping method is associated with one or more orders, the method is not deleted and the response contains a list of orders that prevents the deletion.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-method/delete/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 1
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-method/delete/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "success": true,
    "message": "Shipping method deleted successfully",
    "notDeletedShippingMethod": []
}
 

Request   

POST api/settings/ecommerce/shipping-method/delete/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   integer   

The ID of the shipping method to delete. Example: 1

Creates a new shipping method.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-method/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Flat Rate\",
    \"shippingZoneId\": 1,
    \"taxStatus\": \"taxable\",
    \"cost\": 10.99,
    \"isEnabled\": true,
    \"shippingMethod\": \"Flat Rate\",
    \"minAmountRequired\": 100,
    \"minimumOrderAmount\": 100
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-method/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Flat Rate",
    "shippingZoneId": 1,
    "taxStatus": "taxable",
    "cost": 10.99,
    "isEnabled": true,
    "shippingMethod": "Flat Rate",
    "minAmountRequired": 100,
    "minimumOrderAmount": 100
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Shipping method added successfully!"
}
 

Request   

POST api/settings/ecommerce/shipping-method/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

The title of the shipping method. Example: Flat Rate

shippingZoneId   integer   

The ID of the shipping zone to associate the method with. Example: 1

taxStatus   string   

The tax status of the shipping method. Example: taxable

cost   number   

The cost of the shipping method. Example: 10.99

isEnabled   boolean   

Whether the shipping method should be enabled. Example: true

shippingMethod   string   

The type of shipping method. Example: Flat Rate

minAmountRequired   number   

The minimum amount required for free shipping. Example: 100

minimumOrderAmount   number   

The minimum amount required for free shipping. Example: 100

Updates a shipping method.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-method/update/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Flat Rate\",
    \"shippingZoneId\": 1,
    \"taxStatus\": \"taxable\",
    \"cost\": 10.99,
    \"isEnabled\": true,
    \"shippingMethod\": \"Flat Rate\",
    \"minAmountRequired\": 100,
    \"minimumOrderAmount\": 100
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-method/update/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Flat Rate",
    "shippingZoneId": 1,
    "taxStatus": "taxable",
    "cost": 10.99,
    "isEnabled": true,
    "shippingMethod": "Flat Rate",
    "minAmountRequired": 100,
    "minimumOrderAmount": 100
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Shipping method updated successfully!"
}
 

Request   

POST api/settings/ecommerce/shipping-method/update/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

The title of the shipping method. Example: Flat Rate

shippingZoneId   integer   

The ID of the shipping zone to associate the method with. Example: 1

taxStatus   string   

The tax status of the shipping method. Example: taxable

cost   number   

The cost of the shipping method. Example: 10.99

isEnabled   boolean   

Whether the shipping method should be enabled. Example: true

shippingMethod   string   

The type of shipping method. Example: Flat Rate

minAmountRequired   number   

The minimum amount required for free shipping. Example: 100

minimumOrderAmount   number   

The minimum amount required for free shipping. Example: 100

Update the status of a shipping method.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-method/update-status" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 1,
    \"isEnabled\": true
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/ecommerce/shipping-method/update-status"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 1,
    "isEnabled": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Shipping method status updated successfully"
}
 

Request   

POST api/settings/ecommerce/shipping-method/update-status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   integer   

The ID of the shipping method to update. Example: 1

isEnabled   boolean   

Whether the shipping method should be enabled. Example: true

ECommerce Orders

An ECommerce Order is made by the learners when they purchase a product hence course. It helps in managing orders and performing CRUD operation on orders.

Tabular List

Retrieves all the orders in a tabular list format with pagination mode. You can apply filter using search_param via status(order status), user(user email or id), dateRange(date range).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/orders/tabularlist?page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C%22direction%22%3A%22desc%22%7D&search_param=%7B%22status%22%3A%5B%22pending%22%5D%2C%22user%22%3A%5B%221%22%5D%2C%22dateRange%22%3A%5B%222020-01-01%22%2C%222020-01-31%22%5D%7D&portalId=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/orders/tabularlist"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at","direction":"desc"}",
    "search_param": "{"status":["pending"],"user":["1"],"dateRange":["2020-01-01","2020-01-31"]}",
    "portalId": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "status": "pending",
            "display_status": "Pending",
            "total": "100.00",
            "isTestOrder": false,
            "customer": "John Doe",
            "email": "[email protected]",
            "created_at": "Jan 01, 2020 12:00 AM",
            "isPortalOrder": false
        }
    ]
}
 

Request   

GET api/orders/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the orders you want for a page. Example: 10

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at","direction":"desc"}

search_param   string  optional  

For searching items based on status, user, date range. Example: {"status":["pending"],"user":["1"],"dateRange":["2020-01-01","2020-01-31"]}

portalId   integer  optional  

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Download the PDF invoice for a specific order.

This endpoint allows authorized users to download a PDF invoice for a given order.

The invoice includes billing/shipping information, tax breakdowns, product details, and more.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/download?orderId=1023" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/order/download"
);

const params = {
    "orderId": "1023",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Invoice downloaded successfully.",
    "file": "/downloads/order.pdf"
}
 

Request   

GET api/order/download

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

orderId   integer   

The ID of the order to download the invoice for. Example: 1023

Export Orders

Exports the order details based on the provided filters to an Excel file. The filters can include various criteria such as date range, user, product, etc. The generated file is downloaded as 'orders-test.xlsx'.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/export?filters=%7B%22dateRange%22%3A%5B%222020-07-31%22%2C%222020-08-30%22%5D%2C%22users%22%3A%5B3%5D%2C%22products%22%3A%5B1%5D%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/order/export"
);

const params = {
    "filters": "{"dateRange":["2020-07-31","2020-08-30"],"users":[3],"products":[1]}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


A downloadable Excel file containing the filtered order details.
 

Request   

GET api/order/export

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

filters   string   

JSON encoded filters to apply for exporting order details. Example: {"dateRange":["2020-07-31","2020-08-30"],"users":[3],"products":[1]}

Retrieve Yearly Sales

Retrieves the details of yearly based order sales made from students and returns in tabular form. You can use the response for plotting graphs

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/reports/yearsales?year=2020" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/order/reports/yearsales"
);

const params = {
    "year": "2020",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "labels": [
        "Jan",
        "Feb",
        "Mar",
        "Apr",
        "May",
        "Jun",
        "Jul",
        "Aug",
        "Sep",
        "Oct",
        "Nov",
        "Dec"
    ],
    "totalIncome": [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
    ],
    "totalOrders": [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
    ],
    "currency": {
        "display_name": "United States (US) dollar",
        "symbol": "&#36;"
    },
    "sumIncome": 0,
    "sumTotalOrder": 0
}
 

Request   

GET api/order/reports/yearsales

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

year   string   

Year for which you need sales information. Example: 2020

Retrieves the details of order sales for this month made from students and returns in tabular form.

You can use the response for plotting graphs

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/reports/monthlysales?selectedMonth=1-2020" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/order/reports/monthlysales"
);

const params = {
    "selectedMonth": "1-2020",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "labels": [
        "Jan-01",
        "Jan-02",
        "Jan-03",
        "Jan-04",
        "Jan-05",
        "Jan-06",
        "Jan-07",
        "Jan-08",
        "Jan-09",
        "Jan-10",
        "Jan-11",
        "Jan-12"
    ],
    "totalIncome": [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
    ],
    "totalOrders": [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0
    ],
    "currency": {
        "display_name": "United States (US) dollar",
        "symbol": "&#36;"
    },
    "sumIncome": 0,
    "sumTotalOrder": 0
}
 

Request   

GET api/order/reports/monthlysales

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

selectedMonth   string   

Month for which you need sales information(month_number-year). Example: 1-2020

Retrieve Product Breakdown Sales

Retrieves the details of product break-down based order sales for a given date range made from students and returns in tabular form. You can use the response for plotting graphs

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/reports/productbreakdown?selectedDateRange=2020-01-01-2020-01-31" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/order/reports/productbreakdown"
);

const params = {
    "selectedDateRange": "2020-01-01-2020-01-31",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "labels": [
        "Product-1",
        "Product-2"
    ],
    "totalIncome": [
        0,
        0
    ],
    "totalOrders": [
        0,
        0
    ],
    "currency": {
        "display_name": "United States (US) dollar",
        "symbol": "&#36;"
    },
    "sumIncome": 0,
    "sumTotalOrder": 0
}
 

Request   

GET api/order/reports/productbreakdown

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

selectedDateRange   string   

Date range for which you need sales information (start_date-end_date). Example: 2020-01-01-2020-01-31

Order Status Lookup

Retrieves all the possible statuses for an order, such as pending payment, completed, cancelled, refunded, failed, awaiting shipping, and shipped. This is useful for showing options in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/status/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/order/status/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "PENDING_PAYMENT",
        "display_value": "Payment Pending"
    },
    {
        "db_value": "COMPLETED",
        "display_value": "Completed"
    },
    {
        "db_value": "CANCELLED",
        "display_value": "Cancelled"
    },
    {
        "db_value": "REFUNDED",
        "display_value": "Refunded"
    },
    {
        "db_value": "FAILED",
        "display_value": "Failed"
    },
    {
        "db_value": "AWAITING_SHIPPING",
        "display_value": "Awaiting Shipping"
    },
    {
        "db_value": "SHIPPED",
        "display_value": "Shipped"
    }
]
 

Request   

GET api/order/status/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Delete Order

Deletes one or more orders based on the ids provided in the request.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/order/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_ids\": \"[1,2,3]\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/order/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_ids": "[1,2,3]"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "1 order(s) deleted."
}
 

Example response (500):


{
    "message": "Something went wrong"
}
 

Request   

POST api/order/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   required  optional  

The IDs of the orders to delete. Example: [1,2,3]

Create Order

Creates a new order. (See parameters) Orders can be used as purchasing products by students.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/order/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"orderDate\": \"2020-08-25 0:00:00\",
    \"status\": \"COMPLETED\",
    \"customerId\": 3,
    \"billingAddressId\": 3500,
    \"shippingAddressId\": 3500,
    \"orderItems\": [
        \"qui\"
    ],
    \"orderNotes\": [
        \"eum\"
    ],
    \"taxAmount\": \"null\",
    \"otherFee\": \"null\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/order/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "orderDate": "2020-08-25 0:00:00",
    "status": "COMPLETED",
    "customerId": 3,
    "billingAddressId": 3500,
    "shippingAddressId": 3500,
    "orderItems": [
        "qui"
    ],
    "orderNotes": [
        "eum"
    ],
    "taxAmount": "null",
    "otherFee": "null"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Order created successfully"
}
 

Request   

POST api/order/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

orderDate   date   

Ordering date. Example: 2020-08-25 0:00:00

status   string   

Different status for the orders like pending, completed, failed, etc. Status options: PENDING_PAYMENT, COMPLETED, CANCELLED, REFUNDED or FAILED. Example: COMPLETED

customerId   integer   

Ordered by this user Id. Example: 3

billingAddressId   integer  optional  

Billing address Id. Example: 3500

shippingAddressId   integer  optional  

Shipping address Id. Example: 3500

orderItems   string[]   

All added item for this order purchased together.

orderNotes   string[]  optional  

Notes either public or private while creating course(to remeber something, like normal note).

taxAmount   numeric  optional  

Tax amount. Example: null

otherFee   numeric  optional  

Other extra fees. Example: null

Retrieves the details of a specified order.

Helps in fetching order using its ID.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/{id}?id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/order/{id}"
);

const params = {
    "id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "orderDate": "2022-11-16 14:19:45",
    "status": "PENDING_PAYMENT",
    "display_status": "Pending Payment",
    "customerId": 1,
    "billingAddressId": 1,
    "shippingAddressId": 1,
    "taxAmount": 0,
    "otherFee": 0,
    "isTestOrder": false,
    "total": "10.00",
    "sub_total": "10.00",
    "currency": "USD",
    "shopAddress": "123 Main St, Anytown, CA 12345, USA",
    "billingAddress": {
        "id": 1,
        "first_name": "John",
        "last_name": "Doe",
        "company_name": "Company Name",
        "street_address": "123 Main St",
        "apartment_suite_number": "Apt 101",
        "city": "Anytown",
        "state": "CA",
        "zip": "12345",
        "country": "US"
    },
    "shippingAddress": {
        "id": 1,
        "first_name": "John",
        "last_name": "Doe",
        "company_name": "Company Name",
        "street_address": "123 Main St",
        "apartment_suite_number": "Apt 101",
        "city": "Anytown",
        "state": "CA",
        "zip": "12345",
        "country": "US"
    },
    "coupon_used": null,
    "paymentGatewayId": 1,
    "paymentGatewayEnabled": true,
    "companyName": null,
    "isShippingRequired": false,
    "thankYouUrl": "/thank-you",
    "shippingMethodId": 1,
    "shippingTax": 0,
    "shippingTaxRateId": null,
    "orderNotes": [],
    "orderItems": [
        {
            "product_id": 1,
            "product_title": "Product Title",
            "price": "10.00",
            "quantity": 1,
            "total": "10.00",
            "initialProductPrice": "10.00",
            "taxRateId": null,
            "tax": 0,
            "isShippingRequired": false,
            "saleTax": 0
        }
    ],
    "taxSettings": {
        "enable_tax": true,
        "tax_base": "base_price",
        "tax_rate": 0
    },
    "taxRates": [
        {
            "taxRateId": 1,
            "taxRateName": "Tax Rate Name",
            "totalTax": "0.00"
        }
    ],
    "totalTax": "0.00"
}
 

Request   

GET api/order/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

Order Id. Example: 1

Update an order's details.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/order/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": \"dicta\",
    \"orderDate\": \"maxime\",
    \"status\": \"rerum\",
    \"customerId\": \"nemo\",
    \"billingAddressId\": 1,
    \"shippingAddressId\": 2,
    \"orderItems\": [
        \"asperiores\"
    ],
    \"taxAmount\": \"et\",
    \"otherFee\": \"mollitia\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/order/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": "dicta",
    "orderDate": "maxime",
    "status": "rerum",
    "customerId": "nemo",
    "billingAddressId": 1,
    "shippingAddressId": 2,
    "orderItems": [
        "asperiores"
    ],
    "taxAmount": "et",
    "otherFee": "mollitia"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Order updated successfully"
}
 

Request   

PUT api/order/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   required  optional  

integer The ID of the order to update. Example: dicta

orderDate   required  optional  

date The date of the order. Example: maxime

status   required  optional  

string The status of the order. One of [PENDING_PAYMENT, COMPLETED, CANCELLED, REFUNDED, FAILED, AWAITING_SHIPPING, SHIPPED]. Example: rerum

customerId   required  optional  

integer The ID of the customer who placed the order. Example: nemo

billingAddressId   integer  optional  

The ID of the billing address for the order. Example: 1

shippingAddressId   integer  optional  

The ID of the shipping address for the order. Example: 2

orderItems   string[]  optional  

The items in the order.

taxAmount   string  optional  

The tax amount for the order. Example: et

otherFee   string  optional  

The other fee for the order. Example: mollitia

Update Order Status

To update the status of an existing order

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/order/3/status" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"status\": \"sequi\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/order/3/status"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "status": "sequi"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Order updated successfully"
}
 

Request   

PUT api/order/{id}/status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

Order ID. Example: 3

Body Parameters

status   required  optional  

New status of the order. Status options: PENDING_PAYMENT, COMPLETED, CANCELLED, REFUNDED, FAILED Example: sequi

Create Order Note

To create a order note, you need to use this request. Returns all order notes left after this note gets created. (See Response)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/order-note/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"data\": \"New notes\",
    \"type\": \"PRIVATE\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/order-note/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "data": "New notes",
    "type": "PRIVATE"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "data": "note-1",
        "type": "PRIVATE",
        "created_on": "Aug 11, 2020 05:36 PM"
    }
]
 

Request   

POST api/order-note/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

orderId   string   

Order ID. Example: 3

Body Parameters

data   required  optional  

Note content. Example: New notes

type   required  optional  

Note type. Example: PRIVATE

Delete Order Note

Deletes an order note specified by its ID. After deletion, returns all remaining order notes for the associated order.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/order-note/delete/2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/order-note/delete/2"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "data": "note-1",
        "type": "PRIVATE",
        "created_on": "Aug 11, 2020 05:36 PM"
    }
]
 

Request   

PUT api/order-note/delete/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the order note to be deleted. Example: 2

Refund Options Lookup

Provides the available refund options for an order, such as full refund or partial refund. This is useful for displaying choices in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/refund/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/order/refund/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "FULL_REFUND",
        "display_value": "Refund 100%"
    },
    {
        "db_value": "PARTIAL_REFUND",
        "display_value": "Refund Partially"
    }
]
 

Request   

GET api/order/refund/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Order Note Type Lookup

Provides the available note types for an order, such as private or public. This is useful for displaying choices in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/note/type/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/order/note/type/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "PRIVATE",
        "display_value": "Don’t show to Customer"
    },
    {
        "db_value": "PUBLIC",
        "display_value": "Show to customer"
    }
]
 

Request   

GET api/order/note/type/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Refund Types Lookup

Provides the available refund types for an order, such as stripe, braintree, authorize.net and manual. This is useful for displaying choices in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/refund/type/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/order/refund/type/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "STRIPE_PAYMENT_GATEWAY",
        "display_value": "Stripe Payment Gateway"
    },
    {
        "db_value": "BRAINTREE_PAYMENT_GATEWAY",
        "display_value": "Braintree Payment Gateway"
    },
    {
        "db_value": "AUTHORIZENET_PAYMENT_GATEWAY",
        "display_value": "AuthorizeNet Payment Gateway"
    },
    {
        "db_value": "MANUALLY",
        "display_value": "Manually"
    }
]
 

Request   

GET api/order/refund/type/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Refund an order

This function will allow you to process a refund of an order. The refund amount, refund reason, and refund type must be provided. The refund type can be either FULL_REFUND or PARTIAL_REFUND. The refund amount is required if the refund type is PARTIAL_REFUND, and the refund amount must be greater than 0.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/order/refund" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 123,
    \"refundedVia\": \"MANUALLY\",
    \"refundType\": \"FULL_REFUND\",
    \"refundAmount\": \"50.00\",
    \"refundReason\": \"\\\"Product not as described\\\"\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/order/refund"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 123,
    "refundedVia": "MANUALLY",
    "refundType": "FULL_REFUND",
    "refundAmount": "50.00",
    "refundReason": "\"Product not as described\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "success": true,
    "message": "Order Refunded Successfully."
}
 

Request   

POST api/order/refund

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   integer   

The ID of the order to be refunded. Example: 123

refundedVia   string   

The method used to process the refund. Options: MANUALLY, STRIPE. Example: MANUALLY

refundType   string   

The type of refund being issued. Options: FULL_REFUND, PARTIAL_REFUND. Example: FULL_REFUND

refundAmount   numeric   

The amount to refund. This parameter is required only if refundType is PARTIAL_REFUND. Example: 50.00

refundReason   string   

The reason for issuing the refund. Example: "Product not as described"

Get all the refund orders for the given order id

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/refund/harum" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/order/refund/harum"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "refundedVia": "MANUALLY",
    "displayRefundedVia": "Manually",
    "refundAmount": 100,
    "refundReason": "Product not delivered",
    "refundStatus": "COMPLETED",
    "refundType": "FULL_REFUND",
    "refundDatePaid": "2020-01-01"
}
 

Request   

GET api/order/refund/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the order Example: harum

ECommerce Payments

Endpoints for managing ecommerce Payment Gateways. Payment gateways will be used when your users are purchasing products.

Get All Payment Gateways

Returns all Payment Gateways.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/payment-gateway" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/payment-gateway"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "records": [
        {
            "id": 1,
            "name": "Stripe",
            "logo_url": "https://www.paypalobjects.com/webstatic/en_US/i/logo/pp-logo-100x50.png",
            "is_enabled": true,
            "support_recurring_payments": true
        }
    ]
}
 

Request   

GET api/settings/payment-gateway

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update Status of Payment Gateway

Updates the status of the specified payment gateway.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/paymentmethod/updateStatus" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 1,
    \"status\": true
}"
const url = new URL(
    "https://demo.aomlms.com/api/paymentmethod/updateStatus"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 1,
    "status": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated"
}
 

Request   

PUT api/paymentmethod/updateStatus

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   integer   

The id of the payment gateway to be updated. Example: 1

status   boolean   

The status of the payment gateway. Example: true

Update Stripe Settings

Updates the settings for Stripe payment gateway. Setting needs to be updated is mentioned in parameter. (See Parameter)

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/stripe" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"gatewayEnabled\": true,
    \"paymentTitle\": \"Pay by Credit or Debit Card\",
    \"publishableKey\": \"expedita\",
    \"secretKey\": \"maiores\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/stripe"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "gatewayEnabled": true,
    "paymentTitle": "Pay by Credit or Debit Card",
    "publishableKey": "expedita",
    "secretKey": "maiores"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated"
}
 

Request   

PUT api/settings/stripe

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

gatewayEnabled   boolean   

Enable status of stripe gateway. Example: true

paymentTitle   string  optional  

Payment title for the payments. Example: Pay by Credit or Debit Card

publishableKey   string  optional  

Publishable key value. Example: Example: expedita

secretKey   string  optional  

Secret key value. Example: Example: maiores

Retrieve Stripe Settings

Retrieves all the settings for Stripe payment gateway. Helps in maintaining the data and enable status of the Stripe settings.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/stripe" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/stripe"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "gatewayEnabled": false,
    "paymentTitle": "Pay by Credit or Debit Card",
    "publishableKey": "",
    "secretKey": "",
    "production_mode": "no"
}
 

Request   

GET api/settings/stripe

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update AuthorizeNet Settings

Updates the settings for AuthorizeNet payment gateway. Setting needs to be updated is mentioned in parameter. (See Parameter)

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/authorizenet" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"gatewayEnabled\": true,
    \"paymentTitle\": \"Pay via Authorize.NET\",
    \"loginId\": \"quasi\",
    \"transactionKey\": \"adipisci\",
    \"clientId\": \"assumenda\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/authorizenet"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "gatewayEnabled": true,
    "paymentTitle": "Pay via Authorize.NET",
    "loginId": "quasi",
    "transactionKey": "adipisci",
    "clientId": "assumenda"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated"
}
 

Request   

PUT api/settings/authorizenet

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

gatewayEnabled   boolean   

Enable status of AuthorizeNet gateway. Example: true

paymentTitle   string  optional  

Payment title for the payments. Example: Pay via Authorize.NET

loginId   string  optional  

Login Id from AuthorizeNet. Example: Example: quasi

transactionKey   string  optional  

Transaction key value. Example: Example: adipisci

clientId   string  optional  

Client Id from AuthorizeNet. Example: Example: assumenda

Retrieve AuthorizeNet Settings

Retrieves all the settings for AuthorizeNet payment gateway. Helps in mainting the data and enable status of the AuthorizeNet settings.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/authorizenet" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/authorizenet"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "gatewayEnabled": false,
    "paymentTitle": "Pay via Authorize.NET",
    "loginId": "commodi",
    "transactionKey": "nihil",
    "clientId": "commodi",
    "production_mode": "yes"
}
 

Request   

GET api/settings/authorizenet

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update Braintree Settings

Updates the settings for Braintree payment gateway based on the provided request parameters. The settings include enabling the gateway, setting the payment title, and updating merchant credentials for either live or test mode depending on the production mode status.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/braintree" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"gatewayEnabled\": true,
    \"paymentTitle\": \"Pay by Credit or Debit Card\",
    \"merchantId\": \"your_merchant_id\",
    \"publicKey\": \"your_public_key\",
    \"privateKey\": \"your_private_key\",
    \"authorizationKey\": \"your_authorization_key\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/braintree"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "gatewayEnabled": true,
    "paymentTitle": "Pay by Credit or Debit Card",
    "merchantId": "your_merchant_id",
    "publicKey": "your_public_key",
    "privateKey": "your_private_key",
    "authorizationKey": "your_authorization_key"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated"
}
 

Request   

PUT api/settings/braintree

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

gatewayEnabled   boolean   

Enable status of Braintree gateway. Example: true

paymentTitle   string  optional  

Payment title for the payments. Example: Pay by Credit or Debit Card

merchantId   string  optional  

Merchant Id value. Example: your_merchant_id

publicKey   string  optional  

Public Key value. Example: your_public_key

privateKey   string  optional  

Private key value. Example: your_private_key

authorizationKey   string  optional  

Authorization key value. Example: your_authorization_key

Retrieves all the settings for Braintree payment gateway. Helps in mainting the data and enable status of the Braintree settings.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/braintree" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/braintree"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "gatewayEnabled": false,
    "paymentTitle": "Pay by Credit or Debit Card",
    "merchantId": "",
    "publicKey": "",
    "privateKey": "",
    "authorizationKey": "",
    "production_mode": "yes"
}
 

Request   

GET api/settings/braintree

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieve Paypal Settings

Retrieves all the settings for Paypal payment gateway. Helps in mainting the data and enable status of the Paypal settings.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/paypal" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/paypal"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "gatewayEnabled": false,
    "paymentTitle": "Paypal",
    "clientId": "",
    "notificationUrl": "https://staging.aomlms.com/api/webhook/paypal",
    "production_mode": "yes"
}
 

Request   

GET api/settings/paypal

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update Paypal Settings

Updates the settings for Paypal payment gateway based on the provided request parameters. The settings include enabling the gateway, setting the payment title, and updating client credentials for either live or test mode depending on the production mode status.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/paypal" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"gatewayEnabled\": true,
    \"paymentTitle\": \"Pay by Credit or Debit Card\",
    \"clientId\": \"your_client_id\",
    \"secretKey\": \"your_secret_key\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/paypal"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "gatewayEnabled": true,
    "paymentTitle": "Pay by Credit or Debit Card",
    "clientId": "your_client_id",
    "secretKey": "your_secret_key"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated"
}
 

Request   

PUT api/settings/paypal

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

gatewayEnabled   boolean   

Enable status of Braintree gateway. Example: true

paymentTitle   string  optional  

Payment title for the payments. Example: Pay by Credit or Debit Card

clientId   string  optional  

Client Id value. Example: your_client_id

secretKey   string  optional  

Secret key value. Example: your_secret_key

Update Invoice Settings

Updates the settings for Invoice payment gateway. Setting needs to be updated is mentioned in parameter. (See Parameter)

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/invoice" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"gatewayEnabled\": true,
    \"paymentTitle\": \"Pay by Invoice\",
    \"paymentInstructions\": \"Instructions for payment\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/invoice"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "gatewayEnabled": true,
    "paymentTitle": "Pay by Invoice",
    "paymentInstructions": "Instructions for payment"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated"
}
 

Request   

PUT api/settings/invoice

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

gatewayEnabled   boolean   

Enable status of Invoice gateway. Example: true

paymentTitle   string  optional  

Payment title for the payments. Example: Pay by Invoice

paymentInstructions   string  optional  

Payment instructions for the payments. Example: Instructions for payment

Retrieve Invoice Settings

Retrieves all the settings for the Invoice payment gateway. This includes the enable status, payment title, and payment instructions. Useful for maintaining and displaying the current configuration of the Invoice gateway.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/invoice" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/invoice"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "gatewayEnabled": false,
    "paymentTitle": "Pay by Invoice",
    "paymentInstructions": "Instructions for payment"
}
 

Request   

GET api/settings/invoice

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update Cashnet Settings

Updates the settings for Cashnet payment gateway. Setting needs to be updated is mentioned in parameter. (See Parameter)

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/cashnet" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"gatewayEnabled\": true,
    \"paymentTitle\": \"Pay by Credit or Debit Card\",
    \"merchantId\": \"explicabo\",
    \"apiKey\": \"quo\",
    \"apiEnvUrl\": \"https:\\/\\/api.sandbox.cashnet.com\\/api\\/v1\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/cashnet"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "gatewayEnabled": true,
    "paymentTitle": "Pay by Credit or Debit Card",
    "merchantId": "explicabo",
    "apiKey": "quo",
    "apiEnvUrl": "https:\/\/api.sandbox.cashnet.com\/api\/v1"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated"
}
 

Request   

PUT api/settings/cashnet

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

gatewayEnabled   boolean   

Enable status of Cashnet gateway. Example: true

paymentTitle   string  optional  

Payment title for the payments. Example: Pay by Credit or Debit Card

merchantId   string  optional  

Merchant Id value. Example: Example: explicabo

apiKey   string  optional  

API Key value. Example: Example: quo

apiEnvUrl   string  optional  

API Environment URL value. Example: https://api.sandbox.cashnet.com/api/v1

Retrieve Cashnet Settings

Retrieves all the settings for Cashnet payment gateway. This includes the enable status, payment title, merchant id, api key, api environment url and production mode status. Useful for maintaining and displaying the current configuration of the Cashnet gateway.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/cashnet" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/cashnet"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "gatewayEnabled": false,
    "paymentTitle": "Pay by Credit or Debit Card",
    "merchantId": "your_merchant_code",
    "apiKey": "your_api_key",
    "apiEnvUrl": "https://api.sandbox.cashnet.com/api/v1",
    "production_mode": "yes"
}
 

Request   

GET api/settings/cashnet

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

ECommerce Products

A Product will be reached to your learners. Course has to be attached to products so that learners can purchase your courses. Helps in performing CRUD operations for and to products.

Retrieve Product Catalog

Retrieves the details for the product catalogs in paginated form to show this to students as course catalog so that they can purchase the product hence course.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/products/catalog?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22title%22%3A%22%22%2C+%22ids%22%3A%22%22%2C+%22selectedPrice%22%3A%5B%22Paid%22%2C+%22Free%22%5D%2C+%22selectedProductCategories%22%3A%5B%5D%2C+%22selectedCourseType%22%3A%5B%5D%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/products/catalog"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"title":"", "ids":"", "selectedPrice":["Paid", "Free"], "selectedProductCategories":[], "selectedCourseType":[]}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "title": "Product-1",
            "slug": "product-1",
            "featuredImage": "https://example.com/product-1.jpg",
            "displayPrice": 3000,
            "status": "IN-STOCK",
            "label": "SIMPLE",
            "display_label": "Simple",
            "canBePurchased": true,
            "seo_description": "This is the description of product 1.",
            "price": 3000,
            "type": "SIMPLE",
            "price_frequency": "MONTHLY",
            "webinarsCount": 1,
            "modulesCount": 2,
            "averageRating": 4.5
        }
    ]
}
 

Request   

GET api/products/catalog

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The amount of records to return per page. Example: 50

page_number   string   

The page number of the records to return. Example: 1

order_by   string   

The order by parameters. Example: {"colName":"created_at", "direction": "desc"}

search_param   string   

The search parameters. Example: {"title":"", "ids":"", "selectedPrice":["Paid", "Free"], "selectedProductCategories":[], "selectedCourseType":[]}

Retrieves the product details.

Fetches the product details, including the title, slug, description, featured image url, regular price, sale price, status, expiry date, dynamic pricing, SEO title, SEO description, display price, can be purchased, label, display label, subscription price, price frequency, free trial value, free trial frequency, subscription expire after, membership id, content access type, catalog rank, global product setting color, sale tax, tax class id, average rating, min purchase quantity, webinars count, modules count, dynamic prices, categories, related products, courses, course categories, instructor led course, learning paths, learning path categories, category courses and category learning paths.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/product/{id}?id=provident" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/product/{id}"
);

const params = {
    "id": "provident",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "title": "Product-1",
    "slug": "product-1",
    "description": "This is the description of product 1.",
    "featuredImageUrl": "https://example.com/product-1.jpg",
    "regular_price": 3500,
    "type": "SIMPLE",
    "sale_price": 3000,
    "saleStartDate": "2021-01-01 12:00:00",
    "saleEndDate": "2021-01-15 12:00:00",
    "status": "IN-STOCK",
    "expiry_date": "2021-01-31 12:00:00",
    "dynamic_pricing": true,
    "seo_title": "Product-1",
    "seo_description": "This is the description of product 1.",
    "displayPrice": 3000,
    "canBePurchased": true,
    "label": "SIMPLE",
    "display_label": "Simple",
    "subscription_price": 3000,
    "price_frequency": "MONTHLY",
    "free_trial_value": 1,
    "free_trial_frequency": "MONTHLY",
    "subscription_expire_after": "2021-01-31 12:00:00",
    "membership_id": 1,
    "contentAccessType": "PHYSICAL",
    "catalog_rank": 1,
    "globalProductSettingColor": {
        "product_price_color": {
            "backgroundColor": "#fff"
        }
    },
    "saleTax": 0,
    "taxClassId": 1,
    "averageRating": 4.5,
    "minPurchaseQuantity": 1,
    "webinarsCount": 1,
    "modulesCount": 2,
    "dynamicPrices": [
        {
            "minQty": 1,
            "maxQty": 10,
            "perPrice": 3000
        }
    ],
    "categories": [
        1,
        2
    ],
    "relatedProducts": [
        1,
        2
    ],
    "courses": [
        {
            "value": 1,
            "label": "Course-1"
        },
        {
            "value": 2,
            "label": "Course-2"
        }
    ],
    "courseCategories": [
        1,
        2
    ],
    "instructorLedCourse": [
        {
            "value": 1,
            "label": "Instructor Led Course-1"
        }
    ],
    "learningPaths": [
        {
            "value": 1,
            "label": "Learning Path-1",
            "learningPathCourses": [
                {
                    "id": 1,
                    "name": "Course-1"
                },
                {
                    "id": 2,
                    "name": "Course-2"
                }
            ]
        }
    ],
    "categoryCourses": [
        {
            "value": 3,
            "label": "Course-3"
        }
    ],
    "categoryLearningPaths": [
        {
            "value": 2,
            "label": "Learning Path-2",
            "learningPathCourses": [
                {
                    "id": 3,
                    "name": "Course-3"
                },
                {
                    "id": 4,
                    "name": "Course-4"
                }
            ]
        }
    ]
}
 

Request   

GET api/product/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

The ID of the product to retrieve. Example: provident

Get webinars for a product

Returns all webinars associated with the courses related to the product with the given ID. Optionally accepts a search parameter which can be used to filter the results by date range and location.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/products/webinars?product_id=reprehenderit&search_param=cum" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/products/webinars"
);

const params = {
    "product_id": "reprehenderit",
    "search_param": "cum",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "Course Name 1": [
        {
            "id": 1,
            "startDate": "2020-01-01",
            "endDate": "2020-01-01",
            "startTime": "09:00:00",
            "endTime": "17:00:00",
            "location_id": 1,
            "location": "Location 1"
        },
        {
            "id": 2,
            "startDate": "2020-01-15",
            "endDate": "2020-01-15",
            "startTime": "09:00:00",
            "endTime": "17:00:00",
            "location_id": 2,
            "location": "Location 2"
        }
    ],
    "Course Name 2": []
}
 

Request   

GET api/products/webinars

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

product_id   string   

The ID of the product. Example: reprehenderit

search_param   string  optional  

optional A JSON object with two properties: 'dates' and 'location'. 'dates' should be an array of two dates in the format 'Y-m-d'. 'location' should be the ID of a location. Example: cum

Search Products

Retrieves the products with the search_term in the product name or in the name of the courses or learning paths associated with the product. Returns the products in a select list format. Helps while showing products names in form elements like dropdown. You can apply filters using search_term parameter. (See Response)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/get-search-product?search_term=totam" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/get-search-product"
);

const params = {
    "search_term": "totam",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Product-1",
        "value": "/product/product-1"
    },
    {
        "id": 2,
        "name": "Product-2",
        "value": "/product/product-2"
    }
]
 

Request   

POST api/get-search-product

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

search_term   string   

The name or substring of the product name to search for that product. Example: totam

Retrieve All Products

Retrieves all the products that exists in the system. Helps in fetching all the products.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/products?excludeId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/products"
);

const params = {
    "excludeId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[{"id":1,"title":"Product 1","slug":"product-1","description":"Course 1 product","featured_image_url":null,"regular_price":3500,"sale_price":3001,"sale_price_from":null,"sale_price_to":null,"status":"IN-STOCK","type":"SIMPLE","price_frequency":null,"site-wide-membership":null,"expired_at":"2020-10-29 00:00:00","price_includes_tax":false,"tax_rate_based_on":"CUSTOMER-BILLING-ADDR","seo_title":null,"seo_description":null,"created_by":1,"updated_by":null,"deleted_by":null,"created_at":"2020-08-11 14:12:27","updated_at":"2020-08-11 14:12:27","deleted_at":null},...]
 

Request   

GET api/products

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

excludeId   string  optional  

optional ID of the product you want to exclude from the records. Example: 1

Product Type Lookup

Retrieves the types of the product that the platform offers. Helps showing options in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/product/type/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/product/type/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "SIMPLE",
        "display_value": "Simple"
    },
    {
        "db_value": "SUBSCRIPTION",
        "display_value": "Subscription"
    }
]
 

Request   

GET api/product/type/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update Slug

Updates the slug of the product identified by 'id' with the new slug provided. The new slug is checked for uniqueness and if it already exists, a new slug is generated by appending a counter to the slug. The updated slug is then saved to the product. Returns the updated slug.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/products/update-slug/3?slug=%22about-us%22" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/products/update-slug/3"
);

const params = {
    "slug": ""about-us"",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


"about-us-1"
 

Request   

PUT api/products/update-slug/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the product to be updated. Example: 3

Query Parameters

slug   string   

The new slug of the product. Example: "about-us"

Product Status Lookup

Retrieves the statuses for a product the platform offers. Helps showing options in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/product/status/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/product/status/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "COMING-SOON",
        "display_value": "Coming Soon"
    },
    {
        "db_value": "IN-STOCK",
        "display_value": "In Stock"
    },
    {
        "db_value": "OUT-OF-STOCK",
        "display_value": "Out of Stock"
    }
]
 

Request   

GET api/product/status/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Tabular List

Retrieves all the products in a tabular list format in paginated mode. You can apply filter using search_param via title, productStatus(in-stock, out-of-stock, etc) and productCategoryIds.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/products/tabularlist?page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22title%22%3A+%22%22%2C+%22productStatus%22%3A+%5B%22IN-STOCK%22%5D%2C+%22productCategoryIds%22%3A+%5B%5D%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/products/tabularlist"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"title": "", "productStatus": ["IN-STOCK"], "productCategoryIds": []}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "title": "Product 1",
            "regular_price": 3500,
            "type": "SIMPLE",
            "status": "IN-STOCK",
            "created_at": "2021-01-01 12:00:00",
            "catalog_rank": 1
        }
    ]
}
 

Request   

GET api/products/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 10

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

for searching items based on field names. Example: {"title": "", "productStatus": ["IN-STOCK"], "productCategoryIds": []}

Product Lookup

Retrieves all the products in a select list format. Helps while showing products names in form elements like dropdown. You can apply filters using search_term parameter. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/products/lookup?search_term=molestiae" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/products/lookup"
);

const params = {
    "search_term": "molestiae",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "title": "Product-1",
        "isShippingRequired": true
    },
    {
        "id": 2,
        "title": "Product-2",
        "isShippingRequired": false
    }
]
 

Request   

GET api/products/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

search_term   string   

The name or substring of the product name to search for that product. Example: molestiae

Create a new product.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/product/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"title\": \"Product-1\",
    \"description\": \"Course 1 product\",
    \"featuredImageUrl\": \"https:\\/\\/www.aom-images.com\\/product.jpeg\",
    \"regular_price\": \"3500\",
    \"type\": \"SIMPLE\",
    \"sale_price\": \"3001\",
    \"saleStartDate\": \"2020-12-01 0:00:00\",
    \"saleEndDate\": \"2020-12-31 0:00:00\",
    \"status\": \"IN-STOCK\",
    \"expiry\": \"2020-10-29 0:00:00\",
    \"categories\": [],
    \"courses\": [
        \"aspernatur\"
    ],
    \"courseCategories\": [],
    \"learningPaths\": [
        \"omnis\"
    ],
    \"learningPathCategories\": [],
    \"membership_id\": 1,
    \"seo_title\": \"awesome-product\",
    \"seo_description\": \"includes many good courses\",
    \"subscription_price\": \"3500\",
    \"price_frequency\": \"WEEKLY\",
    \"free_trial_value\": \"5\",
    \"free_trial_frequency\": \"aut\",
    \"subscription_expire_after\": \"5\",
    \"dynamic_pricing\": true,
    \"taxClassId\": 1,
    \"minPurchaseQuantity\": \"2\",
    \"catalog_rank\": \"1\",
    \"saleTax\": \"taxable\",
    \"shippingClass\": 1
}"
const url = new URL(
    "https://demo.aomlms.com/api/product/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "title": "Product-1",
    "description": "Course 1 product",
    "featuredImageUrl": "https:\/\/www.aom-images.com\/product.jpeg",
    "regular_price": "3500",
    "type": "SIMPLE",
    "sale_price": "3001",
    "saleStartDate": "2020-12-01 0:00:00",
    "saleEndDate": "2020-12-31 0:00:00",
    "status": "IN-STOCK",
    "expiry": "2020-10-29 0:00:00",
    "categories": [],
    "courses": [
        "aspernatur"
    ],
    "courseCategories": [],
    "learningPaths": [
        "omnis"
    ],
    "learningPathCategories": [],
    "membership_id": 1,
    "seo_title": "awesome-product",
    "seo_description": "includes many good courses",
    "subscription_price": "3500",
    "price_frequency": "WEEKLY",
    "free_trial_value": "5",
    "free_trial_frequency": "aut",
    "subscription_expire_after": "5",
    "dynamic_pricing": true,
    "taxClassId": 1,
    "minPurchaseQuantity": "2",
    "catalog_rank": "1",
    "saleTax": "taxable",
    "shippingClass": 1
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "message": "Product created successfully"
}
 

Request   

POST api/product/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

title   required  optional  

The title of the product. Example: Product-1

description   required  optional  

The description of the product. Example: Course 1 product

featuredImageUrl   string  optional  

The featured image of the product. Example: https://www.aom-images.com/product.jpeg

regular_price   numeric   

The regular price of the product. Example: 3500

type   string   

The type of the product. Type options: SIMPLE, DOWNLOADABLE or SUBSCRIPTION. Example: SIMPLE

sale_price   numeric  optional  

The sale price of the product. Example: 3001

saleStartDate   date  optional  

The sale start date of the product. Example: 2020-12-01 0:00:00

saleEndDate   date  optional  

The sale end date of the product. Example: 2020-12-31 0:00:00

status   string   

The status of the product. Status options: COMING-SOON, IN-STOCK or OUT-OF-STOCK. Example: IN-STOCK

expiry   date  optional  

The expiry date of the product. Example: 2020-10-29 0:00:00

categories   string[]  optional  

The categories of the product.

courses   string[]  optional  

The courses of the product.

courseCategories   string[]  optional  

The course categories of the product.

learningPaths   string[]  optional  

The learning paths of the product.

learningPathCategories   string[]  optional  

The learning path categories of the product.

membership_id   integer  optional  

The membership id of the product. Example: 1

seo_title   string  optional  

The seo title of the product. Example: awesome-product

seo_description   string  optional  

The seo description of the product. Example: includes many good courses

subscription_price   numeric   

The subscription price of the product for the product type Subscription. Example: 3500

price_frequency   string   

The price frequency to be charged for Subscription product. Price Frequency Options: DAILY, WEEKLY, MONTHLY or YEARLY. Example: WEEKLY

free_trial_value   numeric  optional  

The free trail for the Subscription product. Example: 5

free_trial_frequency   string  optional  

The free trail frequency for the subscription product in which the product will be available for free. Free Trail Frequency Options: DAYS, WEEKS, MONTHS, YEARS. Example: aut

subscription_expire_after   numeric  optional  

The subscription expire after for the Subscription product. Example: 5

dynamic_pricing   boolean  optional  

The dynamic pricing for the product. Example: true

taxClassId   integer  optional  

The tax class id of the product. Example: 1

minPurchaseQuantity   numeric  optional  

The minimum purchase quantity of the product. Example: 2

catalog_rank   numeric  optional  

The catalog rank of the product. Example: 1

saleTax   string  optional  

The sale tax of the product. Example: taxable

shippingClass   integer  optional  

The shipping class of the product. Example: 1

Update an existing product.

requires authentication

This endpoint allows updating a product's details, including its pricing, categories, related products, courses, and other properties. It supports dynamic pricing and validation for product data such as description, sale prices, SEO, and tax settings.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/product/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 1,
    \"title\": \"\\\"New Course Title\\\"\",
    \"description\": \"\\\"A detailed description of the course.\\\"\",
    \"featuredImageUrl\": \"\\\"https:\\/\\/example.com\\/image.jpg\\\"\",
    \"regular_price\": \"100.00\",
    \"sale_price\": \"80.00\",
    \"saleStartDate\": \"\\\"2025-04-01 00:00:00\\\"\",
    \"saleEndDate\": \"\\\"2025-04-10 00:00:00\\\"\",
    \"status\": \"\\\"IN-STOCK\\\"\",
    \"type\": \"\\\"SIMPLE\\\"\",
    \"categories\": [
        1,
        2,
        3
    ],
    \"courses\": [
        {
            \"value\": 1
        },
        {
            \"value\": 2
        }
    ],
    \"relatedProducts\": [
        101,
        102
    ],
    \"dynamic_pricing\": true,
    \"dynamicPrices\": [
        {
            \"minQty\": 1,
            \"perPrice\": 90
        }
    ],
    \"seo_title\": \"\\\"Product SEO Title\\\"\",
    \"seo_description\": \"\\\"This is a detailed product description for SEO.\\\"\",
    \"membership_id\": 10,
    \"subscription_price\": \"20.00\",
    \"price_frequency\": \"\\\"MONTHLY\\\"\",
    \"free_trial_value\": \"7\",
    \"free_trial_frequency\": \"\\\"DAYS\\\"\",
    \"minPurchaseQuantity\": \"1\",
    \"saleTax\": \"\\\"10%\\\"\",
    \"taxClassId\": 1
}"
const url = new URL(
    "https://demo.aomlms.com/api/product/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 1,
    "title": "\"New Course Title\"",
    "description": "\"A detailed description of the course.\"",
    "featuredImageUrl": "\"https:\/\/example.com\/image.jpg\"",
    "regular_price": "100.00",
    "sale_price": "80.00",
    "saleStartDate": "\"2025-04-01 00:00:00\"",
    "saleEndDate": "\"2025-04-10 00:00:00\"",
    "status": "\"IN-STOCK\"",
    "type": "\"SIMPLE\"",
    "categories": [
        1,
        2,
        3
    ],
    "courses": [
        {
            "value": 1
        },
        {
            "value": 2
        }
    ],
    "relatedProducts": [
        101,
        102
    ],
    "dynamic_pricing": true,
    "dynamicPrices": [
        {
            "minQty": 1,
            "perPrice": 90
        }
    ],
    "seo_title": "\"Product SEO Title\"",
    "seo_description": "\"This is a detailed product description for SEO.\"",
    "membership_id": 10,
    "subscription_price": "20.00",
    "price_frequency": "\"MONTHLY\"",
    "free_trial_value": "7",
    "free_trial_frequency": "\"DAYS\"",
    "minPurchaseQuantity": "1",
    "saleTax": "\"10%\"",
    "taxClassId": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Product updated successfully"
}
 

Example response (400):


{
    "message": "Validation errors. Please check your input."
}
 

Example response (404):


{
    "message": "Product not found"
}
 

Request   

PUT api/product/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   integer   

The ID of the product to be updated. Example: 1

title   string   

The title of the product. Example: "New Course Title"

description   string   

The description of the product. Example: "A detailed description of the course."

featuredImageUrl   string  optional  

The URL for the product's featured image. Example: "https://example.com/image.jpg"

regular_price   numeric  optional  

The regular price of the product. Example: 100.00

sale_price   numeric  optional  

The sale price of the product. Example: 80.00

saleStartDate   string  optional  

The start date of the sale in Y-m-d H:i:s format. Example: "2025-04-01 00:00:00"

saleEndDate   string  optional  

The end date of the sale in Y-m-d H:i:s format. Example: "2025-04-10 00:00:00"

status   string   

The status of the product. Options: "COMING-SOON", "IN-STOCK", "OUT-OF-STOCK". Example: "IN-STOCK"

type   string   

The type of the product. Options: "SIMPLE", "DOWNLOADABLE", "SUBSCRIPTION". Example: "SIMPLE"

categories   string[]  optional  

The IDs of the categories associated with the product.

courses   string[]  optional  

The courses associated with the product.

relatedProducts   string[]  optional  

The related product IDs.

dynamic_pricing   boolean  optional  

Whether dynamic pricing is enabled for the product. Example: true

dynamicPrices   string[]  optional  

An array of dynamic pricing rules.

seo_title   string  optional  

The SEO title for the product. Example: "Product SEO Title"

seo_description   string  optional  

The SEO description for the product. Example: "This is a detailed product description for SEO."

membership_id   integer  optional  

The ID of the membership associated with the product. Example: 10

subscription_price   numeric  optional  

The subscription price for subscription products. Example: 20.00

price_frequency   string  optional  

The frequency of subscription payments. Options: "DAILY", "WEEKLY", "MONTHLY", "YEARLY". Example: "MONTHLY"

free_trial_value   numeric  optional  

The free trial value for subscription products. Example: 7

free_trial_frequency   string  optional  

The frequency of the free trial. Options: "DAYS", "WEEKS", "MONTHS", "YEARS". Example: "DAYS"

minPurchaseQuantity   numeric  optional  

The minimum purchase quantity for the product. Example: 1

saleTax   string  optional  

The tax rate for the sale. Example: "10%"

taxClassId   integer  optional  

The ID of the tax class associated with the product. Example: 1

Delete product

To delete a product, you need to use this request. Returns number of product deleted(if multiple selected) and also not deleted. (See Response)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/product/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_ids\": [
        1,
        12,
        15
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/product/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_ids": [
        1,
        12,
        15
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "2 product(s) deleted 1 product(s) not deleted as it has active subscription. Please remove the subscription and try again.",
    "deletedProductsCount": 2,
    "unDeletedProductsCount": 1,
    "unDeletedProducts": [
        {
            "id": 5,
            "name": "Product-5"
        }
    ]
}
 

Request   

POST api/product/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string[]   

All product IDs which needs to be deleted.

Get the price of the product.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/product/price/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/product/price/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "price": 3001
}
 

Example response (404):


{
    "error": "Product not found"
}
 

Request   

GET api/product/price/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the product. Example: 1

Quick Edit

Updates the details in bulk for a specified product. Parameters is provided which needs to be updated. (See Parameters)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/product/quickEdit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"product_ids\": [
        3,
        2
    ],
    \"outofstock\": true
}"
const url = new URL(
    "https://demo.aomlms.com/api/product/quickEdit"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "product_ids": [
        3,
        2
    ],
    "outofstock": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Products updated Successfully"
}
 

Request   

POST api/product/quickEdit

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

product_ids   string[]   

All product IDs which needs to be updated.

outofstock   boolean   

Whether product is out of stock. Example: true

Product Free Trial Interval Lookup For Products

Retrieves how often the amount will be deducted in subscription of the product, the platform offers. Helps showing options in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/product/freeTrial/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/product/freeTrial/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "DAYS",
        "display_value": "Days"
    },
    {
        "db_value": "WEEKS",
        "display_value": "Weeks"
    },
    {
        "db_value": "MONTHS",
        "display_value": "Months"
    },
    {
        "db_value": "YEARS",
        "display_value": "Years"
    }
]
 

Request   

GET api/product/freeTrial/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Subscription Price Frequency Lookup For Products

Retrieves how often the amount will be deducted in subscription of the product, the platform offers. Helps showing options in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/product/subscription-price-frequency/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/product/subscription-price-frequency/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "DAILY",
        "display_value": "Per day"
    },
    {
        "db_value": "WEEKLY",
        "display_value": "Per week"
    },
    {
        "db_value": "MONTHLY",
        "display_value": "Per month"
    },
    {
        "db_value": "YEARLY",
        "display_value": "Per year"
    }
]
 

Request   

GET api/product/subscription-price-frequency/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Clone Product

Clone the product with the given ID and copies all the related mappings with the product

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/product/clone" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"productId\": \"autem\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/product/clone"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "productId": "autem"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Product Cloned Successfully"
}
 

Request   

POST api/product/clone

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

productId   required  optional  

The id of the product to be cloned. Example: autem

Flash Cards Modules

A Flash Cards Module is a lesson module used as course content. Helps to perform CRUD operation to and for Flash Cards modules.

Flash Cards Modules Tabular List

Returns all the flash cards modules in a tabular list format in paginated mode. You can apply filter using search_param via moduleTypes(module type), associatedCourse(modules used in course) and moduleName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/flashcards?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=%7B%22moduleTypes%22%3A+%5B%22flashcards%22%5D%2CassociatedCourse%22%3A%22%22%2C%22moduleName%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/flashcards"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"moduleTypes": ["flashcards"],associatedCourse":"","moduleName":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 14,
    "recordsFiltered": 3,
    "records": [
        {
            "id": 14,
            "name": "Lesson-1",
            "slug": "lesson-1",
            "type": "flashcards",
            "icon": "<i class=\"el-icon-collection\"></i>",
            "author": "Aom Staff",
            "created_at": "Aug 11, 2020 06:45 AM"
        },
        {
            "id": 5,
            "name": "The Fundamentals of LMS",
            "slug": "the-fundamentals-of-lms",
            "type": "flashcards",
            "icon": "<i class=\"el-icon-collection\"></i>",
            "author": "Aom Staff",
            "created_at": "Aug 10, 2020 04:59 PM"
        },
        {
            "id": 1,
            "name": "test",
            "slug": "test",
            "type": "flashcards",
            "icon": "<i class=\"el-icon-collection\"></i>",
            "author": "Aom Staff",
            "created_at": "Aug 03, 2020 09:56 AM"
        }
    ]
}
 

Request   

GET api/modules/flashcards

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}}

search_param   string  optional  

for searching items based on field names. Example: {"moduleTypes": ["flashcards"],associatedCourse":"","moduleName":""}

Retrieve Detailed Flashcard Module Info

Retrieves details of flashcard module in depth. Returns related fields value. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/flashcards/{id}?id=6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/flashcards/{id}"
);

const params = {
    "id": "6",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 6,
    "name": "Introduction to Web Development",
    "slug": "intro-to-web-development",
    "content": "<p>This course covers the basics of HTML, CSS, and JavaScript for building modern websites.</p>",
    "trackCompletion": true,
    "estimatedCompletion": "30",
    "estimationCompletedUnit": "hours",
    "orientation": "Online",
    "categories": [],
    "courses": []
}
 

Request   

GET api/modules/flashcards/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

ID of the flashcard module. Example: 6

Create FlashCard Module

To create a flashcard module, you need to use this request. (See parameters) Created flashcard modules can be used in the course as course content/lesson.

Returns : id of the flashcard module created and successfull message

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/modules/flashcards" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"The Fundamentals of LMS\",
    \"content\": \"<p>This is the short content here<\\/p>\",
    \"orientation\": \"portrait\",
    \"trackCompletion\": true,
    \"categories\": [
        1,
        2,
        3
    ],
    \"estimatedCompletion\": 2,
    \"estimationCompletedUnit\": \"minute\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/flashcards"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "The Fundamentals of LMS",
    "content": "<p>This is the short content here<\/p>",
    "orientation": "portrait",
    "trackCompletion": true,
    "categories": [
        1,
        2,
        3
    ],
    "estimatedCompletion": 2,
    "estimationCompletedUnit": "minute"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 9,
    "message": "Module saved successfully"
}
 

Request   

POST api/modules/flashcards

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

Name of the flashcard module. Example: The Fundamentals of LMS

content   string   

Content for the flashcard modules that students will see. Example: <p>This is the short content here</p>

orientation   string   

Orientation of the flashcard module. Example: portrait

trackCompletion   boolean   

If true, the module is being tracked(whether its finished or not) in course player. Example: true

categories   string[]  optional  

The module category to which the flashcard belong to.

estimatedCompletion   integer  optional  

The estimated completion time for the flashcard module. Example: 2

estimationCompletedUnit   string  optional  

The unit of the estimated completion time. Example: minute

Update Flash Card Module

Updates the details of the specified flash card module. (See parameters) Flash card modules can be used in the course as course content/lesson.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/modules/flashcards/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Basic Concepts\",
    \"content\": [
        \"Flashcard content\"
    ],
    \"orientation\": \"horizontal\",
    \"trackCompletion\": true,
    \"categories\": [
        1,
        2,
        3
    ],
    \"estimatedCompletion\": \"30\",
    \"estimationCompletedUnit\": \"minutes\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/flashcards/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Basic Concepts",
    "content": [
        "Flashcard content"
    ],
    "orientation": "horizontal",
    "trackCompletion": true,
    "categories": [
        1,
        2,
        3
    ],
    "estimatedCompletion": "30",
    "estimationCompletedUnit": "minutes"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Module updated successfully"
}
 

Request   

PUT api/modules/flashcards/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the flash card module. Example: 3

Body Parameters

name   string   

Name of the flash card module. Example: Basic Concepts

content   string[]  optional  

Content for the flash card module.

orientation   string   

Orientation of the flash card module. Example: horizontal

trackCompletion   boolean  optional  

If true, the module is being tracked (whether it's finished or not) in course player. Example: true

categories   string[]  optional  

Categories to which the flash card module belongs.

estimatedCompletion   nullable  optional  

Estimated time to complete the module. Example: 30

estimationCompletedUnit   nullable  optional  

Unit of the estimated completion time. Example: minutes

Retrieve Detailed Flashcard Module Info

Retrieves details of flashcard module in depth as well as different modules details that are being used as course content for the same course the current flashcard module is attached to. Returns related fields value. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/flashcards/details?registrationId=1&moduleId=6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/flashcards/details"
);

const params = {
    "registrationId": "1",
    "moduleId": "6",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "Web Development Basics",
    "slug": "web-development-basics",
    "content": "<p>This module introduces the core concepts of modern web development, including HTML, CSS, and responsive design.</p>",
    "courseName": "Full Stack Web Development",
    "courseSlug": "http://localhost:8000/course/full-stack-web-development",
    "trackCompletion": true,
    "min_time_spent": 0,
    "otherModules": [
        {
            "module_id": 1,
            "name": "Introduction to HTML",
            "slug": "introduction-to-html",
            "type": "text",
            "icon": "<i class=\"el-icon-tickets\"></i>",
            "is_locked": false,
            "lock_reason": "",
            "is_dripped": false,
            "drip_message": "",
            "is_current": false,
            "status_row_id": 1,
            "status": "Completed",
            "started_on": "2020-08-03T10:02:33.000000Z",
            "completed_on": "2020-08-03T10:02:41.000000Z",
            "last_accessed_on": "1 week ago",
            "total_time_spent": {
                "hours": 0,
                "minutes": 0,
                "seconds": 6,
                "totalSeconds": 6
            },
            "completion_percentage": 100,
            "no_of_times_accessed": 1
        },
        {
            "module_id": 4,
            "name": "CSS Assignment",
            "slug": "css-assignment",
            "type": "assignment",
            "icon": "<i class=\"el-icon-edit-outline\"></i>",
            "is_locked": false,
            "lock_reason": "",
            "is_dripped": false,
            "drip_message": "",
            "is_current": true,
            "status_row_id": -1,
            "status": "Not Started",
            "started_on": "",
            "completed_on": "",
            "last_accessed_on": "Never",
            "total_time_spent": "",
            "points_awarded": "",
            "completion_percentage": 0,
            "no_of_times_accessed": 0
        }
    ],
    "launchCheck": {
        "canbeLaunched": true,
        "errTitle": "",
        "errDesc": ""
    },
    "prevSlug": "",
    "nextSlug": "css-assignment",
    "status": "Completed",
    "timeSpent": 6,
    "statusRowId": 1
}
 

Request   

GET api/module/flashcards/details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

registrationId   string   

ID of the course Registration for which this module is attached to. Example: 1

moduleId   string   

ID of the flashcard module. Example: 6

Update the progress of a flashcard module.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/module/flashcards/updateProgress?portalId=5&statusRowId=6&cardIndex=1&totalCards=10" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/flashcards/updateProgress"
);

const params = {
    "portalId": "5",
    "statusRowId": "6",
    "cardIndex": "1",
    "totalCards": "10",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "Completed",
    "message": "Module completed successfully",
    "course_newly_completed": false
}
 

Request   

PUT api/module/flashcards/updateProgress

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   string   

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

statusRowId   string   

ID of the ModuleStatus Row belongs to current flashcard module. Example: 6

cardIndex   string   

The current index of the card being accessed. Example: 1

totalCards   string   

The total number of cards in the current module. Example: 10

Retrieve Detailed Flashcard Module Info as Membership content

Retrieves details of flashcard module in depth for the same membership the current flashcard module is attached to. Returns related fields value. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/flashcards/content-details?moduleId=6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/flashcards/content-details"
);

const params = {
    "moduleId": "6",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "JavaScript Flashcards",
    "slug": "javascript-flashcards",
    "content": "<p>Practice key JavaScript concepts through interactive flashcards.</p>",
    "url": "http://localhost:8000/storage/uploads/module/6/flashcards/flashcard1/slide1/slide1.html",
    "orientation": "landscape",
    "trackCompletion": true,
    "timeSpent": null
}
 

Request   

GET api/module/flashcards/content-details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

moduleId   string   

ID of the flashcard module. Example: 6

Front End Webhook API

Endpoints for Front end Marketing Pages. Send automated notifications to external system when some action happens.

Webhook Event Lookup

Retrieves all the events for the webhook actions. Helps showing options in dropdowns elements

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/integrations/webhook/eventLookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/integrations/webhook/eventLookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "new_account_created",
        "display_value": "New Account Created"
    },
    {
        "db_value": "course_enrolled",
        "display_value": "Enrolled in a course"
    },
    {
        "db_value": "quiz_submission",
        "display_value": "Submitted a Quiz"
    },
    {
        "db_value": "assigment_submission",
        "display_value": "Submitted an assignment"
    },
    {
        "db_value": "assigment_evaluation",
        "display_value": "Evaluated an assignment"
    },
    {
        "db_value": "assigment_rejection",
        "display_value": "Rejected an assignment"
    },
    {
        "db_value": "discussion_submission",
        "display_value": "Submitted a discussion"
    },
    {
        "db_value": "new_order",
        "display_value": "New Order Placed"
    },
    {
        "db_value": "failed_order",
        "display_value": "Order Failed"
    },
    {
        "db_value": "refunded_order",
        "display_value": "Order Refunded"
    },
    {
        "db_value": "pending_payment",
        "display_value": "Payment Pending"
    },
    {
        "db_value": "new_announcement",
        "display_value": "New Announcement"
    },
    {
        "db_value": "course_completed",
        "display_value": "Course Completed"
    }
]
 

Request   

GET api/integrations/webhook/eventLookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Create Webhook

Creates a webhook using parameters mentioned. (See parameters) Creates the webhook details using webhook ID.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/webhook/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"url\": \"https:\\/\\/example.aom\",
    \"description\": \"It will use to collect new user data.\",
    \"eventList\": \"New Account Created\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/webhook/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "url": "https:\/\/example.aom",
    "description": "It will use to collect new user data.",
    "eventList": "New Account Created"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": "4",
    "message": "Webhook saved successfully"
}
 

Request   

POST api/webhook/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the webhook. Example: 3

Body Parameters

url   string   

Endpoint to send the data. Example: https://example.aom

description   string  optional  

Description of the event that is being created. Example: It will use to collect new user data.

eventList   string   

Event from the option list. Event options: new_account_created, course_enrolled, quiz_submission, assigment_submission, assigment_evaluation, assigment_rejection, discussion_submission, new_order, failed_order, refunded_order, pending_payment, new_announcement or course_completed. Example: New Account Created

Webhook Actions Tabular List

Returns all the Webhook created in a tabular list format. You can apply filter using search_param.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/webhooks?order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=0" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/webhooks"
);

const params = {
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 4,
    "recordsFiltered": 3,
    "records": [
        {
            "id": 3,
            "url": "https://example.aom.com",
            "events": "New Account Created",
            "author": "Client Admin",
            "created_at": "Aug 10, 2020 12:43 PM"
        },
        {
            "id": 4,
            "url": "https://example.aom.com",
            "events": "Enrolled in a course",
            "author": "Client Admin",
            "created_at": "Aug 10, 2020 12:43 PM"
        }
    ]
}
 

Request   

GET api/webhooks

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}}

search_param   integer  optional  

For searching items based on Events. Example: 0

Update the specified webhook in storage.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/webhook/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"url\": \"https:\\/\\/example.aom\",
    \"description\": \"It will use to collect new user data.\",
    \"eventList\": \"New Account Created\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/webhook/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "url": "https:\/\/example.aom",
    "description": "It will use to collect new user data.",
    "eventList": "New Account Created"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": "4",
    "message": "Webhook updated successfully"
}
 

Request   

PUT api/webhook/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the webhook. Example: 3

Body Parameters

url   string   

Endpoint to send the data. Example: https://example.aom

description   string  optional  

Description of the event that is being created. Example: It will use to collect new user data.

eventList   string   

Event from the option list. Event options: new_account_created, course_enrolled, quiz_submission, assigment_submission, assigment_evaluation, assigment_rejection, discussion_submission, new_order, failed_order, refunded_order, pending_payment, new_announcement or course_completed. Example: New Account Created

Delete the specified webhook in storage.

Example request:
curl --request DELETE \
    "https://demo.aomlms.com/api/webhook/delete/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/webhook/delete/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Webhook deleted successfully"
}
 

Request   

DELETE api/webhook/delete/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the webhook. Example: 3

Webhook Log Tabular List

Returns all the webhook log in a tabular list format in paginated mode.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/webhook/logs/3?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=0" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/webhook/logs/3"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "event": "new_account_created",
            "data": [],
            "status": "success",
            "errorMessage": "",
            "created_at": "Aug 03, 2020 09:56 AM",
            "showData": false
        }
    ]
}
 

Request   

GET api/webhook/logs/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the webhook. Example: 3

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}}

search_param   integer  optional  

For searching items based on columns provided in JSON format. Example: 0

Mailchimp Event Lookup

Retrieves all the events for the mailchimp actions. Helps showing options in dropdowns elements

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/integrations/mailchimp/eventLookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/integrations/mailchimp/eventLookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "newAccount",
        "display_value": "Add New Account"
    }
]
 

Request   

GET api/integrations/mailchimp/eventLookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Create a new Mailchimp event

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/mailchimp/create?data=%5B%7B%22list_id%22%3A+%221234567890%22%2C+%22list_name%22%3A+%22Test+list%22%2C+%22event%22%3A+%22subscribe%22%7D%5D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/mailchimp/create"
);

const params = {
    "data": "[{"list_id": "1234567890", "list_name": "Test list", "event": "subscribe"}]",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Mailchimp saved successfully"
}
 

Request   

POST api/mailchimp/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

data   string   

An array of webhooks to be saved. Example: [{"list_id": "1234567890", "list_name": "Test list", "event": "subscribe"}]

Get all Mailchimp lists

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/mailchimp/getList" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/mailchimp/getList"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "lists": [
        {
            "id": "a1b2c3d4e5",
            "name": "Weekly Newsletter",
            "contact": {
                "company": "Acme Corp",
                "address1": "123 Main Street",
                "address2": "Suite 400",
                "city": "New York",
                "state": "NY",
                "zip": "10001",
                "country": "US",
                "phone": "+1-555-123-4567"
            },
            "permission_reminder": "You are receiving this email because you signed up on our website.",
            "use_archive_bar": true,
            "campaign_defaults": {
                "from_name": "Marketing Team",
                "from_email": "[email protected]",
                "subject": "Your Weekly Update from Acme Corp",
                "language": "en"
            },
            "notify_on_subscribe": "[email protected]",
            "notify_on_unsubscribe": "[email protected]",
            "email_type_option": true,
            "visibility": "pub",
            "double_optin": true,
            "marketing_permissions": true,
            "modules": [
                "ecommerce",
                "social_media"
            ],
            "stats": {
                "member_count": 2500,
                "unsubscribe_count": 45,
                "cleaned_count": 12,
                "member_count_since_send": 30,
                "unsubscribe_count_since_send": 3,
                "cleaned_count_since_send": 1,
                "campaign_count": 52,
                "campaign_last_sent": "2024-04-10T10:00:00+00:00",
                "merge_field_count": 5,
                "avg_sub_rate": 2.5,
                "avg_unsub_rate": 0.3,
                "target_sub_rate": 3,
                "open_rate": 36.5,
                "click_rate": 8.7
            },
            "date_created": "2023-01-15T09:30:00+00:00"
        }
    ]
}
 

Request   

GET api/mailchimp/getList

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Mailchimp Actions Tabular List

Returns all the Mailchimp Actions created in a tabular list format. You can apply filter using search_param.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/mailchimp/getMailchimpEvents?order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/mailchimp/getMailchimpEvents"
);

const params = {
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 4,
    "recordsFiltered": 3,
    "records": [
        {
            "id": 3,
            "list_name": "AOM",
            "event": "New Account Created",
            "author": "Client Admin",
            "created_at": "Aug 10, 2020 12:43 PM"
        },
        {
            "id": 4,
            "list_name": "AOM",
            "event": "Enrolled in a course",
            "author": "Client Admin",
            "created_at": "Aug 10, 2020 12:43 PM"
        }
    ]
}
 

Request   

GET api/mailchimp/getMailchimpEvents

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}}

Mailchimp Log Tabular List

Returns all the Mailchimp log in a tabular list format in paginated mode.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/mailchimp/logs/50?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=%7B%22name%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/mailchimp/logs/50"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"name":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "event": "new_account_created",
            "data": [],
            "status": "success",
            "errorMessage": "",
            "created_at": "Aug 03, 2020 09:56 AM",
            "showData": false
        }
    ]
}
 

Request   

GET api/mailchimp/logs/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the Mailchimp action. Example: 50

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}}

search_param   string  optional  

For searching items based on field names. Example: {"name":""}

Gamification

Endpoints for managing Gamification settings.

Tabular List

Retrieves all the gamification events in a tabular list format.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/gamification_events/tabularlist" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/gamification_events/tabularlist"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "records": [
        {
            "id": 1,
            "name": "Test Gamification Event",
            "triggerValue": 100,
            "badgeTitle": "Test Badge",
            "type": "total_money_spent",
            "display_type": "Total money spent"
        }
    ]
}
 

Request   

GET api/gamification_events/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieves all the types of events for gamification event settings.

Helps showing options in dropdowns elements

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/gamification_events/eventTypeLookUp" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/gamification_events/eventTypeLookUp"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    ['db_value' => 'total_money_spent', 'display_value' => 'Total money spent'] ,
    ['db_value' => 'total_time_spent', 'display_value' => 'Total time spent learning(in hrs)'] ,
    ['db_value' => 'total_module_completed', 'display_value' => 'No. of modules completed'] ,
    ['db_value' => 'total_course_completed', 'display_value' => 'No. of courses completed'] ,
]
 

Request   

GET api/gamification_events/eventTypeLookUp

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Create a new gamification event.

Creates a new gamification event with the given name, type, selected badge ID, and trigger value.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/gamification_event/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"\\\"New Event\\\"\",
    \"eventType\": \"\\\"total_money_spent\\\"\",
    \"selectedBadgeId\": \"123\",
    \"triggerValue\": \"5.6\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/gamification_event/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "\"New Event\"",
    "eventType": "\"total_money_spent\"",
    "selectedBadgeId": "123",
    "triggerValue": "5.6"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 4,
    "message": "Event created successfully"
}
 

Request   

POST api/gamification_event/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   required  optional  

string The name of the new event. Example: "New Event"

eventType   required  optional  

string The type of the new event. Example: "total_money_spent"

selectedBadgeId   required  optional  

The ID of the selected badge. Example: 123

triggerValue   required  optional  

integer The trigger value for the new event. Example: 5.6

Retrieve a specific gamification event.

Fetches the details of a gamification event by its ID, including the event name, type, selected badge ID, and trigger value.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/gamification_event/{id}?id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/gamification_event/{id}"
);

const params = {
    "id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Event 1",
    "eventType": "total_module_completed",
    "selectedBadgeId": 123,
    "triggerValue": 5.6
}
 

Request   

GET api/gamification_event/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

integer The ID of the event to be retrieved. Example: 1

Update a specific gamification event.

Updates the details of a gamification event by its ID, including the event name, type, selected badge ID, and trigger value.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/gamification_event/1?name=%22Event+1%22&eventType=%22total_module_completed%22&selectedBadgeId=123&triggerValue=5.6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/gamification_event/1"
);

const params = {
    "name": ""Event 1"",
    "eventType": ""total_module_completed"",
    "selectedBadgeId": "123",
    "triggerValue": "5.6",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Event updated successfully"
}
 

Request   

PUT api/gamification_event/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

integer The ID of the event to be updated. Example: 1

Query Parameters

name   string   

string The name of the Event. Example: "Event 1"

eventType   string   

string The type of the Event. Example: "total_module_completed"

selectedBadgeId   string   

The ID of the selected badge. Example: 123

triggerValue   string   

interger The trigger value for the event. Example: 5.6

Delete a specific gamification event.

Deletes a gamification event by its ID, but only if no badge has been assigned to a user for that event. If a badge has been assigned, the event cannot be deleted.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/gamification_event/delete/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/gamification_event/delete/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Event deleted Succesfully."
}
 

Example response (200):


{
    "message": "Event cannot be deleted as a badge has been assigned to user for this event"
}
 

Request   

POST api/gamification_event/delete/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

integer The ID of the event to be deleted. Example: 1

General Settings

General Settings helps in managing general platform settings like site name, timezone, emails etc

Get site languages

Get list of all supported languages with their display name.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/siteLanguages" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/siteLanguages"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
     [
         {
             "db_value": "en",
             "display_value": "English (US)"
         },
         {
             "db_value": "es",
             "display_value": "Spanish"
         },
         {
             "db_value": "en-custom",
             "display_value": "Custom English"
         },
         {
             "db_value": "fr",
             "display_value": "French"
         },
         {
             "db_value": "gr",
             "display_value": "German"
         }
     ]
}
 

Request   

GET api/siteLanguages

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Get General Email Settings

Retrieves the details of the general email settings.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/emails/general?portalId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/emails/general"
);

const params = {
    "portalId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "fromName": "Academy of Mine",
    "fromEmail": "[email protected]",
    "replyToEmail": "[email protected]",
    "templateDesign": "default",
    "headerLogo": "Default",
    "customHeaderLogoURL": null,
    "headerBgColor": "#6b15b6",
    "bgColor": "#ffffff",
    "bodyBgColor": "#f6f9fc",
    "bodyTextColor": "#1b1e24"
}
 

Request   

GET api/settings/emails/general

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer   

Portal ID. Example: 1

Update General Email Settings

To update the general email settings with updated values, you need to use this request. (See parameters)

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/emails/general" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"fromName\": \"Academy of Mine\",
    \"fromEmail\": \"[email protected]\",
    \"replyToEmail\": \"[email protected]\",
    \"templateDesign\": \"default\",
    \"headerLogo\": \"Default\",
    \"customHeaderLogoURL\": \"null\",
    \"headerBgColor\": \"#6b15b6\",
    \"bgColor\": \"#ffffff\",
    \"bodyBgColor\": \"#f6f9fc\",
    \"bodyTextColor\": \"#1b1e24\",
    \"footerText\": \"Copyright &copy; Your Company Name - All rights reserved.\",
    \"logoBgColor\": \"#1b1e24\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/emails/general"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "fromName": "Academy of Mine",
    "fromEmail": "[email protected]",
    "replyToEmail": "[email protected]",
    "templateDesign": "default",
    "headerLogo": "Default",
    "customHeaderLogoURL": "null",
    "headerBgColor": "#6b15b6",
    "bgColor": "#ffffff",
    "bodyBgColor": "#f6f9fc",
    "bodyTextColor": "#1b1e24",
    "footerText": "Copyright &copy; Your Company Name - All rights reserved.",
    "logoBgColor": "#1b1e24"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated"
}
 

Request   

PUT api/settings/emails/general

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

fromName   string   

From name for the email. Example: Academy of Mine

fromEmail   string   

From email address for the email. Example: [email protected]

replyToEmail   string   

Reply to email address for the email. Example: [email protected]

templateDesign   string   

Template design for the email. Example: default

headerLogo   string   

Header logo for the email. Example: Default

customHeaderLogoURL   string   

Custom header logo URL for the email. Example: null

headerBgColor   string   

Header background color for the email. Example: #6b15b6

bgColor   string   

Background color for the email. Example: #ffffff

bodyBgColor   string   

Body background color for the email. Example: #f6f9fc

bodyTextColor   string   

Body text color for the email. Example: #1b1e24

footerText   string   

Footer text for the email. Example: Copyright &copy; Your Company Name - All rights reserved.

logoBgColor   string   

Logo background color for the email. Example: #1b1e24

Update email format for given type

This api is used to update the email format of given type

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/edit-template" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"type\": \"upcoming_webinar\",
    \"portalId\": 11,
    \"area\": \"Course, Class\",
    \"subject\": \"Your Upcoming Webinar\",
    \"recipients\": \"User\",
    \"heading\": \"Upcoming Webinar\",
    \"content\": \"This is a test email\",
    \"enabled\": 1,
    \"admin_enabled\": 1,
    \"hours\": 24,
    \"days\": 7,
    \"interval\": \"days\",
    \"frequency\": \"1\",
    \"enable_coupon\": 1,
    \"coupon\": 1
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/edit-template"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "type": "upcoming_webinar",
    "portalId": 11,
    "area": "Course, Class",
    "subject": "Your Upcoming Webinar",
    "recipients": "User",
    "heading": "Upcoming Webinar",
    "content": "This is a test email",
    "enabled": 1,
    "admin_enabled": 1,
    "hours": 24,
    "days": 7,
    "interval": "days",
    "frequency": "1",
    "enable_coupon": 1,
    "coupon": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Template Updated Successfully"
}
 

Request   

PUT api/settings/edit-template

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

type   string   

Type of email. Example: upcoming_webinar

portalId   integer   

Portal ID Example: 11

area   string   

Area of email. Example: Course, Class

subject   string   

Subject of email. Example: Your Upcoming Webinar

recipients   string   

Recipients of email. Example: User

heading   string   

Heading of email. Example: Upcoming Webinar

content   string   

Content of email. Example: This is a test email

enabled   integer   

Is email enabled? Example: 1

admin_enabled   integer   

Is email enabled for admin? Example: 1

hours   integer   

Number of hours. Example: 24

days   integer   

Number of days. Example: 7

interval   string   

Interval of reminder. Example: days

frequency   string   

Frequency of reminder. Example: 1

enable_coupon   integer   

Is coupon enabled? Example: 1

coupon   integer   

Coupon ID. Example: 1

Get Email Format

Retrieves the details of the email formats.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/get-template?portalId=1&type[]=new_account_creation&type[]=new_account_creation_others" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/get-template"
);

const params = {
    "portalId": "1",
    "type[0]": "new_account_creation",
    "type[1]": "new_account_creation_others",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


array of objects
 

Request   

GET api/settings/get-template

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer   

Example: 1

type   string[]   

Array of email types.

Response

Response Fields

area   string   

required Area of the email

type   string   

required Type of the email

portalId   integer   

required Portal ID

subject   string   

required Subject of the email

recipients   string   

required Recipients of the email

heading   string   

required Heading of the email

content   string   

required Content of the email

enabled   boolean   

required Enabled status of the email

admin_enabled   boolean   

required Enabled status of the email for admin

hours   string   

required Hours for upcoming webinar reminder

days   string   

required Days for course expiration

portal_admin_email   boolean   

required Portal admin email enabled status

interval   string   

required Interval for cart abandoned email

frequency   string   

required Frequency for cart abandoned email

enable_coupon   boolean   

required Enable coupon for cart abandoned email

coupon   integer   

required Coupon ID for cart abandoned email

Get General Settings

Get the general settings of the site.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/general" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/general"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "siteTitle": "Academy of mine",
    "adminEmail": "[email protected]",
    "siteLanguage": "en",
    "timeZone": "null",
    "dateFormat": "M d, Y",
    "timeFormat": "h:i A",
    "privateSite": "no",
    "customTimeZone": "tempora",
    "homePage": "1",
    "productCatalogPage": 2,
    "cartPage": 5,
    "checkoutPage": "4",
    "termConditionPage": 3,
    "termConditionText": "I have read and agree to the website term.",
    "privacyPolicyPage": 2,
    "privacyPolicyText": "Your personal data will be used to process your order, support your experience throughout this website, and for other purposes described in our privacy policy."
}
 

Request   

GET api/settings/general

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Get a list of custom timezones.

Returns all available PHP timezones except a predefined custom list. Useful for showing only non-default timezones to users or filtering out common ones.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/customTimezone" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/customTimezone"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    "Africa/Abidjan",
    "Africa/Accra",
    "Africa/Addis_Ababa",
    "Africa/Algiers",
    "Africa/Asmara",
    "Africa/Bamako"
]
 

Request   

GET api/settings/customTimezone

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update General Settings

Update the general settings of the site with provided values in the request.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/settings/general" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"siteTitle\": \"totam\",
    \"adminEmail\": \"[email protected]\",
    \"siteLanguage\": \"facilis\",
    \"timeZone\": \"Asia\\/Tashkent\",
    \"dateFormat\": \"ullam\",
    \"timeFormat\": \"soluta\",
    \"privateSite\": \"consequatur\",
    \"customTimeZone\": \"\\\"America\\/New_York\\\"\",
    \"homePage\": 1,
    \"cartPage\": 1,
    \"checkoutPage\": 6,
    \"termConditionPage\": 11,
    \"termConditionText\": \"voluptas\",
    \"privacyPolicyPage\": 7,
    \"privacyPolicyText\": \"mollitia\",
    \"cookieTitle\": \"rem\",
    \"cookieAccept\": \"sapiente\",
    \"cookieReject\": \"reiciendis\",
    \"cookieMessage\": \"pariatur\",
    \"thankyouPage\": 5,
    \"cookieEnable\": 10,
    \"googleRecaptchaEnable\": 14,
    \"googleRecaptchaSiteKey\": \"odit\",
    \"googleRecaptchaSecretKey\": \"commodi\",
    \"blockedEmailsDomains\": \"quia\",
    \"anyOneCanRegister\": 8,
    \"learnerDashboard\": \"aspernatur\",
    \"customCatalogPageurl\": \"http:\\/\\/goodwin.com\\/aut-odit-incidunt-ipsam-quo-molestiae-aut\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/general"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "siteTitle": "totam",
    "adminEmail": "[email protected]",
    "siteLanguage": "facilis",
    "timeZone": "Asia\/Tashkent",
    "dateFormat": "ullam",
    "timeFormat": "soluta",
    "privateSite": "consequatur",
    "customTimeZone": "\"America\/New_York\"",
    "homePage": 1,
    "cartPage": 1,
    "checkoutPage": 6,
    "termConditionPage": 11,
    "termConditionText": "voluptas",
    "privacyPolicyPage": 7,
    "privacyPolicyText": "mollitia",
    "cookieTitle": "rem",
    "cookieAccept": "sapiente",
    "cookieReject": "reiciendis",
    "cookieMessage": "pariatur",
    "thankyouPage": 5,
    "cookieEnable": 10,
    "googleRecaptchaEnable": 14,
    "googleRecaptchaSiteKey": "odit",
    "googleRecaptchaSecretKey": "commodi",
    "blockedEmailsDomains": "quia",
    "anyOneCanRegister": 8,
    "learnerDashboard": "aspernatur",
    "customCatalogPageurl": "http:\/\/goodwin.com\/aut-odit-incidunt-ipsam-quo-molestiae-aut"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated",
    "type": "success",
    "title": "Success"
}
 

Request   

POST api/settings/general

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

siteTitle   string   

Site title of the website. Example: totam

adminEmail   string   

Admin email of the website. Example: [email protected]

siteLanguage   string   

Language of the site. Example: facilis

timeZone   string   

Timezone of the site. Example: Asia/Tashkent

dateFormat   string   

Date format of the site. Example: ullam

timeFormat   string   

Time format of the site. Example: soluta

privateSite   string   

Is the site private or not. Example: consequatur

customTimeZone   string   

Custom timezone for site. Example: "America/New_York"

homePage   integer   

Homepage for site(page Id). Example: 1

cartPage   integer   

Cart page for site(page Id). Example: 1

checkoutPage   integer   

Checkout page for site(page Id). Example: 6

termConditionPage   integer   

Term and Condition page for the site(page Id). Example: 11

termConditionText   string   

Term and Condition Text of the site. Example: voluptas

privacyPolicyPage   integer   

Privacy Policy page for the site(page Id). Example: 7

privacyPolicyText   string   

Privacy Policy Text of the site. Example: mollitia

cookieTitle   string   

Cookie Title of the site. Example: rem

cookieAccept   string   

Cookie Accept Button of the site. Example: sapiente

cookieReject   string   

Cookie Reject Button of the site. Example: reiciendis

cookieMessage   string   

Cookie Message of the site. Example: pariatur

thankyouPage   integer   

Thank you page for the site(page Id). Example: 5

cookieEnable   integer   

Is the cookie enable or not. Example: 10

googleRecaptchaEnable   integer   

Is the google recaptcha enable or not. Example: 14

googleRecaptchaSiteKey   string   

Google recaptcha site key. Example: odit

googleRecaptchaSecretKey   string   

Google recaptcha secret key. Example: commodi

blockedEmailsDomains   string   

Blocked emails domains. Example: quia

anyOneCanRegister   integer   

Is the anyone can register or not. Example: 8

learnerDashboard   string   

Learner dashboard page/menu id. Example: aspernatur

customCatalogPageurl   string   

Custom catalog page url. Example: http://goodwin.com/aut-odit-incidunt-ipsam-quo-molestiae-aut

Retrieve branding settings

Retrieves the details of the brand settings. Helps in fetching items of the brand settings, items like primary color, body color, logo footer text(See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/branding" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/branding"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "brandColors": {
        "primaryColor": "#6b15b6",
        "bodyBgColor": "#f6f9fc",
        "bodyColor": "#1b1e24"
    },
    "logo": "",
    "logoMini": "",
    "topBarEmail": "[email protected]",
    "topBarPhone": "+1-202-555-0189",
    "footerText": "Copyright &copy; Your Company Name - All rights reserved.",
    "headerBgColor": "#6b15b6",
    "menuTextColor": "#6b15b6",
    "favicon": "favicon.ico",
    "robotsTxt": "User-agent: *",
    "hideSearchEngineVisibility": "no",
    "learnerDashboard": "dashboard"
}
 

Request   

GET api/settings/branding

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Set branding settings

Set the branding settings of the site.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/branding" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"brandColors\": [],
    \"logo\": \"\\\"logo.png\\\"\",
    \"logoMini\": \"\\\"mini-logo.png\\\"\",
    \"topBarEmail\": \"\\\"[email protected]\\\"\",
    \"topBarPhone\": \"\\\"+1 123 456 7890\\\"\",
    \"menuTextColor\": \"\\\"#6b15b6\\\"\",
    \"footerText\": \"\\\"Copyright &copy; Your Company Name - All rights reserved.\\\"\",
    \"headerBgColor\": \"\\\"#6b15b6\\\"\",
    \"favicon\": \"\\\"favicon.ico\\\"\",
    \"robotsTxt\": \"\\\"User-agent: *\\\"\",
    \"hideSearchEngineVisibility\": \"\\\"no\\\"\",
    \"shouldCompileTheme\": \"\\\"true\\\"\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/branding"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "brandColors": [],
    "logo": "\"logo.png\"",
    "logoMini": "\"mini-logo.png\"",
    "topBarEmail": "\"[email protected]\"",
    "topBarPhone": "\"+1 123 456 7890\"",
    "menuTextColor": "\"#6b15b6\"",
    "footerText": "\"Copyright &copy; Your Company Name - All rights reserved.\"",
    "headerBgColor": "\"#6b15b6\"",
    "favicon": "\"favicon.ico\"",
    "robotsTxt": "\"User-agent: *\"",
    "hideSearchEngineVisibility": "\"no\"",
    "shouldCompileTheme": "\"true\""
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Branding Settings Updated"
}
 

Request   

PUT api/settings/branding

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

brandColors   object   

Brand colors object.

logo   string   

Logo of the site. Example: "logo.png"

logoMini   string   

Mini logo of the site. Example: "mini-logo.png"

topBarEmail   string   

Top bar email of the site. Example: "[email protected]"

topBarPhone   string   

Top bar phone of the site. Example: "+1 123 456 7890"

menuTextColor   string   

Menu text color of the site. Example: "#6b15b6"

footerText   string   

Footer text of the site. Example: "Copyright &copy; Your Company Name - All rights reserved."

headerBgColor   string   

Header background color of the site. Example: "#6b15b6"

favicon   string   

Favicon of the site. Example: "favicon.ico"

robotsTxt   string   

Robots.txt of the site. Example: "User-agent: *"

hideSearchEngineVisibility   string   

Hide search engine visibility of the site. Example: "no"

shouldCompileTheme   string   

Should compile theme of the site. Example: "true"

Retrieves the custom CSS added in the platform.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/customstyle" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/customstyle"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
 "custom_css": ".aom-button {
    background-color: #fff;
 }"
}
 

Request   

GET api/settings/customstyle

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Set Custom Stylings

Updates the custom CSS added in the platform.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/customstyle" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"custom_css\": \".aom-button {\\n  background-color: #fff;\\n}\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/customstyle"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "custom_css": ".aom-button {\n  background-color: #fff;\n}"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Custom Styling Saved Successfully"
}
 

Request   

PUT api/settings/customstyle

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

custom_css   string   

The custom CSS to be added in the platform. Example: .aom-button { background-color: #fff; }

Updates the status of the email if the selected area of the email format as enabled or not.

If disabled, the students will not get any email from this platform for selected email format area(account, lms, ecommerce, etc) and type (account creation, enrollments, etc)

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/update-state" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"area\": \"account, lms, ecommerce, etc\",
    \"type\": \"new_account_creation, course_enrolled, etc\",
    \"isEnabled\": true,
    \"admin_enabled\": true,
    \"portalId\": 1
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/update-state"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "area": "account, lms, ecommerce, etc",
    "type": "new_account_creation, course_enrolled, etc",
    "isEnabled": true,
    "admin_enabled": true,
    "portalId": 1
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Email State Updated Successfully"
}
 

Request   

PUT api/settings/update-state

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

area   string   

The email format area. Example: account, lms, ecommerce, etc

type   string   

The email type. Example: new_account_creation, course_enrolled, etc

isEnabled   boolean   

The status of the email. Example: true

admin_enabled   boolean   

The status of the email for admins. Example: true

portalId   integer   

The portal id. Example: 1

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/generic-search" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"search_term\": \"\\\"John Doe\\\"\",
    \"portalId\": 5
}"
const url = new URL(
    "https://demo.aomlms.com/api/generic-search"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "search_term": "\"John Doe\"",
    "portalId": 5
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "courses": [
        {
            "label": "Course1",
            "value": "/dashboard/course/manage/1"
        },
        {
            "label": "Course2",
            "value": "/dashboard/course/manage/2"
        }
    ],
    "users": [
        {
            "label": "John Doe ([email protected])",
            "value": "/dashboard/user/edit/1"
        },
        {
            "label": "Jane Doe ([email protected])",
            "value": "/dashboard/user/edit/2"
        }
    ],
    "products": [
        {
            "label": "Product1",
            "value": "/dashboard/product/edit/1"
        },
        {
            "label": "Product2",
            "value": "/dashboard/product/edit/2"
        }
    ],
    "modules": [
        {
            "label": "Module1",
            "value": "/dashboard/modules/edit/1"
        },
        {
            "label": "Module2",
            "value": "/dashboard/modules/edit/2"
        }
    ]
}
 

Retrieves the status of the gamification feature.

Retrieves the status of gamification feature. Returns a boolean value if the feature is enabled or disabled.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/settings/gamification" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/gamification"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "is_enabled": true
}
 

Request   

GET api/settings/gamification

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update Gamification Settings

Updates the gamification settings based on the provided request parameters. Toggles the gamification feature on or off.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/settings/gamification" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"is_enabled\": true
}"
const url = new URL(
    "https://demo.aomlms.com/api/settings/gamification"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "is_enabled": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated",
    "type": "success",
    "title": "Success"
}
 

Request   

PUT api/settings/gamification

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

is_enabled   boolean   

The status to enable or disable gamification. Example: true

Hubspot Integration

It allows you to track learner activity and progress in the LMS, and trigger changes in HubSpot data accordingly.

Hubspot Event Lookup

Retrieves all the events for the hubspot actions. Helps showing options in dropdowns elements

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/integrations/hubspot/eventLookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/integrations/hubspot/eventLookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "new_account_created",
        "display_value": "New Account Created",
        "crud_op": "Create",
        "hubspot_crud": "[{'db_value' => 'hubspot_contact', 'display_value'=> 'Create New HubSpot Contact'}]"
    },
    {
        "db_value": "Account Updated",
        "display_value": "Account Updated",
        "crud_op": "Update",
        "hubspot_crud": "[['db_value' => 'hubspot_contact', 'display_value'=> 'Update HubSpot Contact']]"
    },
    {
        "db_value": "course_enrolled",
        "display_value": "Enrolled in a course",
        "crud_op": "Update",
        "hubspot_crud": "[['db_value' => 'hubspot_contact', 'display_value'=> 'Update Course Status in HubSpot Contact']]"
    },
    {
        "db_value": "course_completed",
        "display_value": "Course Completed",
        "crud_op": "Update",
        "hubspot_crud": "[['db_value' => 'hubspot_contact', 'display_value'=> 'Update Course Status to complete in  HubSpot Contact']]"
    },
    {
        "db_value": "course_started",
        "display_value": "Course Started",
        "crud_op": "Update",
        "hubspot_crud": "[['db_value' => 'hubspot_contact', 'display_value'=> 'Update Course Status to in progress in  HubSpot Contact']]"
    },
    {
        "db_value": "course_progress",
        "display_value": "Course Progress Tracking",
        "crud_op": "Update",
        "hubspot_crud": "[['db_value' => 'hubspot_deal', 'display_value'=> 'Update Course Progress in HubSpot Deal']]"
    },
    {
        "db_value": "course_expired",
        "display_value": "Course Expired",
        "crud_op": "Update",
        "hubspot_crud": "[['db_value' => 'hubspot_contact', 'display_value'=> 'HubSpot Contact']]"
    }
]
 

Request   

GET api/integrations/hubspot/eventLookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Field Lookup

Retrieves all the fields for the hubspot. Helps showing options in dropdowns elements

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/integrations/hubspot/fieldLookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"type\": \"ut\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/integrations/hubspot/fieldLookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "type": "ut"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


[
    {
        "lms_fields": [
            {
                "db_value": "email"
            },
            {
                "db_value": "last_name"
            },
            {
                "db_value": "first_name"
            },
            {
                "db_value": "last_login_ip"
            },
            {
                "db_value": "is_disabled"
            }
        ]
    },
    {
        "hubspot_fields": [
            {
                "db_value": "email"
            },
            {
                "db_value": "lastname"
            },
            {
                "db_value": "firstname"
            }
        ]
    },
    {
        "courses": [
            {
                "id": 1,
                "name": "Course 1"
            },
            {
                "id": 2,
                "name": "Course 2"
            }
        ]
    }
]
 

Request   

GET api/integrations/hubspot/fieldLookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

type   string   

Type to get the data, it can either be contact or deal. Example: ut

Create Hubspot Action

Creates a Hubspot action based on the provided parameters.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/hubspot/action/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/hubspot/action/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Action created Successfully"
}
 

Request   

POST api/hubspot/action/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

event   integer   

The event of the Hubspot action. Example: 0

action   string   

The action of the Hubspot action. Example: create

object   string   

The object of the Hubspot action. Example: Hubspot Contact

Save Hubspot Mapping

Saves the mapping of hubspot mapping. Helps in saving hubspot mapping using its type. (See Parameters)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/hubspot/mapping/save" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"type\": \"hubspot_contact\",
    \"dealIdentifierObjectAndProperties\": [
        \"blanditiis\"
    ],
    \"courseFieldProperties\": [
        \"reiciendis\"
    ],
    \"userFieldProperties\": [
        \"voluptatibus\"
    ],
    \"conditionMappingData\": [
        {
            \"id\": 1,
            \"conditionOperator\": \"AND\",
            \"conditionValue\": \"hasdeal\",
            \"conditionType\": \"CONTACT\",
            \"conditionOperatorValue\": \"CONTAINS\"
        },
        {
            \"id\": 2,
            \"conditionOperator\": \"OR\",
            \"conditionValue\": \"hasdeal\",
            \"conditionType\": \"CONTACT\",
            \"conditionOperatorValue\": \"CONTAINS\"
        }
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/hubspot/mapping/save"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "type": "hubspot_contact",
    "dealIdentifierObjectAndProperties": [
        "blanditiis"
    ],
    "courseFieldProperties": [
        "reiciendis"
    ],
    "userFieldProperties": [
        "voluptatibus"
    ],
    "conditionMappingData": [
        {
            "id": 1,
            "conditionOperator": "AND",
            "conditionValue": "hasdeal",
            "conditionType": "CONTACT",
            "conditionOperatorValue": "CONTAINS"
        },
        {
            "id": 2,
            "conditionOperator": "OR",
            "conditionValue": "hasdeal",
            "conditionType": "CONTACT",
            "conditionOperatorValue": "CONTAINS"
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "is_success": true,
    "message": "Mapping saved Successfully"
}
 

Request   

POST api/hubspot/mapping/save

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

type   required  optional  

Type of the hupspot mapping you want to save the details of. Example: hubspot_contact

dealIdentifierObjectAndProperties   string[]   

Deal identifier object and properties. (See parameters)

courseFieldProperties   string[]   

Course field properties. (See parameters)

userFieldProperties   string[]   

User field properties. (See parameters)

conditionMappingData   string[]   

Array of condition mapping data.

Retrieve Hubspot Mapping

Retrieves the details of the hubspot mapping. Helps in fetching hubspot mapping using its type. (See Parameters)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/hubspot/mappings" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"type\": \"hubspot_contact\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/hubspot/mappings"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "type": "hubspot_contact"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "type": "hubspot_contact",
    "userFieldProperties": [],
    "courseFieldProperties": []
}
 

Example response (200):


{
    "type": "hubspot_deal",
    "dealIdentifierObjectAndProperties": [],
    "courseFieldProperties": []
}
 

Example response (200):


{
    "type": "hubspot_condition",
    "conditions": []
}
 

Request   

GET api/hubspot/mappings

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

type   required  optional  

Type of the hupspot mapping you want to fetch the details of. Example: hubspot_contact

Retrieves HubSpot integrations in a tabular format with pagination.

This function handles requests for retrieving a list of HubSpot integration events in a paginated tabular format. It allows filtering by events and ordering by specified columns. The results include detailed information about each event, such as the event and object display values, action, author, and timestamp.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/hubspots?order_by=%7B%22colName%22%3A+%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=0" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/hubspots"
);

const params = {
    "order_by": "{"colName": "created_at", "direction": "desc"}",
    "search_param": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 20,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "event": "course_enrolled",
            "event_display_value": "Enrolled in a Course",
            "object": "hubspot_contact",
            "object_display_value": "HubSpot Contact",
            "action": "created",
            "author": "John Doe",
            "created_at": "2021-01-01 12:00:00"
        }
    ]
}
 

Request   

GET api/hubspots

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

order_by   string  optional  

JSON object for ordering items based on specified columns. Example: {"colName": "created_at", "direction": "desc"}

search_param   integer  optional  

JSON object for filtering items by events. Example: 0

Update Hubspot Action

Updates a Hubspot action based on the provided ID.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/hubspot/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"event\": \"New Account Created\",
    \"action\": \"create\",
    \"object\": \"Hubspot Deal\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/hubspot/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "event": "New Account Created",
    "action": "create",
    "object": "Hubspot Deal"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Hubspot updated successfully"
}
 

Request   

PUT api/hubspot/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the Hubspot action to be updated. Example: 1

Body Parameters

event   required  optional  

The event of the Hubspot action. Example: New Account Created

action   required  optional  

The action of the Hubspot action. Example: create

object   required  optional  

The object of the Hubspot action. Example: Hubspot Deal

Delete Hubspot Action

Deletes a Hubspot action based on the provided ID.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/hubspot/action/delete/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/hubspot/action/delete/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Hubspot deleted successfully"
}
 

Request   

POST api/hubspot/action/delete/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the Hubspot action to be deleted. Example: 1

Hubspot Log Tabular List

Returns all the Hubspot log in a tabular list format in paginated mode.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/hubspot/logs/50?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/hubspot/logs/50"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "event": "New Account Created",
            "data": [],
            "status": "success",
            "errorMessage": "",
            "created_at": "Aug 03, 2020 09:56 AM",
            "showData": false
        }
    ]
}
 

Request   

GET api/hubspot/logs/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the Hubspot action. Example: 50

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

Conditions Lookup

Retrieves all the conditions for Hubspot. Helps showing options in dropdowns elements

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/hubspot/conditionLookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/hubspot/conditionLookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "equal_to",
        "display_value": "="
    },
    {
        "db_value": "not_equal_to",
        "display_value": "!="
    },
    {
        "db_value": "greater_than",
        "display_value": ">"
    },
    {
        "db_value": "less_than",
        "display_value": "<"
    }
]
 

Request   

GET api/hubspot/conditionLookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Operator Lookup

Retrieves all the operators for Hubspot. Helps showing options in dropdowns elements

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/hubspot/operatorsLookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/hubspot/operatorsLookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "and",
        "display_value": "And"
    },
    {
        "db_value": "or",
        "display_value": "Or"
    }
]
 

Request   

GET api/hubspot/operatorsLookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Import users from HubSpot.

This endpoint is used to initiate a user import process from HubSpot. It saves the provided HubSpot conditions, updates the import identifier for tracking, logs the import event, and dispatches a job to process the import in the background.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/hubspot/importUser" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"hubspotConditions\": [
        \"totam\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/hubspot/importUser"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "hubspotConditions": [
        "totam"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "success": true,
    "importId": 2,
    "message": "Hubspot import user sync executed and in running state. Refresh to know its status."
}
 

Request   

POST api/hubspot/importUser

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

hubspotConditions   string[]   

The conditions used to filter HubSpot users before import.

Get the status of the last HubSpot user import.

This endpoint is used to get the status of the last HubSpot user import. It returns the status of the import, which can be either 'success', 'failed', or 'queue'. If the import is still in queue, it means that the import has been initiated but has not completed yet. If the import has failed, it means that there was an error during the import process. If the import was successful, it means that the import has completed without any errors.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/hubspot/import-user/status?importId=et" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/hubspot/import-user/status"
);

const params = {
    "importId": "et",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "lastImportedDate": "22-Jan-2020 12:00 AM",
    "status": "success"
}
 

Request   

GET api/hubspot/import-user/status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

importId   string  optional  

The identifier of the import job. If not provided, it defaults to the latest import job. Example: et

Get Import User Logs

Returns all the Hubspot import user log in a tabular list format in paginated mode.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/hubspot/importUserlogs/50?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/hubspot/importUserlogs/50"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "importIdentifier": 1,
            "event": "import_users",
            "importedData": "[]",
            "skippedData": "",
            "message": "Import completed successfully",
            "status": "success",
            "display_status": "Success",
            "errorMessage": "",
            "created_at": "Aug 03, 2020 09:56 AM",
            "showData": false,
            "queueStatus": "success"
        }
    ]
}
 

Request   

GET api/hubspot/importUserlogs/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the Hubspot action. Example: 50

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

Integrations

An integration can be used by admins to integrate this platform to other platforms. Endpoints helps in performing CRUD operation for and to integration.

Get all integrations.

Returns a list of all available integrations with their details such as name, identifier, logo, and status. The timestamps are formatted based on the app's configured timezone, language, date, and time format.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/integrations/listing" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/integrations/listing"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "HubSpot",
        "identifier": "hubspot",
        "description": "CRM Integration with HubSpot",
        "logo_url": "https://example.com/images/hubspot.png",
        "is_enabled": true,
        "implementer_class": "App\\Integrations\\Hubspot",
        "created_by": 1,
        "updated_by": 2,
        "created_at": "Apr 12, 2025 10:35 AM",
        "updated_at": "Apr 12, 2025 11:40 AM"
    }
]
 

Request   

GET api/integrations/listing

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update Integration Settings

Updates the integration settings for a specified integration. Setting needs to be updated is mentioned in parameter. (See Parameter)

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/integrations/settings/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalId\": 5,
    \"is_enabled\": true,
    \"settings\": [
        \"laborum\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/integrations/settings/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalId": 5,
    "is_enabled": true,
    "settings": [
        "laborum"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated"
}
 

Request   

PUT api/integrations/settings/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the integration. Example: 1

Body Parameters

portalId   integer  optional  

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

is_enabled   boolean   

Enable status of integration. Example: true

settings   string[]   

An associative array of settings to be updated.

Retrieve Integration Settings

Retrieves all the integration settings for a specified integration. Helps in mainting the data and enable status of the integration.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/integrations/settings/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/integrations/settings/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "Google Analytics",
    "identifier": "google-analytics",
    "is_enabled": false,
    "settings": {
        "ga_code": "<script type=\"text/javascript\">var a = 12;</script>"
    }
}
 

Request   

GET api/integrations/settings/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the integration. Example: 1

Update the status of an integration

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/integrations/updateStatus" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"status\": true
}"
const url = new URL(
    "https://demo.aomlms.com/api/integrations/updateStatus"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "status": true
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Settings Updated"
}
 

Request   

PUT api/integrations/updateStatus

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the integration. Example: 1

Body Parameters

status   boolean   

Enable status of integration. Example: true

Returns all the Integrations' Settings for a given Portal in a paginated list format.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/integrations/webinar/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/integrations/webinar/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{"is_enabled":true,"name":"zoom"},{"is_enabled":true,"name":"goto_webinar"},{"is_enabled":true,"name":"goto_training"},{"is_enabled":true,"name":"ms_team_meet"}
 

Request   

GET api/integrations/webinar/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

portalId   string   

ID of the portal you want to retrieve integrations settings of. Example: 2

Retrieve Shopify Product List

Return all the Shopify Product, you need to use this request.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/shopify/product/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"search_term\": \"\\\"Introduction\\\".\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/shopify/product/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "search_term": "\"Introduction\"."
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


[
    "productList" => [
        [
            "id" => "1234567890",
            "title" => "Introduction to Continuing Education"
        ],
        [
            "id" => "2345678901",
            "title" => "Professional Training And Education"
        ]
    ],
    "isShopifyEnabled" => true
]
 

Request   

POST api/shopify/product/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

search_term   string   

Search term to search the product in Shopify. Example: "Introduction".

Create a product in shopify with the price and title provided in request

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/shopify/product/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"title\": \"aut\",
    \"price\": 7
}"
const url = new URL(
    "https://demo.aomlms.com/api/shopify/product/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "title": "aut",
    "price": 7
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


[
    "success" => true,
    "message" => "Product created successfully",
    "product_id" => 123456,
    "product_title" => "Introduction to Continuing Education"
]
 

Request   

POST api/shopify/product/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

title   string   

Title of the product. Example: aut

price   integer   

Price of the product. Example: 7

LTI Integration API

This controller handles all API interactions related to Learning Tools Interoperability (LTI) integration. It provides endpoints for managing LTI tool launches, handling authentication, and syncing data between the platform and external LTI-compliant systems such as learning management systems (LMS).

Endpoints in this controller facilitate the integration and communication between the platform and external educational tools or services via the LTI standard.

Add a new LTI platform

Add a new LTI platform and save its details in the database.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/lti/addPlatform?platformId=https%3A%2F%2Fcanvas.instructure.com&platformName=Canvas&clientId=1234567890&jwksUrl=https%3A%2F%2Fcanvas.instructure.com%2Fapi%2Flti%2Fsecurity%2Fjwks&accessTokenUrl=https%3A%2F%2Fcanvas.instructure.com%2Flogin%2Foauth2%2Ftoken&authEndPoint=https%3A%2F%2Fcanvas.instructure.com%2Fapi%2Flti%2Fauthorize_redirect&roles=%5B%22Student%22%2C+%22Teacher%22%5D&contentAccessible=true&teacherProvisioningMode=%22New+accounts+only%22&studentProvisioningMode=%22New+accounts+only%22&deploymentId=1234567890&courses=%5B%7B%22id%22%3A1%2C%22name%22%3A%22Course+1%22%2C%22syncGrade%22%3Atrue%7D%2C%7B%22id%22%3A2%2C%22name%22%3A%22Course+2%22%2C%22syncGrade%22%3Afalse%7D%5D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/lti/addPlatform"
);

const params = {
    "platformId": "https://canvas.instructure.com",
    "platformName": "Canvas",
    "clientId": "1234567890",
    "jwksUrl": "https://canvas.instructure.com/api/lti/security/jwks",
    "accessTokenUrl": "https://canvas.instructure.com/login/oauth2/token",
    "authEndPoint": "https://canvas.instructure.com/api/lti/authorize_redirect",
    "roles": "["Student", "Teacher"]",
    "contentAccessible": "true",
    "teacherProvisioningMode": ""New accounts only"",
    "studentProvisioningMode": ""New accounts only"",
    "deploymentId": "1234567890",
    "courses": "[{"id":1,"name":"Course 1","syncGrade":true},{"id":2,"name":"Course 2","syncGrade":false}]",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 4,
    "message": "Platform Added Successfully"
}
 

Request   

POST api/lti/addPlatform

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

platformId   string   

The platform ID. Example: https://canvas.instructure.com

platformName   string   

The name of the platform. Example: Canvas

clientId   string   

The client ID of the platform. Example: 1234567890

jwksUrl   string   

The JWKS URL of the platform. Example: https://canvas.instructure.com/api/lti/security/jwks

accessTokenUrl   string   

The access token URL of the platform. Example: https://canvas.instructure.com/login/oauth2/token

authEndPoint   string   

The authentication endpoint URL of the platform. Example: https://canvas.instructure.com/api/lti/authorize_redirect

roles   string   

The roles of the users. Example: ["Student", "Teacher"]

contentAccessible   string   

Whether the content is accessible or not. Example: true

teacherProvisioningMode   string   

The provisioning mode for the teacher. Example: "New accounts only"

studentProvisioningMode   string   

The provisioning mode for the student. Example: "New accounts only"

deploymentId   string   

The deployment ID of the platform. Example: 1234567890

courses   string   

The courses associated with the platform. Example: [{"id":1,"name":"Course 1","syncGrade":true},{"id":2,"name":"Course 2","syncGrade":false}]

Update LtiPlatform

Updates the LtiPlatform along with its deployment and contents

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/lti/updatePlatform" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": \"1\",
    \"platformId\": \"example.com\",
    \"platformName\": \"Example\",
    \"clientId\": \"123456789\",
    \"jwksUrl\": \"https:\\/\\/example.com\\/jwks\",
    \"accessTokenUrl\": \"https:\\/\\/example.com\\/token\",
    \"authEndPoint\": \"https:\\/\\/example.com\\/auth\",
    \"deploymentId\": \"123456789\",
    \"roles\": \"[\\\"Instructor\\\", \\\"Student\\\"]\",
    \"contentAccessible\": \"All\",
    \"teacherProvisioningMode\": \"New accounts only\",
    \"studentProvisioningMode\": \"Existing and new accounts\",
    \"courses\": \"[{\\\"id\\\":1,\\\"syncGrade\\\":true}]\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/lti/updatePlatform"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": "1",
    "platformId": "example.com",
    "platformName": "Example",
    "clientId": "123456789",
    "jwksUrl": "https:\/\/example.com\/jwks",
    "accessTokenUrl": "https:\/\/example.com\/token",
    "authEndPoint": "https:\/\/example.com\/auth",
    "deploymentId": "123456789",
    "roles": "[\"Instructor\", \"Student\"]",
    "contentAccessible": "All",
    "teacherProvisioningMode": "New accounts only",
    "studentProvisioningMode": "Existing and new accounts",
    "courses": "[{\"id\":1,\"syncGrade\":true}]"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Platform Updated Successfully"
}
 

Request   

POST api/lti/updatePlatform

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   required  optional  

The ID of the LtiPlatform. Example: 1

platformId   required  optional  

The ID of the platform. Example: example.com

platformName   required  optional  

The name of the platform. Example: Example

clientId   required  optional  

The client ID of the platform. Example: 123456789

jwksUrl   required  optional  

The JWKS url of the platform. Example: https://example.com/jwks

accessTokenUrl   required  optional  

The access token URL of the platform. Example: https://example.com/token

authEndPoint   required  optional  

The authorization endpoint of the platform. Example: https://example.com/auth

deploymentId   required  optional  

The deployment ID of the platform. Example: 123456789

roles   required  optional  

The roles of the platform. Example: ["Instructor", "Student"]

contentAccessible   required  optional  

The content accessible of the platform. Example: All

teacherProvisioningMode   required  optional  

The teacher provisioning mode of the platform. Example: New accounts only

studentProvisioningMode   required  optional  

The student provisioning mode of the platform. Example: Existing and new accounts

courses   required  optional  

The courses of the platform. Example: [{"id":1,"syncGrade":true}]

Get a LTI platform by id

This endpoint return a LTI platform by id with all its associated data.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/lti/getPlatform/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/lti/getPlatform/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "platformName": "Test",
    "platformId": "https://canvas.instructure.com",
    "clientId": "1234567890",
    "jwksUrl": "https://canvas.instructure.com/api/lti/security/jwks",
    "authEndPoint": "https://canvas.instructure.com/login/oauth2/auth",
    "accessTokenUrl": "https://canvas.instructure.com/login/oauth2/token",
    "deploymentId": "1234567890",
    "contentAccessible": 1,
    "teacherProvisioningMode": "new",
    "studentProvisioningMode": "new",
    "roles": [],
    "courses": [
        {
            "id": 1,
            "name": "Course 1",
            "syncGrade": true
        }
    ],
    "id": 1
}
 

Request   

GET api/lti/getPlatform/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The id of the LTI platform. Example: 1

Tabular List

Retrieves all the LtiPlatforms in a tabular list format with pagination mode. You can apply filter using search_param via courseCategoryIds(course category ID), courseName or roleNames(user role)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/lti/tabularlist?page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C%22direction%22%3A%22desc%22%7D&search_param=%7B%22courseCategoryIds%22%3A%5B%5D%2C%22courseName%22%3A%22course+1%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/lti/tabularlist"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at","direction":"desc"}",
    "search_param": "{"courseCategoryIds":[],"courseName":"course 1"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 4,
    "recordsFiltered": 4,
    "records": [
        {
            "id": 4,
            "name": "superadmin",
            "displayName": "Super Admin",
            "createdAt": "Aug 06, 2020 07:20 AM",
            "lastLogin": "2 days ago"
        },
        {
            "id": 2,
            "name": "admin",
            "displayName": "Admin",
            "createdAt": "Aug 03, 2020 09:31 AM",
            "lastLogin": "Never"
        },
        {
            "id": 3,
            "name": "groupadmin",
            "displayName": "Group Admin",
            "createdAt": "Aug 03, 2020 09:31 AM",
            "lastLogin": "Never"
        },
        {
            "id": 1,
            "name": "student",
            "displayName": "Student",
            "createdAt": "Aug 03, 2020 09:31 AM",
            "lastLogin": "Never"
        }
    ]
}
 

Request   

GET api/lti/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 10

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at","direction":"desc"}

search_param   string  optional  

for searching items based on Course category ids, course name. Example: {"courseCategoryIds":[],"courseName":"course 1"}

Delete an LTI platform

Deletes the LTI platform along with its associated deployments and registrations from the database.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/lti/deletePlatform" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"deleteId\": \"1\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/lti/deletePlatform"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "deleteId": "1"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Platform deleted Successfully"
}
 

Request   

POST api/lti/deletePlatform

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

deleteId   required  optional  

The ID of the LTI platform to be deleted. Example: 1

Leaderboard

You can perform operations like create, edit, delete on Leaderboard Tiers.

Leaderboard Tier Tabular List

Retrieves all the leaderboard tiers in a tabular list format.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/leaderboard/tabularlist" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/leaderboard/tabularlist"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "records": [
        {
            "id": 1,
            "name": "Bronze",
            "lowerLimit": 0,
            "upperLimit": 100
        },
        {
            "id": 2,
            "name": "Silver",
            "lowerLimit": 101,
            "upperLimit": 200
        },
        {
            "id": 3,
            "name": "Gold",
            "lowerLimit": 201,
            "upperLimit": 300
        }
    ]
}
 

Request   

GET api/leaderboard/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Create a new Tier

Create a new Tier with name, lowerLimit and upperLimit.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/leaderboard/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/leaderboard/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Tier created successfully"
}
 

Request   

POST api/leaderboard/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

name   string   

The name of the Tier. Example: Level 1

lowerLimit   string   

The lower limit of the Tier. Example: 1

upperLimit   string   

The upper limit of the Tier. Example: 10

Get a Tier

Get a Tier with id.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/leaderboard/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/leaderboard/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Level 1",
    "lowerLimit": 1,
    "upperLimit": 10
}
 

Request   

GET api/leaderboard/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The id of the Tier. Example: 1

Update a Tier

Update a Tier with id, name, lowerLimit and upperLimit.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/leaderboard/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/leaderboard/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Tier updated successfully"
}
 

Request   

PUT api/leaderboard/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The id of the Tier. Example: 1

name   string   

The name of the Tier. Example: Level 1

lowerLimit   string   

The lower limit of the Tier. Example: 1

upperLimit   string   

The upper limit of the Tier. Example: 10

Delete a Tier

Delete a Tier with id.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/leaderboard/delete/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/leaderboard/delete/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Tier deleted Succesfully.",
    "success": true
}
 

Request   

POST api/leaderboard/delete/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The id of the Tier. Example: 1

Learning Paths

Learning Path Tabular List

Retrieves all the learning paths in a tabular list format in paginated mode. You can apply filter using search_param via name(learning path name).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/learning-paths/tabularlist?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22name%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-paths/tabularlist"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"name":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "name": "Test Learning Path",
            "status": "PUBLISHED",
            "display_status": "PUBLISHED",
            "created_at": "Aug 03, 2020 09:31 AM"
        }
    ]
}
 

Request   

GET api/learning-paths/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

For searching items based on field names. Example: {"name":""}

Create Learning Path

Creates a new learning path with courses, certificates, prerequisites and categories.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/learning-path/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Learning Path 1\",
    \"instructions\": \"Some Instruction\",
    \"featuredImageUrl\": \"img_path\",
    \"credits\": 70,
    \"status\": \"publish\",
    \"certificates\": [
        1,
        2
    ],
    \"prerequisites\": [
        1,
        2
    ],
    \"courses\": [
        1,
        2,
        3
    ],
    \"categories\": [
        1,
        2
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-path/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Learning Path 1",
    "instructions": "Some Instruction",
    "featuredImageUrl": "img_path",
    "credits": 70,
    "status": "publish",
    "certificates": [
        1,
        2
    ],
    "prerequisites": [
        1,
        2
    ],
    "courses": [
        1,
        2,
        3
    ],
    "categories": [
        1,
        2
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Learning Path was successfully created"
}
 

Request   

POST api/learning-path/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

Name of the learning path. Example: Learning Path 1

instructions   string  optional  

Instruction for the learning path. Example: Some Instruction

featuredImageUrl   string  optional  

Image for the learning path. Example: img_path

credits   integer  optional  

Credit after learning path completion, used in certificates. Example: 70

status   string   

learning path is in Draft or Publish mode. Status options: draft or publish. Example: publish

certificates   string[]  optional  

Certificates attached to this learning path.

prerequisites   string[]  optional  

Prerequisites courses of the learning path.

courses   string[]   

All courses you want to attach to this learning path. Minimum 2 courses are required

categories   string[]  optional  

Categories for this learning path.

Get Learning Path Details

Retrieves all the details of the specified learning path.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/learning-path/{id}?id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-path/{id}"
);

const params = {
    "id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Test Learning Path",
    "slug": "test-learning-path",
    "status": "DRAFT",
    "instructions": "Some Instruction",
    "featuredImageUrl": "img_path",
    "credits": 70,
    "certificates": [
        1
    ],
    "accredible_group_id": [
        1
    ],
    "courses": [
        {
            "label": "Course 1",
            "value": 1
        },
        {
            "label": "Course 2",
            "value": 2
        }
    ],
    "prerequisites": {
        "1": true,
        "2": false
    },
    "categories": [
        1,
        2
    ]
}
 

Request   

GET api/learning-path/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

ID of the learning path. Example: 1

Update Learning Path

Updates an existing learning path with courses, certificates, prerequisites and categories.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/learning-path/edit/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 1,
    \"name\": \"Learning Path 1\",
    \"instructions\": \"Some Instruction\",
    \"featuredImageUrl\": \"img_path\",
    \"credits\": 70,
    \"status\": \"publish\",
    \"certificates\": [
        1,
        2
    ],
    \"prerequisites\": [
        1,
        2
    ],
    \"courses\": [
        1,
        2,
        3
    ],
    \"categories\": [
        1,
        2
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-path/edit/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 1,
    "name": "Learning Path 1",
    "instructions": "Some Instruction",
    "featuredImageUrl": "img_path",
    "credits": 70,
    "status": "publish",
    "certificates": [
        1,
        2
    ],
    "prerequisites": [
        1,
        2
    ],
    "courses": [
        1,
        2,
        3
    ],
    "categories": [
        1,
        2
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Learning Path was successfully updated"
}
 

Request   

PUT api/learning-path/edit/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   integer   

ID of the learning path. Example: 1

name   string   

Name of the learning path. Example: Learning Path 1

instructions   string  optional  

Instruction for the learning path. Example: Some Instruction

featuredImageUrl   string  optional  

Image for the learning path. Example: img_path

credits   integer  optional  

Credit after learning path completion, used in certificates. Example: 70

status   string   

learning path is in Draft or Publish mode. Status options: draft or publish. Example: publish

certificates   string[]  optional  

Certificates attached to this learning path.

prerequisites   string[]  optional  

Prerequisites courses of the learning path.

courses   string[]   

All courses you want to attach to this learning path. Minimum 2 courses are required

categories   string[]  optional  

Categories for this learning path.

Delete Learning Path

Deletes the learning paths and related mapping.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/learning-path/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_ids\": [
        1,
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-path/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_ids": [
        1,
        2,
        3
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "1 learning path(s) deleted, 1 learning path(s) not deleted as it has enrollments. Please remove the students from the learning path and try again.",
    "deletedLearningPaths": 1,
    "notDeletedLearningPaths": [
        1
    ],
    "enrolledLearningPaths": [
        {
            "id": 1,
            "name": "Learning path 1"
        }
    ],
    "notDeletedPortalLearningPaths": [
        1
    ],
    "portalLearningPaths": {
        "Learning path 1": [
            {
                "id": 1,
                "name": "Portal 1"
            }
        ]
    },
    "notDeletedProductLearningPath": [
        1
    ],
    "productLearningPaths": [
        {
            "id": 1,
            "title": "Product 1"
        }
    ]
}
 

Request   

POST api/learning-path/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string[]   

Array of learning path IDs to be deleted.

Learning Path Lookup

Retrieves Learning Path details based on the search query.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/learning-path/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-path/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "learning_paths": [
        {
            "value": 1,
            "label": "Learning Path 1"
        },
        {
            "value": 2,
            "label": "Learning Path 2"
        }
    ]
}
 

Request   

POST api/learning-path/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

search_term   string   

Search term for the learning paths. Example: "Learning Path"

Enrolled Students

Retrieves all enrolled students for a learning path.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/enrolled-users?learning_path_id=1&portalId=5&page_size=10&page_number=1&order_by=registered_on&search_param=%7B%22status%22%3A%5B%22Not+Started%22%2C%22In+Progress%22%5D%2C%22nameOrEmail%22%3A%22John+Doe%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/enrolled-users"
);

const params = {
    "learning_path_id": "1",
    "portalId": "5",
    "page_size": "10",
    "page_number": "1",
    "order_by": "registered_on",
    "search_param": "{"status":["Not Started","In Progress"],"nameOrEmail":"John Doe"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "learningPathName": "Learning Path 1",
    "featuredImage": "http://localhost:8000/storage/learning_paths/1/featured_image.jpg",
    "recordsTotal": 12,
    "totalNotStarted": 3,
    "totalInProgress": 4,
    "totalCompleted": 5,
    "recordsFiltered": 12,
    "records": [
        {
            "id": 1,
            "user_id": 2,
            "first_name": "John",
            "last_name": "Doe",
            "email": "[email protected]",
            "avatar": "http://localhost:8000/storage/users/2/avatar.jpg",
            "status": "Not Started",
            "display_status": "Not Started",
            "percentComplete": 0,
            "access_status": "Allowed",
            "registered_on": "Aug 09, 2020",
            "started_on": "",
            "completed_on": "",
            "expire_on": "Never",
            "last_accessed_on": "Never",
            "certificate_count": 0,
            "user_type": "Learner",
            "raw_user_type": "learner"
        }
    ]
}
 

Request   

GET api/enrolled-users

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

learning_path_id   string   

The ID of learning path. Example: 1

portalId   string   

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

page_size   string   

Number of the results you want in each page. Example: 10

page_number   string   

Current Page number. Example: 1

order_by   string  optional  

Returns details in some order. Example: registered_on

search_param   string  optional  

Search parameters related to course. Example: {"status":["Not Started","In Progress"],"nameOrEmail":"John Doe"}

Enroll Students

To enroll users in a learning path, you need to use this request.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/learning-path/enroll/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"studentIds\": [
        2,
        3
    ],
    \"portalId\": 5
}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-path/enroll/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "studentIds": [
        2,
        3
    ],
    "portalId": 5
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "2 student(s) enrolled successfully",
    "enrolledUsersCount": 2,
    "notEnrolledUsers": 0
}
 

Request   

POST api/learning-path/enroll/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the learning path. Example: 1

Body Parameters

studentIds   string[]   

User IDs needs to be enrolled in this learning path.

portalId   integer  optional  

optional The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Remove Learners

To removes users from a learning path, you need to use this request.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/learning-path/remove/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"enrollmentIds\": [
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-path/remove/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "enrollmentIds": [
        2,
        3
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "2 student(s) removed successfully"
}
 

Request   

POST api/learning-path/remove/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the learning path. Example: 1

Body Parameters

enrollmentIds   string[]   

Enrollment IDs needs to be removed from this learning path.

Assign Certificate

Assigns a certificate to the users enrolled in a learning path using their enrollment IDs. Checks if the learning path has a certificate template available before proceeding with the assignment.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/learning-path/assignCertificate/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"enrollmentIds\": [
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-path/assignCertificate/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "enrollmentIds": [
        2,
        3
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "isSucess": true,
    "message": "Certificate assigned successfully to 2 student(s)"
}
 

Request   

POST api/learning-path/assignCertificate/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the learning path for which the certificate is being assigned. Example: 1

Body Parameters

enrollmentIds   string[]   

Enrollment IDs that need to be assigned a certificate.

Learning Path Launch

This API is used to launch learning path and get the courses associated with the learning path.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/launch?info=info%3Dtrue&portalId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/launch"
);

const params = {
    "info": "info=true",
    "portalId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "Learning Path Name",
    "featuredImageUrl": "http://example.com/featured-image.jpg",
    "instructions": "Learning Path Instructions",
    "learningPathStatus": "Active",
    "status": "Not Started",
    "display_status": "Not Started",
    "completionPercentage": 0,
    "enrollmentDate": "22-02-2022",
    "certificate": 0,
    "launchSlug": "http://example.com/launch-learning-path",
    "id": 2,
    "rating": 4.5,
    "totalEstimatedTime": "2 hours",
    "courseData": [
        {
            "name": "Course 1",
            "courseId": 3,
            "rating": 4.5,
            "status": "Not Started",
            "completion_percentage": 0,
            "featuredImageUrl": "http://example.com/featured-image.jpg",
            "slug": "http://example.com/launch-course",
            "display_status": "Not Started",
            "expire_on": "22-02-2022",
            "minimum_passing_percentage": 0,
            "certificate": 0,
            "certificate_expire_after": "Never",
            "isExpired": false,
            "isCurrent": true,
            "isLocked": false,
            "estimatedCompletionTime": "1 hour",
            "userReviewAvailable": true,
            "enableCourseRating": true
        }
    ]
}
 

Request   

GET api/launch

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

registrationId   string   

Registration ID of the learning path. Example: 2

Query Parameters

info   string  optional  

optional If the API is called with info parameter, the API will not start the learning path, but will return the information of the learning path. Example: info=true

portalId   string   

Portal ID of the user. Example: 1

Get Learning Path Details

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portalLearningPathInfo?learningPathId=1&portalId=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portalLearningPathInfo"
);

const params = {
    "learningPathId": "1",
    "portalId": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
"learningPathId": 1,
"name": "Learning Path 1",
"featuredImageUrl": "http://localhost:8000/storage/learning_paths/1/featured_image.jpg",
"instructions": "Sample instructions",
"learningPathStatus": "Active",
"status": "Not Enrolled",
"display_status": "Not Enrolled",
"completionPercentage": 0,
"enrollmentDate": "null",
"certificate": 0,
"totalEstimatedTime": "1 hour",
"rating": 4.5,
"launchSlug": "http://localhost:8000/portal/5/learning_path/1/launch",
"courseList": [
     {
         "id": 1,
         "name": "Course 1",
         "description": "Sample description",
         "rating": 4.5,
         "estimatedCompletionTime": "1 hour",
         "featuredImageUrl": "http://localhost:8000/storage/courses/1/featured_image.jpg",
         "status": "Active",
         "completionPercentage": 0,
         "status": "Not Enrolled",
         "display_status": "Not Enrolled"
     }
]
]
 

Request   

GET api/portalLearningPathInfo

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

learningPathId   string   

The ID of learning path. Example: 1

portalId   string   

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Learning Path Dropdown List

Returns a list of learning paths with their ID and Name based on the provided portal ID and search term. If a valid portal ID is provided, it filters learning paths associated with the portal. If no portal ID or an invalid one (e.g., -1) is given, it returns all learning paths.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/learning-paths/dropdownlist?portalId=5&type=public&search_term=%22Advanced%22" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-paths/dropdownlist"
);

const params = {
    "portalId": "5",
    "type": "public",
    "search_term": ""Advanced"",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Learning Path 1"
    },
    {
        "id": 2,
        "name": "Learning Path 2"
    }
]
 

Request   

GET api/learning-paths/dropdownlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer  optional  

The portal ID to filter learning paths by portal. Use -1 to skip portal filtering. Example: 5

type   string  optional  

The type of listing required (private/public). Example: public

search_term   string  optional  

The search term to filter learning paths by name. Example: "Advanced"

Learning Path Detail Report

Retrieves learning path detail report based on the parameters provided.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/learning-path/reports/learning-path-detailed?page_size=10&page_number=1&order_by=%7B%22colName%22%3A+%22registered_on%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22status%22%3A+%5B%22registered%22%2C+%22started%22%5D%2C+%22registered_on%22%3A+%5B%222021-01-01%22%2C+%222021-01-31%22%5D%2C+%22completed_on%22%3A+%5B%222021-01-01%22%2C+%222021-01-31%22%5D%2C+%22nameOrEmail%22%3A+%22John+Doe%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-path/reports/learning-path-detailed"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName": "registered_on", "direction": "desc"}",
    "search_param": "{"status": ["registered", "started"], "registered_on": ["2021-01-01", "2021-01-31"], "completed_on": ["2021-01-01", "2021-01-31"], "nameOrEmail": "John Doe"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsFiltered": 10,
    "records": [
        {
            "user_id": 1,
            "first_name": "John",
            "last_name": "Doe",
            "email": "[email protected]",
            "learning_path_name": "Learning Path 1",
            "status": "registered",
            "display_status": "Registered",
            "registered_on": "01-Jan-2021",
            "started_on": "05-Jan-2021",
            "completed_on": "10-Jan-2021",
            "last_accessed_on": "10-Jan-2021",
            "certifcate_issued": "Yes",
            "courseDetails": [],
            "total_time_spent": 10,
            "expire_on": "Never",
            "completed_lp_courses": 2,
            "total_lp_courses": 5,
            "portalName": "Portal 1"
        },
        {
            "user_id": 2,
            "first_name": "Jane",
            "last_name": "Doe",
            "email": "[email protected]",
            "learning_path_name": "Learning Path 2",
            "status": "started",
            "display_status": "Started",
            "registered_on": "01-Jan-2021",
            "started_on": "05-Jan-2021",
            "completed_on": "10-Jan-2021",
            "last_accessed_on": "10-Jan-2021",
            "certifcate_issued": "No",
            "courseDetails": [],
            "total_time_spent": 10,
            "expire_on": "Never",
            "completed_lp_courses": 2,
            "total_lp_courses": 5,
            "portalName": "Portal 1"
        }
    ]
}
 

Request   

GET api/learning-path/reports/learning-path-detailed

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

searchPortalIds   string   

Portal IDs to filter learning paths by portal. Example: [1,2]

learning_path_ids   string   

Learning Path IDs to filter learning paths by ID. Example: [1,2]

Query Parameters

page_size   string   

The number of results per page. Example: 10

page_number   string   

The current page number. Example: 1

order_by   string  optional  

optional The column to sort the results by. Example: {"colName": "registered_on", "direction": "desc"}

search_param   string  optional  

optional The search query parameters. Example: {"status": ["registered", "started"], "registered_on": ["2021-01-01", "2021-01-31"], "completed_on": ["2021-01-01", "2021-01-31"], "nameOrEmail": "John Doe"}

Retrieves an overview report of learning paths, including the status of enrollments.

This function aggregates the enrollment statuses (Not Started, In Progress, Completed) for each learning path, and calculates the percentage of completed enrollments. It takes into account portal-specific filters if provided.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/learning-path/reports/overview?searchPortalIds[]=1&searchPortalIds[]=2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-path/reports/overview"
);

const params = {
    "searchPortalIds[0]": "1",
    "searchPortalIds[1]": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "labels": [
        "Learning Path 1",
        "Learning Path 2"
    ],
    "totalNotStarted": [
        5,
        3
    ],
    "totalInProgress": [
        2,
        4
    ],
    "totalCompleted": [
        3,
        3
    ],
    "percentageCompleted": [
        30,
        50
    ],
    "sumNotStarted": 8,
    "sumInProgress": 6,
    "sumCompleted": 6,
    "sumPercentageCompleted": 37
}
 

Request   

GET api/learning-path/reports/overview

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

searchPortalIds   string[]  optional  

Optional array of portal IDs for filtering learning paths.

Clone a learning path

This function clones a learning path and its associated courses and categories. It takes into account the user who initiated the request and records the user as the creator and updater of the cloned learning path.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/learning-path/clone?learningPathId=1&isDeepCopy=true" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-path/clone"
);

const params = {
    "learningPathId": "1",
    "isDeepCopy": "true",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Learning Path Cloned Successfully"
}
 

Request   

POST api/learning-path/clone

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

learningPathId   string   

The ID of learning path to clone. Example: 1

isDeepCopy   string   

Whether to clone the learning path with its courses and categories. Example: true

Learning Path Activities

Retrieves all the activities for a learning path based on the context provided. Context can be either 'portal' or 'lp'. If context is 'portal', it will return all activities for the portal. If context is 'lp', it will return all activities for the learning path.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/learning-path-activities?learning_path_id=1&page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22name%22%3A%22%22%7D&context=portal+or+lp&portalId=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-path-activities"
);

const params = {
    "learning_path_id": "1",
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"name":""}",
    "context": "portal or lp",
    "portalId": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "name": "Test Activity",
            "status": "PUBLISHED",
            "created_at": "Aug 03, 2020 09:31 AM"
        }
    ]
}
 

Request   

GET api/learning-path-activities

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

learning_path_id   string   

The ID of learning path. Example: 1

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

For searching items based on field names. Example: {"name":""}

context   string   

The context of the activities. Example: portal or lp

portalId   string   

The portal ID to filter activities by portal. Example: 5

Learning Path Activities Lookup

Retrieves all the activities name performed by students in a learning path. Helps showing options in dropdowns elements

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/learning-path-activities/verb/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/learning-path-activities/verb/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "ENROLLED",
        "display_value": "ENROLLED"
    },
    {
        "db_value": "STARTED",
        "display_value": "STARTED"
    },
    {
        "db_value": "ACCESSED",
        "display_value": "ACCESSED"
    },
    {
        "db_value": "COMPLETED",
        "display_value": "COMPLETED"
    },
    {
        "db_value": "ACHIEVED CERTIFICATE",
        "display_value": "ACHIEVED CERTIFICATE"
    },
    {
        "db_value": "REMOVED",
        "display_value": "REMOVED"
    }
]
 

Request   

GET api/learning-path-activities/verb/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Location

You can perform operations like create, edit, delete on locations

Create a new location.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/location/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"location_name\": \"New York\",
    \"address\": \"New York, USA\",
    \"city\": \"New York\",
    \"country\": \"USA\",
    \"zipcode\": \"10001\",
    \"map_url\": \"https:\\/\\/www.google.com\\/maps\\/search\\/?api=1&query=New+York\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/location/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "location_name": "New York",
    "address": "New York, USA",
    "city": "New York",
    "country": "USA",
    "zipcode": "10001",
    "map_url": "https:\/\/www.google.com\/maps\/search\/?api=1&query=New+York"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Location Created Successfully"
}
 

Request   

POST api/location/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

location_name   required  optional  

The name of the location. Example: New York

address   The  optional  

address of the location. Example: New York, USA

city   The  optional  

city of the location. Example: New York

country   The  optional  

country of the location. Example: USA

zipcode   The  optional  

zipcode of the location. Example: 10001

map_url   The  optional  

map URL of the location. Example: https://www.google.com/maps/search/?api=1&query=New+York

Location Tabular List

Retrieves all the locations in a tabular list format with pagination mode. You can apply filter using search_param via locationName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/location/tabularlist?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C%22direction%22%3A%22desc%22%7D&search_param=%7B%22locationName%22%3A%22New+York%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/location/tabularlist"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at","direction":"desc"}",
    "search_param": "{"locationName":"New York"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "name": "New York",
            "address": "New York, USA",
            "city": "New York",
            "country": "USA",
            "zipcode": "10001",
            "map_url": "https://www.google.com/maps/search/?api=1&query=New+York",
            "created_at": "Aug 11, 2020 02:12 PM"
        }
    ]
}
 

Request   

GET api/location/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the locations you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at","direction":"desc"}

search_param   string  optional  

for searching items based on location name. Example: {"locationName":"New York"}

Get Location

Retrieves an existing location by given ID.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/location/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/location/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "New York",
    "address": "New York, USA",
    "city": "New York",
    "country": "USA",
    "zipcode": "10001",
    "map_url": "https://www.google.com/maps/search/?api=1&query=New+York",
    "created_by": 1,
    "created_at": "2020-08-11 02:12:00"
}
 

Request   

GET api/location/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer   

The ID of the location to be retrieved. Example: 1

Update Location

Updates an existing location's details using the provided ID.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/location/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"location_name\": \"New York\",
    \"address\": \"New York, USA\",
    \"city\": \"New York\",
    \"country\": \"USA\",
    \"zipcode\": \"10001\",
    \"map_url\": \"https:\\/\\/www.google.com\\/maps\\/search\\/?api=1&query=New+York\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/location/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "location_name": "New York",
    "address": "New York, USA",
    "city": "New York",
    "country": "USA",
    "zipcode": "10001",
    "map_url": "https:\/\/www.google.com\/maps\/search\/?api=1&query=New+York"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Location Updated Successfully"
}
 

Request   

PUT api/location/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer   

The ID of the location to be updated. Example: 1

Body Parameters

location_name   string   

The name of the location. Example: New York

address   string  optional  

The address of the location. Example: New York, USA

city   string  optional  

The city of the location. Example: New York

country   string  optional  

The country of the location. Example: USA

zipcode   string  optional  

The zipcode of the location. Example: 10001

map_url   string  optional  

The map URL of the location. Example: https://www.google.com/maps/search/?api=1&query=New+York

Delete Location

To delete a location, you need to use this request. Returns number of location deleted(if multiple selected) and also not deleted. (See Response)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/location/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_ids\": [
        1,
        12,
        15
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/location/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_ids": [
        1,
        12,
        15
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "3 location(s) deleted 2 location(s) not deleted as it is used in class(s). Please remove the location from the class(s) and try again.",
    "deletedLocations": 3
}
 

Request   

POST api/location/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string[]   

All location IDs which needs to be deleted.

Location Lookup

Returns array of location data, containing location id and name.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/locations/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"search_term\": \"\\\"New York\\\"\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/locations/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "search_term": "\"New York\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


[
    {
        "value": 1,
        "label": "New York"
    },
    {
        "value": 2,
        "label": "Los Angeles"
    }
]
 

Request   

POST api/locations/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

search_term   string   

The search term for location name. Example: "New York"

Media

Endpoints for handling and managing upload/downloads static files, assets and media

Upload Media

Handles the media upload request via both chunked and non-chunked approach. The request is determined by the presence of file object in the request. If the request contains a file object, it is saved directly to s3-pending folder. If the request does not contain a file object, it is assumed to be a chunked upload request. The chunk is saved to local chunks folder and if it is the last chunk, it is combined and saved to s3-pending folder. The delete request is handled by deleting the chunks folder for the given deleteId.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/media?patch=ut&deleteId=nobis" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/media"
);

const params = {
    "patch": "ut",
    "deleteId": "nobis",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "is_success": true,
    "code": 200,
    "errorMessage": null,
    "uploadedMedia": {
        "id": 3,
        "file_name": "default-certificate-8741bc53eb39d4154c232925c0f13088.png",
        "file_type": "Images",
        "status": "Completed",
        "s3_url": "https://aom-uploads-test.s3.us-west-2.amazonaws.com/public/default-certificate-8741bc53eb39d4154c232925c0f13088.png",
        "mux_url": null,
        "mime_type": "image/png",
        "created_at": "Aug 12, 2020 09:02 AM"
    }
}
 

Request   

POST api/media

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

patch   string  optional  

The file handler ID that is used to identify the chunked upload request. Example: ut

deleteId   string  optional  

The file handler ID that is used to identify the chunked upload request to be deleted. Example: nobis

Upload Media

Handles the media upload request via both chunked and non-chunked approach. The request is determined by the presence of file object in the request. If the request contains a file object, it is saved directly to s3-pending folder. If the request does not contain a file object, it is assumed to be a chunked upload request. The chunk is saved to local chunks folder and if it is the last chunk, it is combined and saved to s3-pending folder. The delete request is handled by deleting the chunks folder for the given deleteId.

Example request:
curl --request PATCH \
    "https://demo.aomlms.com/api/media?patch=ullam&deleteId=sit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/media"
);

const params = {
    "patch": "ullam",
    "deleteId": "sit",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PATCH",
    headers,
}).then(response => response.json());

Example response (200):


{
    "is_success": true,
    "code": 200,
    "errorMessage": null,
    "uploadedMedia": {
        "id": 3,
        "file_name": "default-certificate-8741bc53eb39d4154c232925c0f13088.png",
        "file_type": "Images",
        "status": "Completed",
        "s3_url": "https://aom-uploads-test.s3.us-west-2.amazonaws.com/public/default-certificate-8741bc53eb39d4154c232925c0f13088.png",
        "mux_url": null,
        "mime_type": "image/png",
        "created_at": "Aug 12, 2020 09:02 AM"
    }
}
 

Request   

PATCH api/media

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

patch   string  optional  

The file handler ID that is used to identify the chunked upload request. Example: ullam

deleteId   string  optional  

The file handler ID that is used to identify the chunked upload request to be deleted. Example: sit

Upload Media

Handles the media upload request via both chunked and non-chunked approach. The request is determined by the presence of file object in the request. If the request contains a file object, it is saved directly to s3-pending folder. If the request does not contain a file object, it is assumed to be a chunked upload request. The chunk is saved to local chunks folder and if it is the last chunk, it is combined and saved to s3-pending folder. The delete request is handled by deleting the chunks folder for the given deleteId.

Example request:
curl --request DELETE \
    "https://demo.aomlms.com/api/media?patch=quasi&deleteId=in" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/media"
);

const params = {
    "patch": "quasi",
    "deleteId": "in",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "DELETE",
    headers,
}).then(response => response.json());

Example response (200):


{
    "is_success": true,
    "code": 200,
    "errorMessage": null,
    "uploadedMedia": {
        "id": 3,
        "file_name": "default-certificate-8741bc53eb39d4154c232925c0f13088.png",
        "file_type": "Images",
        "status": "Completed",
        "s3_url": "https://aom-uploads-test.s3.us-west-2.amazonaws.com/public/default-certificate-8741bc53eb39d4154c232925c0f13088.png",
        "mux_url": null,
        "mime_type": "image/png",
        "created_at": "Aug 12, 2020 09:02 AM"
    }
}
 

Request   

DELETE api/media

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

patch   string  optional  

The file handler ID that is used to identify the chunked upload request. Example: quasi

deleteId   string  optional  

The file handler ID that is used to identify the chunked upload request to be deleted. Example: in

Tabular List

Retrieves all the media in a tabular list format with pagination mode. You can apply filter using search_param via name(media name), file_type(file type).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/media/tabularlist?page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C%22direction%22%3A%22desc%22%7D&search_param=%7B%22name%22%3A%22media+name%22%2C%22file_type%22%3A%22Images%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/media/tabularlist"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at","direction":"desc"}",
    "search_param": "{"name":"media name","file_type":"Images"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 4,
    "recordsFiltered": 4,
    "records": [
        {
            "id": 4,
            "file_name": "default-certificate-8741bc53eb39d4154c232925c0f13088.png",
            "file_type": "Images",
            "status": "Completed",
            "s3_url": "https://aom-uploads-test.s3.us-west-2.amazonaws.com/public/default-certificate-8741bc53eb39d4154c232925c0f13088.png",
            "mux_url": null,
            "mime_type": "image/png",
            "created_at": "Aug 12, 2020 09:02 AM"
        }
    ]
}
 

Request   

GET api/media/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the media you want for a page. Example: 10

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at","direction":"desc"}

search_param   string  optional  

for searching items based on media name, file type. Example: {"name":"media name","file_type":"Images"}

Delete Media

This API is used to delete the uploaded media from the storage. It will also delete the video files from MUX if the file type is Video.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/media/delete?delete_ids=qui" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/media/delete"
);

const params = {
    "delete_ids": "qui",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "2 media(s) deleted",
    "errorMessage": "2 media(s) not deleted, Something went wrong! try again",
    "fileNotDeleted": 2
}
 

Request   

POST api/media/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

delete_ids   string   

The array of media IDs which needs to be deleted. example: [1,2,3] Example: qui

Get Media Status

Returns the status of the uploaded media. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/media/status?id=error" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/media/status"
);

const params = {
    "id": "error",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "Completed"
}
 

Request   

GET api/media/status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

The ID of the media. Example: error

Download Mux Video

This API is used to download the uploaded video from MUX service. If the master access is not enabled as temporary, this API will enable it. If the master access is already enabled as temporary, this API will return the download URL directly.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/media/mux/download?mux_id=7K0103V01NFz01" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/media/mux/download"
);

const params = {
    "mux_id": "7K0103V01NFz01",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "ready",
    "downloadUrl": "https://stream.mux.com/7K0103V01NFz01?download=1&filename=example.mp4"
}
 

Request   

POST api/media/mux/download

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

mux_id   string   

The MUX ID of the video to download. Example: 7K0103V01NFz01

Save Video

This API is used to save the uploaded video media to the database. It takes videoGuid and fileName as input and returns the uploaded media.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/media/saveVideo?videoGuid=d2c0faa3-9d15-49c4-ae11-9b2c9a5c0a7c&fileName=test.mp4&mimeType=video%2Fmp4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/media/saveVideo"
);

const params = {
    "videoGuid": "d2c0faa3-9d15-49c4-ae11-9b2c9a5c0a7c",
    "fileName": "test.mp4",
    "mimeType": "video/mp4",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "is_success": true,
    "code": 200,
    "errorMessage": "Unable to upload the media. Please contact admin",
    "uploadedMedia": {
        "id": 4,
        "file_name": "test.mp4",
        "mime_type": "video/mp4",
        "bunny_video_id": "d2c0faa3-9d15-49c4-ae11-9b2c9a5c0a7c",
        "s3_url": "https://aom.b-cdn.net/d2c0faa3-9d15-49c4-ae11-9b2c9a5c0a7c/original",
        "bunny_video_url": "https://aom.b-cdn.net/d2c0faa3-9d15-49c4-ae11-9b2c9a5c0a7c/playlist.m3u8",
        "file_type": "Videos",
        "status": "Processing",
        "created_at": "2021-08-05T06:44:12.000000Z",
        "updated_at": "2021-08-05T06:44:12.000000Z"
    }
}
 

Request   

POST api/media/saveVideo

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

videoGuid   string   

The videoGuid of the uploaded video. Example: d2c0faa3-9d15-49c4-ae11-9b2c9a5c0a7c

fileName   string   

The name of the uploaded video. Example: test.mp4

mimeType   string   

The mime type of the uploaded video. Example: video/mp4

Get BunnyCDN Details

To get the BunnyCDN library id and api key, you need to use this request. It will return the BunnyCDN library id and api key based on the environment. If the request is from localhost, it will return the values from .env file. If the request is from production environment, it will return the values from database.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/media/bunnyDetails" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/media/bunnyDetails"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "libraryId": "a1b2c3d4-library-7890",
    "apiKey": "9b7e4c08-3d2f-4a1c-86f2-1e4b2d8f1234"
}
 

Request   

GET api/media/bunnyDetails

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Create Bunny Video Library

This function creates a new video library on Bunny.net. It sends a POST request to the Bunny API with the site title and replication regions. On successful creation, it updates the local configuration with the new library ID, API key, and pull zone ID. It also fetches the pull zone name and updates the meta information accordingly.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/media/createBunnyVideoLibrary" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/media/createBunnyVideoLibrary"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (201):


{
    "is_success": true,
    "bunny_library_id": "123456",
    "bunny_api_key": "9b7e4c08-3d2f-4a1c-86f2-1e4b2d8f1234"
}
 

Example response (500):


{
    "is_success": false,
    "message": "Error message"
}
 

Request   

GET api/media/createBunnyVideoLibrary

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Memberships

Memberships are used to provide content access to users. Helps in providing course and standalone modules access to learners

Lookup memberships

Retrieves the memberships matching the search term provided in the request. If the portalId is provided, it will fetch memberships which are attached to the portal.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/memberships/lookup?search_term=membership+1&portalId=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/memberships/lookup"
);

const params = {
    "search_term": "membership 1",
    "portalId": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "membership 1"
    },
    {
        "id": 2,
        "name": "membership 2"
    }
]
 

Request   

GET api/memberships/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

search_term   string   

The search term to search for memberships. Example: membership 1

portalId   string   

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Retrieve Memberships in a Tabular List

Returns a paginated list of memberships in a tabular format with optional filters and sorting.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/memberships/tabularlist?page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C%22direction%22%3A%22desc%22%7D&search_param=%7B%22name%22%3A%22Basic+Membership%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/memberships/tabularlist"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at","direction":"desc"}",
    "search_param": "{"name":"Basic Membership"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 100,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "name": "Basic Membership",
            "expired_at": "2023-12-31 23:59:59",
            "author": "Admin",
            "created_at": "2023-01-01 00:00:00"
        }
    ]
}
 

Request   

GET api/memberships/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of memberships to display per page. Example: 10

page_number   string   

The current page number for pagination. Example: 1

order_by   string  optional  

A JSON object specifying the column and direction for sorting. Example: {"colName":"created_at","direction":"desc"}

search_param   string  optional  

A JSON object for filtering memberships by name. Example: {"name":"Basic Membership"}

Get a membership by ID

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/membership/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/membership/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Gold-membership",
    "courseAccess": "all",
    "moduleAccess": "all",
    "expired_at": "2021-10-03 23:59:59",
    "courseAccessCategories": [
        1,
        2
    ],
    "moduleAccessCategories": [
        5,
        19
    ]
}
 

Request   

GET api/membership/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the membership. Example: 1

Create a new membership

Creates a new membership with course and module access rules.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/membership" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Gold-membership\",
    \"courseAccess\": \"all\",
    \"moduleAccess\": \"all\",
    \"courseAccessCategories\": [
        1,
        2
    ],
    \"moduleAccessCategories\": [
        5,
        19
    ],
    \"expired_at\": \"\'2021-10-03 23:59:59\'\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/membership"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Gold-membership",
    "courseAccess": "all",
    "moduleAccess": "all",
    "courseAccessCategories": [
        1,
        2
    ],
    "moduleAccessCategories": [
        5,
        19
    ],
    "expired_at": "'2021-10-03 23:59:59'"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Membership created successfully"
}
 

Request   

POST api/membership

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   required  optional  

The name of the membership. Example: Gold-membership

courseAccess   required  optional  

The type of course access. {all, no_access, specific} Only these values allowed. Example: all

moduleAccess   required  optional  

The type of module access. {all, no_access, specific} Only these values allowed. Example: all

courseAccessCategories   string[]  optional  

Any course category IDs if you have selected specific in courseAccess parameter.

moduleAccessCategories   string[]  optional  

Any module category IDs if you have selected specific in moduleAccess parameter.

expired_at   string  optional  

Expire date for the membership. Example: '2021-10-03 23:59:59'

Update Membership

Updates the details of a specified membership. (See Parameters) Membership is being used as to couple courses and standalone modules for students to launch and view.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/membership/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Gold-membership\",
    \"courseAccess\": \"all\",
    \"moduleAccess\": \"all\",
    \"courseAccessCategories\": [
        1,
        2
    ],
    \"moduleAccessCategories\": [
        5,
        19
    ],
    \"expired_at\": \"\'2021-10-03 23:59:59\'\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/membership/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Gold-membership",
    "courseAccess": "all",
    "moduleAccess": "all",
    "courseAccessCategories": [
        1,
        2
    ],
    "moduleAccessCategories": [
        5,
        19
    ],
    "expired_at": "'2021-10-03 23:59:59'"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Membership created successfully"
}
 

Request   

PUT api/membership/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the membership. Example: 1

Body Parameters

name   required  optional  

The name of the membership. Example: Gold-membership

courseAccess   required  optional  

The type of course access. {all, no_access, specific} Only these values allowed. Example: all

moduleAccess   required  optional  

The type of module access. {all, no_access, specific} Only these values allowed. Example: all

courseAccessCategories   string[]  optional  

Any course category IDs if you have selected specific in courseAccess parameter.

moduleAccessCategories   string[]  optional  

Any module category IDs if you have selected specific in moduleAccess parameter.

expired_at   string  optional  

Expire date for the membership. Example: '2021-10-03 23:59:59'

Quick Edit

Updates the details in bulk for a specified membership. Parameters is provided which needs to be updated.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/membership/quickEdit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"membership_ids\": [
        3,
        2
    ],
    \"expired_at\": \"2021-01-11 23:45:00\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/membership/quickEdit"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "membership_ids": [
        3,
        2
    ],
    "expired_at": "2021-01-11 23:45:00"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Memberships updated Successfully"
}
 

Request   

POST api/membership/quickEdit

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

membership_ids   string[]   

All membership IDs which needs to be updated.

expired_at   string   

Expiry date for the selected memberships. Example: 2021-01-11 23:45:00

Menus

Menus are used as front end module for this platform. Endpoints for managing menus on marketing front end pages

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/menus/list" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/menus/list"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Main Menu",
        "items": [
            {
                "label": "Home",
                "type": "page",
                "custom_link": null,
                "page_id": 1,
                "display_order": 1,
                "css_class": null,
                "restrictions": null,
                "open_in_new_tab": false,
                "level": 1,
                "isCollapsed": true,
                "hyperlink": "/"
            },
            {
                "label": "Courses",
                "type": "page",
                "custom_link": null,
                "page_id": 2,
                "display_order": 2,
                "css_class": null,
                "restrictions": null,
                "open_in_new_tab": false,
                "level": 1,
                "isCollapsed": true,
                "hyperlink": "http://localhost:8000/course-catalog"
            },
            {
                "label": "Our Team",
                "type": "page",
                "custom_link": null,
                "page_id": 3,
                "display_order": 3,
                "css_class": null,
                "restrictions": null,
                "open_in_new_tab": false,
                "level": 1,
                "isCollapsed": true,
                "hyperlink": "http://localhost:8000/about-us"
            },
            {
                "label": "Contact Us",
                "type": "page",
                "custom_link": null,
                "page_id": 6,
                "display_order": 4,
                "css_class": null,
                "restrictions": null,
                "open_in_new_tab": false,
                "level": 1,
                "isCollapsed": true,
                "hyperlink": "http://localhost:8000/contact-us"
            }
        ]
    },
    {
        "id": 2,
        "name": "Top Bar Menu",
        "items": [
            {
                "label": "Dashboard",
                "type": "custom_link",
                "custom_link": "/dashboard",
                "page_id": null,
                "display_order": 1,
                "css_class": null,
                "restrictions": null,
                "open_in_new_tab": false,
                "level": 1,
                "isCollapsed": true,
                "hyperlink": "/dashboard"
            },
            {
                "label": "Cart",
                "type": "page",
                "custom_link": null,
                "page_id": 5,
                "display_order": 2,
                "css_class": null,
                "restrictions": null,
                "open_in_new_tab": false,
                "level": 1,
                "isCollapsed": true,
                "hyperlink": "http://localhost:8000/cart"
            }
        ]
    },
    {
        "id": 3,
        "name": "Footer Menu",
        "items": []
    }
]
 

Request   

GET api/menus/list

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/menus/items/5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/menus/items/5"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "label": "Home",
        "type": "page",
        "custom_link": null,
        "page_id": 1,
        "display_order": 1,
        "css_class": null,
        "restrictions": null,
        "open_in_new_tab": false,
        "level": 1,
        "isCollapsed": true,
        "hyperlink": "/"
    },
    {
        "label": "Courses",
        "type": "page",
        "custom_link": null,
        "page_id": 2,
        "display_order": 2,
        "css_class": null,
        "restrictions": null,
        "open_in_new_tab": false,
        "level": 1,
        "isCollapsed": true,
        "hyperlink": "http://localhost:8000/course-catalog"
    }
]
 

Request   

GET api/menus/items/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The id of the menu to be retrieved. Example: 5

This endpoint accepts a list of menus with their associated items, deletes existing items, and inserts the new items accordingly.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/menus" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"menuList\": [
        {
            \"id\": 1,
            \"items\": [
                {
                    \"label\": \"Home\",
                    \"icon\": \"home-icon\",
                    \"type\": \"custom\",
                    \"css_class\": \"nav-item\",
                    \"restrictions\": [],
                    \"open_in_new_tab\": false,
                    \"level\": 1,
                    \"custom_link\": \"\\/home\"
                }
            ]
        }
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/menus"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "menuList": [
        {
            "id": 1,
            "items": [
                {
                    "label": "Home",
                    "icon": "home-icon",
                    "type": "custom",
                    "css_class": "nav-item",
                    "restrictions": [],
                    "open_in_new_tab": false,
                    "level": 1,
                    "custom_link": "\/home"
                }
            ]
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Menu updated successfully"
}
 

Request   

POST api/menus

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

menuList   string[]   

The list of menus with their items.

Modules

A module is a lesson that you add as course content. Modules could be Text, Video, PDF, SCORM, Quiz, Assignments or Survey. Helps in performing CRUD operation to and for modules.

Create Blank Module

Handles the creation of a blank module with the provided name and type. Validates the request data and saves a new module record in the database. Sets the created_by and updated_by fields to the ID of the authenticated user. Returns the ID and icon of the created module in JSON format.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/modules/addBlank" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Introduction\",
    \"type\": \"text\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/addBlank"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Introduction",
    "type": "text"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "icon": "<i class=\"el-icon-document\"></i>"
}
 

Request   

POST api/modules/addBlank

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

The name of the module. Example: Introduction

type   string   

The type of the module. Example: text

Modules Lookup

Retrieves all the modules. Helps while showing modules names in form elements like dropdown. You can apply filters using search_term parameter. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/lookup?search_term=Introduction" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/lookup"
);

const params = {
    "search_term": "Introduction",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Introduction",
        "type": "text",
        "icon": "<i class=\"el-icon-document\"></i>",
        "value": 1,
        "label": "Introduction"
    }
]
 

Request   

GET api/modules/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

search_term   string   

The name or substring of the module name to search for that module. Example: Introduction

Get Pending Module Submissions

Returns the total number of pending module submissions (status = "Submitted") across all courses. Also returns a breakdown of pending submissions grouped by course.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/pendingsubmissions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/pendingsubmissions"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "totalPending": 25,
    "data": [
        {
            "id": 1,
            "name": "Leadership Training",
            "featured_image_url": "https://example.com/images/course1.jpg",
            "totalSubmission": 10
        },
        {
            "id": 2,
            "name": "Compliance Basics",
            "featured_image_url": "https://example.com/images/course2.jpg",
            "totalSubmission": 15
        }
    ]
}
 

Request   

GET api/modules/pendingsubmissions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Module Types Lookup

Retrieves all the types of modules supported by the platform. Useful for displaying options in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/type/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/type/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "text",
        "display_value": "Text"
    },
    {
        "db_value": "video",
        "display_value": "Video"
    },
    {
        "db_value": "pdf",
        "display_value": "PDF"
    },
    {
        "db_value": "powerpoint",
        "display_value": "Powerpoint"
    },
    {
        "db_value": "flashcards",
        "display_value": "Flash Cards"
    },
    {
        "db_value": "scorm",
        "display_value": "SCORM/xAPI"
    },
    {
        "db_value": "quiz",
        "display_value": "Quiz"
    },
    {
        "db_value": "assignment",
        "display_value": "Assignment"
    },
    {
        "db_value": "discussion",
        "display_value": "Discussion"
    },
    {
        "db_value": "survey",
        "display_value": "Survey"
    }
]
 

Request   

GET api/modules/type/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Form Field Types Lookup

Retrieves all the types of form fields that are supported for surveys. Useful for displaying options in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/fieldtype/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/fieldtype/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "text",
        "display_value": "Survey Text"
    },
    {
        "db_value": "textarea",
        "display_value": "Text Area"
    },
    {
        "db_value": "rating",
        "display_value": "Rating"
    },
    {
        "db_value": "radio",
        "display_value": "Single Select"
    },
    {
        "db_value": "checkbox",
        "display_value": "Multiple Select"
    },
    {
        "db_value": "dropdown",
        "display_value": "Drop Down"
    }
]
 

Request   

GET api/modules/fieldtype/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Modules Tabular List

Retrieves all the modules in a tabular list format in paginated mode. You can apply filter using search_param via associatedCourse(modules used in course) and moduleName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/tabularlist?page_size=10&page_number=1&order_by=%7B%22colName%22%3A+%22name%22%2C+%22direction%22%3A+%22asc%22%7D&search_param=%7B%22associatedCourse%22%3A%22%22%2C%22moduleName%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/tabularlist"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName": "name", "direction": "asc"}",
    "search_param": "{"associatedCourse":"","moduleName":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "name": "Home Page",
            "slug": "home-page",
            "type": "text",
            "icon": "<i class=\"el-icon-document\"></i>",
            "author": "John Doe",
            "created_at": "2021-01-01 12:00:00"
        }
    ]
}
 

Request   

GET api/modules/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 10

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName": "name", "direction": "asc"}

search_param   string  optional  

for searching items based on field names. Example: {"associatedCourse":"","moduleName":""}

Quick Edit Modules

This endpoint allows bulk updating of modules and their related details based on the provided module type. It updates fields like created_by, updated_by, no_of_retakes_allowed, and minimum_percentage for the selected modules.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/module/quickEdit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"module_ids\": [
        1,
        2,
        3
    ],
    \"type\": \"quiz\",
    \"author_id\": 5,
    \"noOfRetakesAllowed\": 3,
    \"minimumPassingMarks\": 60
}"
const url = new URL(
    "https://demo.aomlms.com/api/module/quickEdit"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "module_ids": [
        1,
        2,
        3
    ],
    "type": "quiz",
    "author_id": 5,
    "noOfRetakesAllowed": 3,
    "minimumPassingMarks": 60
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Modules updated Successfully"
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "module_ids": [
            "Please select at least one module"
        ]
    }
}
 

Request   

POST api/module/quickEdit

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

module_ids   string[]   

The IDs of the modules to update.

type   string   

The type of module (used to determine the model class). Example: quiz

author_id   integer  optional  

The new author ID to assign as created_by. Example: 5

noOfRetakesAllowed   integer  optional  

The number of allowed retakes for the module. Example: 3

minimumPassingMarks   integer  optional  

The minimum passing percentage. Example: 60

Deletes the specified modules.

This function is responsible for deleting the selected modules. The request should contain the IDs of the modules to be deleted.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/modules/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_ids\": [
        1,
        2
    ],
    \"type\": \"quiz\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_ids": [
        1,
        2
    ],
    "type": "quiz"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


[
 "message" => "2 module(s) deleted. 1 module(s) not deleted as it is used in course(s). Please remove the modules from the course and try again.",
 "deletedModules" => [1,2],
 "notDeletedModules" => [3],
 "usedInCourses" => [
     "module1" => [
         [
             "id" => 1,
             "name" => "Course1"
         ]
     ],
     "module2" => [
         [
             "id" => 2,
             "name" => "Course2"
         ]
     ]
 ]
]
 

Request   

POST api/modules/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string[]   

The IDs of all the modules which needs to be deleted.

type   string   

The type of module (used to determine the model class). Example: quiz

Clone a module.

Clones the module with its corresponding details and mappings. The newly generated cloned module will help to let you change the content of the module with or without letting affect the real module.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/modules/clone" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"moduleId\": 1,
    \"isDeepCopy\": false
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/clone"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "moduleId": 1,
    "isDeepCopy": false
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Module Cloned Successfully"
}
 

Request   

POST api/modules/clone

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

moduleId   integer   

ID of the module to be cloned. Example: 1

isDeepCopy   boolean   

If true, content will be affected in real module if changes made in cloned module. Example: false

Quiz Lookup

Retrieves all the quiz modules. Helps while showing quiz names in form elements like dropdown. You can apply filters using search_term parameter. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/quiz/lookup?search_term=Final+quiz" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/quiz/lookup"
);

const params = {
    "search_term": "Final quiz",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "value": 1,
        "label": "First-quiz"
    },
    {
        "value": 2,
        "label": "Quiz-2"
    }
]
 

Request   

GET api/quiz/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

search_term   string   

The name or substring of the quiz name to search for that module. Example: Final quiz

PDFs

A PDF Module is a lesson module used as course content. Helps to perform CRUD operation to and for PDF modules.

PDF Modules Tabular List

Returns all the PDF modules in a tabular list format in paginated mode. You can apply filter using search_param via moduleTypes(module type), associatedCourse(modules used in course) and moduleName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/pdf?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=%7B%22moduleTypes%22%3A+%5B%22pdf%22%5D%2CassociatedCourse%22%3A%22%22%2C%22moduleName%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/pdf"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"moduleTypes": ["pdf"],associatedCourse":"","moduleName":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "name": "JavaScript Basics",
            "slug": "javascript-basics",
            "type": "pdf",
            "icon": "<i class=\"el-icon-document\"></i>",
            "author": "Aom Staff",
            "created_at": "Aug 03, 2020 09:56 AM",
            "course_count": 1
        }
    ]
}
 

Request   

GET api/modules/pdf

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}}

search_param   string  optional  

for searching items based on field names. Example: {"moduleTypes": ["pdf"],associatedCourse":"","moduleName":""}

Create PDF Module

Creates a new pdf module. (See parameters)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/modules/pdf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Getting Started\",
    \"content\": \"<p>This is the updated short content here<\\/p>\",
    \"url\": \"https:\\/\\/drive.google.com\\/file\\/d\\/0B5cbJMbHsJ1gc3RhcnRlcl9maWX2Rhc2hlclYw\\/view?usp=sharing\",
    \"trackCompletion\": true,
    \"allowDownload\": true,
    \"defaultZoom\": \"75%\",
    \"showSidebar\": true,
    \"categories\": [
        1,
        2,
        3
    ],
    \"estimatedCompletion\": \"00:30:00\",
    \"estimationCompletedUnit\": \"minutes\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/pdf"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Getting Started",
    "content": "<p>This is the updated short content here<\/p>",
    "url": "https:\/\/drive.google.com\/file\/d\/0B5cbJMbHsJ1gc3RhcnRlcl9maWX2Rhc2hlclYw\/view?usp=sharing",
    "trackCompletion": true,
    "allowDownload": true,
    "defaultZoom": "75%",
    "showSidebar": true,
    "categories": [
        1,
        2,
        3
    ],
    "estimatedCompletion": "00:30:00",
    "estimationCompletedUnit": "minutes"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Module saved successfully"
}
 

Request   

POST api/modules/pdf

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   required  optional  

Name of the pdf module. Example: Getting Started

content   string   

Content for the text modules that students will see. Example: <p>This is the updated short content here</p>

url   string   

URL or actual path of the pdf module that students will see. Example: https://drive.google.com/file/d/0B5cbJMbHsJ1gc3RhcnRlcl9maWX2Rhc2hlclYw/view?usp=sharing

trackCompletion   boolean   

If true, the module is being tracked(whether its finished or not) in course player. Example: true

allowDownload   boolean   

If true, the pdf can be downloaded(by the learners) otherwise not in course player. Example: true

defaultZoom   string   

The pdf will open with the set zoom percentage in course player. Example: 75%

showSidebar   boolean  optional  

If true, the pdf will open with a sidebar in course player. Example: true

categories   string[]  optional  

Categories to be added to the module.

estimatedCompletion   string  optional  

Estimated time to complete in course player. Example: 00:30:00

estimationCompletedUnit   string  optional  

Unit of estimated time to complete in course player. Example: minutes

Get PDF Module

Retrieves the details of the specified pdf module. Helps in fetching pdf module using module ID. (See Parameters) Returns : id, name, slug, content, url, allowDownload, trackCompletion, estimatedCompletion, estimationCompletedUnit, defaultZoom, showSidebar and categories of the pdf module created.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/pdf/6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/pdf/6"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 6,
    "name": "Getting Started",
    "slug": "getting-started",
    "content": " ",
    "url": "https://drive.google.com/file/d/0B5cbJMbHsJ1gc3RhcnRlcl9maWX2Rhc2hlclYw/view?usp=sharing",
    "allowDownload": true,
    "trackCompletion": true,
    "estimatedCompletion": null,
    "estimationCompletedUnit": null,
    "defaultZoom": "page_width",
    "showSidebar": true,
    "categories": [
        1,
        2,
        3
    ]
}
 

Request   

GET api/modules/pdf/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the pdf module. Example: 6

Update PDF Module

Updates the details of a specified PDF module. (See parameters) PDF modules can be used in the course as course content/lesson.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/modules/pdf/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Getting Started\",
    \"content\": \"<p>This is the updated short content here<\\/p>\",
    \"url\": \"https:\\/\\/drive.google.com\\/file\\/d\\/0B5cbJMbHsJ1gc3RhcnRlcl9maWX2Rhc2hlclYw\\/view?usp=sharing\",
    \"trackCompletion\": true,
    \"allowDownload\": true,
    \"defaultZoom\": \"75%\",
    \"showSidebar\": true,
    \"categories\": [
        1,
        2,
        3
    ],
    \"estimatedCompletion\": \"00:30:00\",
    \"estimationCompletedUnit\": \"minutes\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/pdf/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Getting Started",
    "content": "<p>This is the updated short content here<\/p>",
    "url": "https:\/\/drive.google.com\/file\/d\/0B5cbJMbHsJ1gc3RhcnRlcl9maWX2Rhc2hlclYw\/view?usp=sharing",
    "trackCompletion": true,
    "allowDownload": true,
    "defaultZoom": "75%",
    "showSidebar": true,
    "categories": [
        1,
        2,
        3
    ],
    "estimatedCompletion": "00:30:00",
    "estimationCompletedUnit": "minutes"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Module updated successfully"
}
 

Request   

PUT api/modules/pdf/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the PDF module. Example: 1

Body Parameters

name   string   

Name of the PDF module. Example: Getting Started

content   string  optional  

Content for the PDF module that students will see. Example: <p>This is the updated short content here</p>

url   string   

URL or actual path of the PDF module that students will see. Example: https://drive.google.com/file/d/0B5cbJMbHsJ1gc3RhcnRlcl9maWX2Rhc2hlclYw/view?usp=sharing

trackCompletion   boolean  optional  

If true, the module is being tracked (whether it's finished or not) in course player. Example: true

allowDownload   boolean  optional  

If true, the PDF can be downloaded (by the students) otherwise not in course player. Example: true

defaultZoom   string   

The PDF will open with the set zoom percentage in course player. Example: 75%

showSidebar   boolean  optional  

If true, the PDF will open with a sidebar in course player. Example: true

categories   string[]  optional  

Categories to be added to the module.

estimatedCompletion   string  optional  

Estimated time to complete in course player. Example: 00:30:00

estimationCompletedUnit   string  optional  

Unit of estimated time to complete in course player. Example: minutes

Get PDF Module Details

To get the details of a pdf module, you need to use this request. (See parameters)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/pdf/details" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/pdf/details"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "First PDF",
    "slug": "first-pdf",
    "content": "A brief description",
    "courseName": "First Course",
    "courseSlug": "http://localhost:8000/courses/1/launch",
    "url": "http://localhost:8000/courses/1/modules/2/launch",
    "totalPoints": 20,
    "shouldBeEvaluated": true,
    "min_time_spent": 90,
    "otherModules": [],
    "launchCheck": {},
    "prevSlug": "first-video",
    "nextSlug": "second-video",
    "currentUserId": 1,
    "currentStudentAvatar": "http://localhost:8000/storage/avatars/1.png",
    "currentUserName": "John Doe",
    "status": "In Progress",
    "statusRowId": 1,
    "timeSpent": 0,
    "course_newly_completed": false,
    "timeToBeSpent": 1,
    "instructorResponse": null
}
 

Request   

GET api/module/pdf/details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

registrationId   string   

ID of the course registration. Example: 1

moduleId   string   

ID of the pdf module. Example: 2

portalId   integer  optional  

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Retrieve Detailed PDF module Info for Membership content

Retrieves details of pdf module in depth for the same membership the current pdf module is attached to. Returns related fields value. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/pdf/content-details?moduleId=9" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/pdf/content-details"
);

const params = {
    "moduleId": "9",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "Getting Started",
    "slug": "getting-started",
    "content": " ",
    "url": "https://drive.google.com/file/d/0B5cbJMbHsJ1gc3RhcnRlcl9maWX2Rhc2hlclYw/view?usp=sharing",
    "canDownload": true,
    "trackCompletion": true,
    "defaultZoom": "page_width",
    "showSidebar": true,
    "timeSpent": null
}
 

Request   

GET api/module/pdf/content-details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

moduleId   string   

ID of the pdf module. Example: 9

Pages

Pages are Front end Marketing visuals. Page can be viewed by the different users to interact with this platform. Endpoint helps in managing pages.

Retrieve Page Layouts

Retrieves all the available page layouts in list format. Returns the list in JSON format.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/pages/layouts?context=sequi&search[title]=My+Layout&search[category][]=category+1&search[category][]=category+2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/pages/layouts"
);

const params = {
    "context": "sequi",
    "search[title]": "My Layout",
    "search[category][0]": "category 1",
    "search[category][1]": "category 2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Layout 1",
    "thumbnail": "https://example.com/layout1.jpg",
    "type": "predefined",
    "category": "category 1",
    "data": "<div>Layout 1 HTML</div>",
    "portal_id": 1
}
 

Request   

GET api/pages/layouts

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

context   string   

The context of the page layout. Possible values: page, section, row, or module. Example: sequi

search   object   

The search criteria for filtering page layouts.

search.title   string  optional  

optional The title of the page layout to search for. Example: My Layout

search.category   string[]  optional  

optional The categories to filter the page layouts by.

Retrieve Page Snippets

Retrieves all the available page snippets in list format. Returns the list in JSON format.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/pages/snippets" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/pages/snippets"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "identifier1": {
        "name": "Snippet 1",
        "html": "<div>Snippet 1 HTML</div>"
    },
    "identifier2": {
        "name": "Snippet 2",
        "html": "<div>Snippet 2 HTML</div>"
    }
}
 

Request   

GET api/pages/snippets

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Get Page

Returns Page details

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/page/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/page/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "title": "Home Page",
    "slug": "",
    "content": [],
    "layout": "full_width",
    "seo_title": "",
    "seo_description": "",
    "seo_thumbnail_url": "",
    "restrictedToLoginUser": false,
    "accessibleBy": "all",
    "metas": [],
    "userCategory": [],
    "userType": []
}
 

Request   

GET api/page/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer   

The ID of the page that needs to be retrieved. Example: 3

Save Contact form response

The request helps in sending contact form responses to the admins and instructors of the platform. Generally this form is filled and sent by the learners to enquire something regarding your product, course or the platform.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/contact-form" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"firstName\": \"John\",
    \"lastName\": \"Doe\",
    \"email\": \"[email protected]\",
    \"phoneNo\": \"1234567890\",
    \"content\": \"Question about your course?\",
    \"toEmail\": \"[email protected]\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/contact-form"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "firstName": "John",
    "lastName": "Doe",
    "email": "[email protected]",
    "phoneNo": "1234567890",
    "content": "Question about your course?",
    "toEmail": "[email protected]"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Mail sent successfully"
}
 

Request   

POST api/contact-form

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

firstName   string   

First Name of the user. Example: John

lastName   string   

Last Name of the user. Example: Doe

email   string   

Email of the user. Example: [email protected]

phoneNo   string   

Phone Number of the user. Example: 1234567890

content   string   

Message of the user. Example: Question about your course?

toEmail   string  optional  

optional Email of the recipient. If not provided, email will be sent to the admin email. Example: [email protected]

Tabular List

Retrieves all the pages in a tabular list format in paginated mode. You can apply filter using search_param via pageName(page name).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/pages/tabularlist?page_size=10&page_number=1&order_by=%7B%22colName%22%3A+%22name%22%2C+%22direction%22%3A+%22asc%22%7D&search_param=0&type=0" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/pages/tabularlist"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName": "name", "direction": "asc"}",
    "search_param": "0",
    "type": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "title": "Home Page",
            "slug": "home-page",
            "author": "John Doe",
            "created_at": "2021-01-01 12:00:00"
        }
    ]
}
 

Request   

GET api/pages/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 10

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName": "name", "direction": "asc"}

search_param   integer  optional  

for searching items based on field names. Example: 0

type   integer  optional  

optional The type of pages to retrieve. Example: 0

Save Page Layout

Saves a new page layout. This endpoint is being used by users to save their created page layouts.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/pages/layouts" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"ea\",
    \"context\": \"earum\",
    \"data\": \"consequatur\",
    \"portalId\": 8
}"
const url = new URL(
    "https://demo.aomlms.com/api/pages/layouts"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "ea",
    "context": "earum",
    "data": "consequatur",
    "portalId": 8
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Layout saved successfully"
}
 

Request   

POST api/pages/layouts

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

Name of the page layout. Example: ea

context   string   

Context of the page layout. Context options: page, section, row or module. Example: earum

data   string   

HTML content of the page layout. Example: consequatur

portalId   integer   

Portal ID of the page layout. Example: 8

Dropdown List

Retrieves a list of pages with their ID and title. Returns the list in JSON format.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/pages/dropdownlist" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/pages/dropdownlist"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "title": "Page 1"
    },
    {
        "id": 2,
        "title": "Page 2"
    }
]
 

Request   

GET api/pages/dropdownlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Get the learner's dashboard menu and accessible pages.

This function retrieves the list of menu items for a general user and fetches pages that are accessible based on restrictions (either globally or for a specific user type).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/pages/getlearnerDasboardList" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/pages/getlearnerDasboardList"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "pages": [
        {
            "id": 1,
            "title": "Home"
        },
        {
            "id": 2,
            "title": "Profile"
        }
    ],
    "menus": [
        {
            "id": 1,
            "name": "Dashboard",
            "slug": "dashboard"
        }
    ]
}
 

Request   

GET api/pages/getlearnerDasboardList

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Timezone List

Retrieves all the available PHP timezones in list format. Returns the list in JSON format.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/pages/timezoneList" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/pages/timezoneList"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


["Africa/Abidjan", "Africa/Accra", ..]
 

Request   

GET api/pages/timezoneList

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Layout Lookup

Retrieves a list of available page layouts in key-value pairs. The 'db_value' represents the layout identifier used in the database, and the 'display_value' provides the user-friendly name for each layout. Returns the list in JSON format.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/pages/layout/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/pages/layout/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "full_width",
        "display_value": "Full Width"
    },
    {
        "db_value": "fixed_width",
        "display_value": "Fixed width with left/right margin gaps"
    },
    {
        "db_value": "no_header",
        "display_value": "No Header/Menus/Footer"
    }
]
 

Request   

GET api/pages/layout/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Page Restriction Lookup

Retrieves all the available page restrictions in key-value pairs. The 'db_value' represents the restriction identifier used in the database, and the 'display_value' provides the user-friendly name for each restriction. Returns the list in JSON format.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/pages/restriction/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/pages/restriction/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "all",
        "display_value": "No Restriction"
    },
    {
        "db_value": "user_category",
        "display_value": "Restrict by User Categories"
    },
    {
        "db_value": "user_type",
        "display_value": "Restrict by User Types"
    }
]
 

Request   

GET api/pages/restriction/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Page Category Lookup

Retrieves all the page categories. Helps showing options in dropdowns elements

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/pages/categories/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/pages/categories/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "call_to_action",
        "display_value": "Call to Action"
    },
    {
        "db_value": "faq",
        "display_value": "FAQs"
    },
    {
        "db_value": "features",
        "display_value": "Features"
    },
    {
        "db_value": "pages",
        "display_value": "Pages "
    },
    {
        "db_value": "products",
        "display_value": "Products "
    },
    {
        "db_value": "team",
        "display_value": "Team"
    },
    {
        "db_value": "testimonial",
        "display_value": "Testimonial"
    }
]
 

Request   

GET api/pages/categories/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Save a new Page

Creates a new page associated with given portal. Saves the page restrictions. Returns the ID of the newly created page.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/pages" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"title\": \"Home Page\",
    \"content\": \"[{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"<p>This is a sample page.<\\/p>\\\"}]\",
    \"layout\": \"full_width\",
    \"seo_title\": \"null\",
    \"seo_description\": \"null\",
    \"seo_thumbnail_url\": \"null\",
    \"restrictedToLoginUser\": true,
    \"accessibleBy\": \"user_category\",
    \"userCategory\": [
        \"Student\",
        \"Teacher\"
    ],
    \"userType\": [
        \"Student\",
        \"Teacher\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/pages"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "title": "Home Page",
    "content": "[{\"type\": \"text\", \"text\": \"<p>This is a sample page.<\/p>\"}]",
    "layout": "full_width",
    "seo_title": "null",
    "seo_description": "null",
    "seo_thumbnail_url": "null",
    "restrictedToLoginUser": true,
    "accessibleBy": "user_category",
    "userCategory": [
        "Student",
        "Teacher"
    ],
    "userType": [
        "Student",
        "Teacher"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Page saved successfully"
}
 

Request   

POST api/pages

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

title   required  optional  

The title of the page. Example: Home Page

content   optional  optional   This is a sample page.

"}]" data-component="body">

The content of the page in JSON format. Example: [{"type": "text", "text": "<p>This is a sample page.</p>"}]

layout   required  optional  

The layout type for the page. Layout options: full_width, no_header, fixed_width. Example: full_width

seo_title   optional  optional  

SEO title for the page. Example: null

seo_description   optional  optional  

SEO description for the page. Example: null

seo_thumbnail_url   optional  optional  

Thumbnail image for the page. Example: null

restrictedToLoginUser   boolean  optional  

to check to allow the users to access the page. Example: true

accessibleBy   string   

if restrictedToLoginUser is true. Accessible by options: all, user_category, user_type. Example: user_category

userCategory   string[]   

if accessibleBy is user_category. Array of user categories.

userType   string[]   

if accessibleBy is user_type. Array of user types.

Soft Delete Page

To delete a page, you need to use this request. The pages will not be deleted permanently, it will be in draft mode. You can restore the page later. Returns page drafted(if multiple selected). (See Response)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/pages/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"page_ids\": [
        1,
        12,
        15
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/pages/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "page_ids": [
        1,
        12,
        15
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Page moved to draft successfully"
}
 

Request   

POST api/pages/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

page_ids   string[]   

All page IDs which needs to be drafted.

Hard Delete Page

To delete a page, you need to use this request. The pages will be deleted permanently. In this case, you cannot restore the page after hard delete. Returns page deleted(if multiple selected). (See Response)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/pages/harddelete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"page_ids\": [
        1,
        12,
        15
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/pages/harddelete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "page_ids": [
        1,
        12,
        15
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Pages deleted permanently"
}
 

Request   

POST api/pages/harddelete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

page_ids   string[]   

All page IDs which needs to be deleted.

Restore Page

To restore a page, you need to use this request. The pages will be restored from draft mode to published mode. Returns page restored(if multiple selected). (See Response)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/pages/restore" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"page_ids\": [
        1,
        12,
        15
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/pages/restore"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "page_ids": [
        1,
        12,
        15
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Page restored successfully"
}
 

Request   

POST api/pages/restore

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

page_ids   string[]   

All page IDs which needs to be restored.

Update Page Slug

Updates the slug of the page identified by 'id' with the new slug provided. The new slug is checked for uniqueness and if it already exists, a new slug is generated by appending a counter to the slug. The updated slug is then saved to the page. Returns the updated slug.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/page/update-slug/3?slug=%22about-us%22" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/page/update-slug/3"
);

const params = {
    "slug": ""about-us"",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


"about-us-1"
 

Request   

PUT api/page/update-slug/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer   

ID of the page to be updated. Example: 3

Query Parameters

slug   string   

The new slug of the page. Example: "about-us"

Update Page

Updates the specified page with new data including title, content, layout, SEO information, and access restrictions. The function accepts the page ID and a request object containing the new data. Validates the request data before updating the page. If the page is restricted to logged-in users, it validates the access permissions and updates user categories or types accordingly.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/page/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"title\": \"Home Page\",
    \"content\": \"[{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"<p>This is a sample page.<\\/p>\\\"}]\",
    \"layout\": \"full_width\",
    \"seo_title\": \"null\",
    \"seo_description\": \"null\",
    \"seo_thumbnail_url\": \"null\",
    \"restrictedToLoginUser\": true,
    \"accessibleBy\": \"user_category\",
    \"userCategory\": [
        \"Student\",
        \"Teacher\"
    ],
    \"userType\": [
        \"Student\",
        \"Teacher\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/page/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "title": "Home Page",
    "content": "[{\"type\": \"text\", \"text\": \"<p>This is a sample page.<\/p>\"}]",
    "layout": "full_width",
    "seo_title": "null",
    "seo_description": "null",
    "seo_thumbnail_url": "null",
    "restrictedToLoginUser": true,
    "accessibleBy": "user_category",
    "userCategory": [
        "Student",
        "Teacher"
    ],
    "userType": [
        "Student",
        "Teacher"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Page updated successfully"
}
 

Request   

PUT api/page/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer   

The ID of the page that needs to be updated. Example: 3

Body Parameters

title   required  optional  

The title of the page. Example: Home Page

content   optional  optional   This is a sample page.

"}]" data-component="body">

The content of the page in JSON format. Example: [{"type": "text", "text": "<p>This is a sample page.</p>"}]

layout   required  optional  

The layout type for the page. Layout options: full_width, no_header, fixed_width. Example: full_width

seo_title   optional  optional  

SEO title for the page. Example: null

seo_description   optional  optional  

SEO description for the page. Example: null

seo_thumbnail_url   optional  optional  

Thumbnail image for the page. Example: null

restrictedToLoginUser   boolean  optional  

Indicates if the page is restricted to logged-in users. Example: true

accessibleBy   string   

if restrictedToLoginUser is true. The access restriction type. Options: all, user_category, user_type. Example: user_category

userCategory   string[]   

if accessibleBy is user_category. Array of user categories.

userType   string[]   

if accessibleBy is user_type. Array of user types.

Animation Lookup

Retrieves all the animation classes supported by animate.css

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/getAnimationLookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/getAnimationLookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "label": "bounce",
        "value": "animate__animated animate__bounce"
    },
    {
        "label": "flash",
        "value": "animate__animated animate__flash"
    }
]
 

Request   

GET api/getAnimationLookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Portal

The Portal API controller handles various operations related to the portal's functionality.

All endpoints within this controller are responsible for providing and managing data related to the portal's core operations.

Create a new portal.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalName\": \"\\\"EduPortal\\\"\",
    \"portalSlug\": \"\\\"eduportal\\\"\",
    \"totalSeat\": \"100\",
    \"expiryDate\": \"\\\"2023-12-31\\\"\",
    \"expiryMessage\": \"\\\"This portal has expired.\\\"\",
    \"accessPermission\": \"\\\"all\\\"\",
    \"seatAccess\": \"\\\"first-come-first-served\\\"\",
    \"logoImageUrl\": \"\\\"https:\\/\\/example.com\\/logo.png\\\"\",
    \"miniLogoImageUrl\": \"\\\"https:\\/\\/example.com\\/mini-logo.png\\\"\",
    \"brandColor\": \"\\\"#3498db\\\"\",
    \"bodyBackgroundColor\": \"\\\"#ffffff\\\"\",
    \"bodyTextColor\": \"\\\"#333333\\\"\",
    \"headerBackgroundColor\": \"\\\"#2c3e50\\\"\",
    \"selectedPrimaryLanguage\": \"\\\"en\\\"\",
    \"isActive\": \"true\",
    \"selectedCourses\": \"[1, 2, 3]\",
    \"selectedMembership\": \"1\",
    \"enrollMembershipId\": \"2\",
    \"isPortalAdminLearner\": \"false\",
    \"portalAdminType\": \"\\\"super-admin\\\"\",
    \"addExistingUser\": \"[3, 4, 5]\",
    \"selectedUsers\": \"[1, 2]\",
    \"selectedCategoriesIds\": \"[10, 11]\",
    \"enrollCoursesIds\": \"[101, 102]\",
    \"enrollLearningPathIds\": \"[201, 202]\",
    \"learnerDashboard\": \"10\",
    \"customStyle\": \"\\\".portal-header { background-color: #333; }\\\"\",
    \"customFont\": \"\\\"Arial, sans-serif\\\"\",
    \"customCode\": \"\\\"<script>console.log(\'Hello World\');<\\/script>\\\"\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalName": "\"EduPortal\"",
    "portalSlug": "\"eduportal\"",
    "totalSeat": "100",
    "expiryDate": "\"2023-12-31\"",
    "expiryMessage": "\"This portal has expired.\"",
    "accessPermission": "\"all\"",
    "seatAccess": "\"first-come-first-served\"",
    "logoImageUrl": "\"https:\/\/example.com\/logo.png\"",
    "miniLogoImageUrl": "\"https:\/\/example.com\/mini-logo.png\"",
    "brandColor": "\"#3498db\"",
    "bodyBackgroundColor": "\"#ffffff\"",
    "bodyTextColor": "\"#333333\"",
    "headerBackgroundColor": "\"#2c3e50\"",
    "selectedPrimaryLanguage": "\"en\"",
    "isActive": "true",
    "selectedCourses": "[1, 2, 3]",
    "selectedMembership": "1",
    "enrollMembershipId": "2",
    "isPortalAdminLearner": "false",
    "portalAdminType": "\"super-admin\"",
    "addExistingUser": "[3, 4, 5]",
    "selectedUsers": "[1, 2]",
    "selectedCategoriesIds": "[10, 11]",
    "enrollCoursesIds": "[101, 102]",
    "enrollLearningPathIds": "[201, 202]",
    "learnerDashboard": "10",
    "customStyle": "\".portal-header { background-color: #333; }\"",
    "customFont": "\"Arial, sans-serif\"",
    "customCode": "\"<script>console.log('Hello World');<\/script>\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Portal created successfully"
}
 

Request   

POST api/portal

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalName   required  optional  

string The name of the portal. Example: "EduPortal"

portalSlug   required  optional  

string The slug of the portal. Example: "eduportal"

totalSeat   nullable|integer  optional  

The total number of seats for the portal. Example: 100

expiryDate   nullable|date  optional  

The date when the portal will expire. Example: "2023-12-31"

expiryMessage   nullable|string  optional  

The message that will be displayed when the portal expires. Example: "This portal has expired."

accessPermission   nullable|string  optional  

The permission for accessing the portal. Example: "all"

seatAccess   nullable|string  optional  

The type of seat access for the portal. Example: "first-come-first-served"

logoImageUrl   nullable|string  optional  

The URL of the logo for the portal. Example: "https://example.com/logo.png"

miniLogoImageUrl   nullable|string  optional  

The URL of the mini logo for the portal. Example: "https://example.com/mini-logo.png"

brandColor   required|string  optional  

The brand color for the portal. Example: "#3498db"

bodyBackgroundColor   required|string  optional  

The background color for the body of the portal. Example: "#ffffff"

bodyTextColor   required|string  optional  

The text color for the body of the portal. Example: "#333333"

headerBackgroundColor   nullable|string  optional  

The background color for the header of the portal. Example: "#2c3e50"

selectedPrimaryLanguage   required|string  optional  

The primary language for the portal. Example: "en"

isActive   nullable|boolean  optional  

Whether the portal is active or not. Example: true

selectedCourses   nullable|array  optional  

The courses that should be selected for the portal. Example: [1, 2, 3]

selectedMembership   nullable|integer  optional  

The membership that should be selected for the portal. Example: 1

enrollMembershipId   nullable|integer  optional  

The ID of the membership that should be enrolled in the portal. Example: 2

isPortalAdminLearner   nullable|boolean  optional  

Whether the portal admin is also a learner or not. Example: false

portalAdminType   nullable|string  optional  

The type of portal admin. Example: "super-admin"

addExistingUser   nullable|array  optional  

The existing users that should be added to the portal. Example: [3, 4, 5]

selectedUsers   nullable|array  optional  

The users that should be selected for the portal. Example: [1, 2]

selectedCategoriesIds   nullable|array  optional  

The IDs of the categories that should be selected for the portal. Example: [10, 11]

enrollCoursesIds   nullable|array  optional  

The IDs of the courses that should be enrolled in the portal. Example: [101, 102]

enrollLearningPathIds   nullable|array  optional  

The IDs of the learning paths that should be enrolled in the portal. Example: [201, 202]

learnerDashboard   nullable|integer  optional  

The ID of the page that should be used as the learner dashboard. Example: 10

customStyle   nullable|string  optional  

The custom CSS for the portal. Example: ".portal-header { background-color: #333; }"

customFont   nullable|string  optional  

The custom font for the portal. Example: "Arial, sans-serif"

customCode   nullable|string  optional   console.log('Hello World');"" data-component="body">

The custom code for the portal. Example: "<script>console.log('Hello World');</script>"

Returns a list of courses for a given portal

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portal/courses?portalId=1&page_size=10&page_number=1&order_by[column]=name&order_by[direction]=asc&search_param[name]=John+Doe&search_param[type]=assignment&search_param[status]=Submitted" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/courses"
);

const params = {
    "portalId": "1",
    "page_size": "10",
    "page_number": "1",
    "order_by[column]": "name",
    "order_by[direction]": "asc",
    "search_param[name]": "John Doe",
    "search_param[type]": "assignment",
    "search_param[status]": "Submitted",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "portalName": "portal name",
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "courseId": 1,
            "portalId": 1,
            "name": "course name",
            "courseImage": "http://localhost:8000/storage/courses/1/featured_image.jpg",
            "last24hCount": 5,
            "stats": {
                "notStarted": 5,
                "inProgress": 0,
                "completed": 0,
                "total": 5
            }
        },
        {
            "id": 2,
            "courseId": 2,
            "portalId": 2,
            "name": "course name",
            "courseImage": "http://localhost:8000/storage/courses/2/featured_image.jpg",
            "last24hCount": 0,
            "stats": {
                "notStarted": 0,
                "inProgress": 0,
                "completed": 0,
                "total": 0
            }
        }
    ]
}
 

Request   

GET api/portal/courses

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer   

The id of the portal Example: 1

page_size   integer   

Number of results per page. Example: 10

page_number   integer   

The current page number. Example: 1

order_by   object  optional  

JSON object specifying the column and direction to sort by.

search_param   object  optional  

JSON object containing search criteria.

Learning Path List

Retrieves learning paths associated with the portal.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portal/learningPaths?page_size=10&page_number=1&order_by=%7B%22colName%22%3A+%22name%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22learningPathName%22%3A+%22Learning+Path+1%22%7D&type=all+or+active" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/learningPaths"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName": "name", "direction": "desc"}",
    "search_param": "{"learningPathName": "Learning Path 1"}",
    "type": "all or active",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "portalName": "Portal 1",
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "learningPathId": 1,
            "learningPathName": "Learning Path 1",
            "learningPathImage": "http://example.com/learning-path-image.jpg",
            "last24hCount": 5,
            "learningPathStatistics": {
                "notStarted": 3,
                "inProgress": 2,
                "completed": 5
            }
        },
        {
            "learningPathId": 2,
            "learningPathName": "Learning Path 2",
            "learningPathImage": "http://example.com/learning-path-image.jpg",
            "last24hCount": 2,
            "learningPathStatistics": {
                "notStarted": 1,
                "inProgress": 1,
                "completed": 0
            }
        }
    ]
}
 

Request   

GET api/portal/learningPaths

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

portalId   string   

Portal ID of the user. Example: 1

Query Parameters

page_size   string   

The number of results per page. Example: 10

page_number   string   

The current page number. Example: 1

order_by   string  optional  

optional The column to sort the results by. Example: {"colName": "name", "direction": "desc"}

search_param   string  optional  

optional The search query parameters. Example: {"learningPathName": "Learning Path 1"}

type   string   

The type of learning paths to retrieve. Example: all or active

Retrieve portal admin permissions.

Fetches a list of permissions available for portal administrators.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portal-permissions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portal-permissions"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Manage Users"
    },
    {
        "id": 2,
        "name": "Edit Content"
    }
]
 

Request   

GET api/portal-permissions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieves a paginated and filtered list of users for a given portal, including their enrollment statistics.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portal/users?page_size=10&page_number=1&order_by[colName]=firstName&order_by[direction]=asc&search_param[nameOrEmail]=John+Doe&portalId=5&userType=%22portal_admin%22&isInPortal=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/users"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by[colName]": "firstName",
    "order_by[direction]": "asc",
    "search_param[nameOrEmail]": "John Doe",
    "portalId": "5",
    "userType": ""portal_admin"",
    "isInPortal": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "portalName": "Portal Name",
    "recordsTotal": 100,
    "recordsFiltered": 10,
    "recordIdsFiltered": [
        1,
        2,
        3
    ],
    "records": [
        {
            "id": 1,
            "firstName": "John",
            "lastName": "Doe",
            "userType": "learner",
            "email": "[email protected]",
            "avatar": "https://example.com/avatar.jpg",
            "stats": {
                "notStarted": 2,
                "inProgress": 3,
                "completed": 5,
                "total": 10
            },
            "status": "active",
            "lastLogin": "2 days ago",
            "createdBy": "Admin User",
            "createdAt": "2023-10-01 12:00:00",
            "portals": "Portal 1, Portal 2",
            "portalNameForAdmins": "Main Portal",
            "portalUserType": "portal_admin",
            "is_learner": true,
            "userCategory": "Category1, Category2",
            "permissionsDisplayNames": "View, Edit",
            "permissionsNames": [
                "view",
                "edit"
            ]
        }
    ]
}
 

Request   

GET api/portal/users

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   integer   

Number of results per page. Example: 10

page_number   integer   

The current page number. Example: 1

order_by   object  optional  

JSON object specifying the column and direction to sort by.

search_param   object  optional  

JSON object containing search criteria.

portalId   integer   

ID of the portal to filter users. Example: 5

userType   string  optional  

Type of user to filter by (e.g., 'portal_admin'). Example: "portal_admin"

isInPortal   boolean  optional  

Filter users who are in the portal. Example: true

Get courses for a given membership

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portal/membership/courses/1?page_size=10&page_number=1&order_by=%7B%22colName%22%3A+%22name%22%2C+%22direction%22%3A+%22asc%22%7D&search_param=%7B%22courseName%22%3A+%22Course+1%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/membership/courses/1"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName": "name", "direction": "asc"}",
    "search_param": "{"courseName": "Course 1"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "name": "Course 1",
            "slug": "course-1",
            "status": "active",
            "display_status": "Active",
            "categories": "Category 1",
            "author": "John Doe",
            "created_at": "05 Jun 2020 12:00 PM",
            "stats": {
                "total_enrolled": 5,
                "total_completed": 2
            },
            "last24hCount": 2
        }
    ]
}
 

Request   

GET api/portal/membership/courses/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the portal. Example: 1

Query Parameters

page_size   string   

The number of records per page. Example: 10

page_number   string   

The current page number. Example: 1

order_by   string  optional  

optional The column to sort the results by. Example: {"colName": "name", "direction": "asc"}

search_param   string  optional  

optional The search query parameters. Example: {"courseName": "Course 1"}

Get modules for a given membership

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portal/membership/modules/1?page_size=10&page_number=1&order_by=%7B%22colName%22%3A+%22name%22%2C+%22direction%22%3A+%22asc%22%7D&search_param=%7B%22moduleName%22%3A+%22Module+1%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/membership/modules/1"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName": "name", "direction": "asc"}",
    "search_param": "{"moduleName": "Module 1"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "name": "Module 1",
            "type": "assignment"
        }
    ]
}
 

Request   

GET api/portal/membership/modules/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the portal. Example: 1

Query Parameters

page_size   string   

The number of records per page. Example: 10

page_number   string   

The current page number. Example: 1

order_by   string  optional  

optional The column to sort the results by. Example: {"colName": "name", "direction": "asc"}

search_param   string  optional  

optional The search query parameters. Example: {"moduleName": "Module 1"}

Retrieve Page

Retrieves the details of a specified portal page by its ID. Returns the page's id, title, slug, content, and layout if found, otherwise returns an empty response.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portal/page/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/page/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "title": "About Us",
    "slug": "about-us",
    "content": "<p>Welcome to our page</p>",
    "layout": "full_width"
}
 

Request   

GET api/portal/page/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer   

The ID of the portal page to retrieve. Example: 3

Update Page

Updates an existing page associated with given portal.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/portal/page/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"title\": \"Home Page\",
    \"content\": \"[{\\\"type\\\": \\\"text\\\", \\\"text\\\": \\\"<p>This is a sample page.<\\/p>\\\"}]\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/page/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "title": "Home Page",
    "content": "[{\"type\": \"text\", \"text\": \"<p>This is a sample page.<\/p>\"}]"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Page updated successfully"
}
 

Request   

PUT api/portal/page/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer   

The ID of the page that needs to be updated. Example: 3

Body Parameters

title   required  optional  

The title of the page. Example: Home Page

content   optional  optional   This is a sample page.

"}]" data-component="body">

The content of the page in JSON format. Example: [{"type": "text", "text": "<p>This is a sample page.</p>"}]

Get pages for a given portal

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portal/pages/tabularlist?page_size=10&page_number=1&order_by=%7B%22colName%22%3A+%22name%22%2C+%22direction%22%3A+%22asc%22%7D&search_param=0&type=0" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/pages/tabularlist"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName": "name", "direction": "asc"}",
    "search_param": "0",
    "type": "0",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "title": "Home Page",
            "slug": "home-page",
            "content": "This is the home page content",
            "author": "John Doe",
            "created_at": "2021-01-01 12:00:00"
        }
    ]
}
 

Request   

GET api/portal/pages/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

portalId   string   

The ID of the portal. Example: 1

Query Parameters

page_size   string   

The number of records per page. Example: 10

page_number   string   

The current page number. Example: 1

order_by   string  optional  

optional The column to sort the results by. Example: {"colName": "name", "direction": "asc"}

search_param   integer  optional  

optional The search query parameters. Example: 0

type   integer  optional  

optional The type of pages to retrieve. Example: 0

Save a new Portal Page

Validates and saves a new portal page with the provided title, content, and portal ID. The page is associated with the user creating it. Returns the ID of the newly created portal page along with a success message.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/pages" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"title\": \"\\\"Welcome Page\\\"\",
    \"content\": [
        {
            \"type\": \"text\",
            \"text\": \"<p>Welcome to our portal.<\\/p>\"
        }
    ],
    \"portalId\": 123
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/pages"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "title": "\"Welcome Page\"",
    "content": [
        {
            "type": "text",
            "text": "<p>Welcome to our portal.<\/p>"
        }
    ],
    "portalId": 123
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Page saved successfully"
}
 

Request   

POST api/portal/pages

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

title   string   

The title of the portal page. Example: "Welcome Page"

content   string[]  optional  

optional The content of the portal page, in JSON format.

portalId   integer   

The ID of the portal to associate the page with. Example: 123

Soft Delete Page

To delete a page, you need to use this request. The pages will not be deleted permanently, it will be in draft mode. You can restore the page later. Returns page drafted(if multiple selected). (See Response)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/page/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"page_ids\": [
        1,
        12,
        15
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/page/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "page_ids": [
        1,
        12,
        15
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Page moved to draft successfully"
}
 

Request   

POST api/portal/page/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

page_ids   string[]   

All page IDs which needs to be drafted.

Hard Delete Page

Permanently deletes pages specified by the provided page IDs. Once deleted, these pages cannot be restored. Logs the activity for each deleted page.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/pages/harddelete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"page_ids\": [
        1,
        12,
        15
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/pages/harddelete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "page_ids": [
        1,
        12,
        15
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Pages deleted permanently"
}
 

Request   

POST api/portal/pages/harddelete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

page_ids   string[]   

List of page IDs to be deleted permanently.

Restore Page

Restores the pages from draft mode to published mode. Logs the activity for each restored page.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/pages/restore" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"page_ids\": [
        1,
        12,
        15
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/pages/restore"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "page_ids": [
        1,
        12,
        15
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Page restored successfully"
}
 

Request   

POST api/portal/pages/restore

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

page_ids   string[]   

List of page IDs to be restored.

Get Portal Course Catalog

Returns the list of available courses (and learning paths, if any) for a given portal and user. Allows optional filtering by course name and course category.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portal/getPortalCourseCatalog" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalId\": 12,
    \"userId\": 45,
    \"search\": {
        \"contentName\": \"\\\"Leadership\\\"\",
        \"courseCategoryIds\": [
            1,
            2,
            3
        ]
    }
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/getPortalCourseCatalog"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalId": 12,
    "userId": 45,
    "search": {
        "contentName": "\"Leadership\"",
        "courseCategoryIds": [
            1,
            2,
            3
        ]
    }
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "courses": [
        {
            "courseId": 101,
            "contentName": "Effective Communication",
            "featureImage": "https://example.com/images/comm.jpg",
            "isEnrolled": true,
            "launchUrl": "yourportal/course/effective-communication/launch",
            "categoryIds": [
                2,
                3
            ]
        }
    ],
    "learningPaths": [],
    "categoryIds": [
        2,
        3
    ]
}
 

Request   

GET api/portal/getPortalCourseCatalog

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalId   integer   

The ID of the portal. Example: 12

userId   integer   

The ID of the user. Example: 45

search   object  optional  

Optional search filters.

contentName   string  optional  

The partial or full name of the course to search for. Example: "Leadership"

courseCategoryIds   string[]  optional  

An array of course category IDs to filter by.

Retrieves the portal settings

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portal/getPortalCustomDomainSettings?domain=%27example.com%27" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/getPortalCustomDomainSettings"
);

const params = {
    "domain": "'example.com'",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "portalCustomDomainEnabled": "yes|no",
    "verifiedDomain": "yes|no",
    "ipAddress": "127.0.0.1",
    "enabledCustomDomain": "yes|no"
}
 

Request   

GET api/portal/getPortalCustomDomainSettings

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

domain   string   

The domain of the portal Example: 'example.com'

Enable or disable custom domain for portals

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/enableCustomDomain" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"isEnabled\": true
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/enableCustomDomain"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "isEnabled": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Portal Settings Updated Successfully."
}
 

Request   

POST api/portal/enableCustomDomain

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

isEnabled   boolean   

Enable or disable custom domain for portals Example: true

Verify the custom domain for portals

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portal/verifyDomain?string=id" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/verifyDomain"
);

const params = {
    "string": "id",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "is_success": true,
    "message": "Domain Verified Successfully."
}
 

Example response (404):


{
    "is_success": false,
    "message": "Domain Verify Unsuccessfully."
}
 

Request   

GET api/portal/verifyDomain

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

string   string   

domain The custom domain to verify Example: id

Add Portal Admins

Adds new or existing users as portal admins to the specified portal. This method handles:

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/users/addPortalAdmins" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalId\": 12,
    \"portalAdmins\": [
        \"molestiae\"
    ],
    \"portalAdminPermissions\": [
        \"can_manage_courses\",
        \"can_edit_settings\"
    ],
    \"isPortalAdminLearner\": true,
    \"selectedExUsers\": [
        3,
        4,
        5
    ],
    \"portalAdminType\": \"newPortalAdmin\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/users/addPortalAdmins"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalId": 12,
    "portalAdmins": [
        "molestiae"
    ],
    "portalAdminPermissions": [
        "can_manage_courses",
        "can_edit_settings"
    ],
    "isPortalAdminLearner": true,
    "selectedExUsers": [
        3,
        4,
        5
    ],
    "portalAdminType": "newPortalAdmin"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "Portal Admin added successfully"
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "availableSeats": [
            "The learner limit is reached. You can add only 2 learners."
        ]
    }
}
 

Request   

POST api/portal/users/addPortalAdmins

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalId   integer   

The ID of the portal where admins will be added. Example: 12

portalAdmins   string[]  optional  

List of new portal admin user objects (each must contain email, optionally isLearner). Required if portalAdminType is "newPortalAdmin".

portalAdminPermissions   string[]  optional  

List of permission names to assign to portal admins.

isPortalAdminLearner   boolean  optional  

Indicates if the selected users are also learners. Example: true

selectedExUsers   string[]  optional  

List of existing user IDs to assign as portal admins. Required if portalAdminType is "existingUser".

portalAdminType   string   

The type of portal admin being added. Either newPortalAdmin or existingUser. Example: newPortalAdmin

Add learners to a portal.

This endpoint allows adding new learners to a portal either manually, via bulk import, or by selecting existing users. It also supports enrolling learners in courses, learning paths, and memberships, with proper seat availability validation and email domain blocking.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/users/addPortalLearners" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalId\": 12,
    \"learners\": [
        \"rerum\"
    ],
    \"selectedCategoriesIds\": [
        1,
        2
    ],
    \"enrollCoursesIds\": [
        101,
        102
    ],
    \"enrollLearningPathIds\": [
        201,
        202
    ],
    \"enrollMembershipId\": 301,
    \"selectExistingUsers\": [
        5,
        9
    ],
    \"userAddedType\": \"addManually\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/users/addPortalLearners"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalId": 12,
    "learners": [
        "rerum"
    ],
    "selectedCategoriesIds": [
        1,
        2
    ],
    "enrollCoursesIds": [
        101,
        102
    ],
    "enrollLearningPathIds": [
        201,
        202
    ],
    "enrollMembershipId": 301,
    "selectExistingUsers": [
        5,
        9
    ],
    "userAddedType": "addManually"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "blockedEmailDomainsmessage": "Email or domain is blocked for user with email [email protected]. Please contact Admin.",
    "blockedEmails": [
        "[email protected]"
    ]
}
 

Example response (201):


{
    "message": "Learner added successfully"
}
 

Example response (422):


{
    "availableSeats": "The learner limit is reached. You can add only 0 new learners."
}
 

Request   

POST api/portal/users/addPortalLearners

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalId   integer   

The ID of the portal to which learners should be added. Example: 12

learners   string[]  optional  

Optional array of learner objects if adding manually or via bulk import.

email   string   

Email of the learner. Example: [email protected]

firstName   string   

First name of the learner. Example: John

lastName   string   

Last name of the learner. Example: Doe

password   string   

Password for the learner account. Example: secret123

isLearner   boolean  optional  

Indicates if the user is a learner. Example: true

selectedCategoriesIds   string[]  optional  

Optional category IDs to assign to the learners.

enrollCoursesIds   string[]  optional  

Optional course IDs for enrollment.

enrollLearningPathIds   string[]  optional  

Optional learning path IDs.

enrollMembershipId   integer  optional  

Optional membership ID to assign. Example: 301

selectExistingUsers   string[]  optional  

Optional array of existing user IDs to attach.

userAddedType   string   

The method of adding users: 'addManually', 'bulkImport', or 'existingUser'. Example: addManually

Update the permissions of a portal admin

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/users/updatePermissions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalAdminPermissions\": [
        \"ipsa\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/users/updatePermissions"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalAdminPermissions": [
        "ipsa"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Permissions updated successfully"
}
 

Request   

POST api/portal/users/updatePermissions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

userId   string   

User ID of the portal admin. Example: 1

portalId   string   

Portal ID where the user is an admin. Example: 1

Body Parameters

portalAdminPermissions   string[]   

The permissions for the portal admin.

Removes users from a given portal and its sub-portals based on the given user IDs and type.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/users/remove" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"userIds\": [
        \"totam\"
    ],
    \"portalId\": 5,
    \"type\": \"dolore\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/users/remove"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "userIds": [
        "totam"
    ],
    "portalId": 5,
    "type": "dolore"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "Portal user removed successfully"
}
 

Request   

POST api/portal/users/remove

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

userIds   string[]   

The IDs of the users to remove from the portal.

portalId   integer   

The ID of the portal to remove the users from. Example: 5

type   string   

The type of user to remove, either 'learner' or 'portal_admin'. Example: dolore

Update the status of a portal user

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/users/update-status" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"userIds\": [
        \"repellat\"
    ],
    \"status\": \"est\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/users/update-status"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "userIds": [
        "repellat"
    ],
    "status": "est"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Portal user status updated successfully"
}
 

Request   

POST api/portal/users/update-status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

userIds   string[]   

The ids of the users

status   string   

The status of the portal user Example: est

Get detailed portal information.

This endpoint retrieves detailed information about a specific portal, including branding, configuration settings, seat usage, sub-portals, and selected content (courses, paths, memberships).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portal/{portalId}?portalId=42" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/{portalId}"
);

const params = {
    "portalId": "42",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 42,
    "portalName": "My Portal",
    "portalSlug": "my-portal",
    "parentPortalId": null,
    "referralCode": "ABCD1234",
    "seatAccess": "limited",
    "accessPermission": "invite_only",
    "expiryMessage": "Your access has expired.",
    "totalSeats": 100,
    "totalSeatAccess": 100,
    "expiryDate": "30-Dec-2025",
    "logoImageUrl": "https://cdn.example.com/logo.png",
    "miniLogoImageUrl": "https://cdn.example.com/mini-logo.png",
    "brandColor": "#FF5733",
    "bodyBackgroundColor": "#ffffff",
    "bodyTextColor": "#000000",
    "headerBackgroundColor": "#f5f5f5",
    "selectedPrimaryLanguage": "en",
    "customStyle": ".custom { color: red; }",
    "customFont": "Roboto",
    "customCode": "<script>console.log('custom');</script>",
    "isActive": true,
    "totalPortalAdmins": 5,
    "totalLearner": 120,
    "usedSeats": 80,
    "availableSeats": 20,
    "subPortalCount": 2,
    "parentPortalSlug": null,
    "parentPortalName": null,
    "allowedEmails": [
        "[email protected]"
    ],
    "portalCustomDomainEnabled": true,
    "publicSelectedCourses": [
        101,
        102
    ],
    "privateSelectedCourses": [
        201,
        202
    ],
    "selectedPublicLearningPaths": [
        301,
        302
    ],
    "selectedPublicLearningPathNames": [
        "Beginner Path",
        "Intermediate Path"
    ],
    "selectedPrivateLearningPaths": [
        401
    ],
    "selectedPrivateLearningPathNames": [
        "Advanced Path"
    ],
    "selectedPrivateMembership": 501,
    "selectedPrivateMembershipName": "Gold Membership",
    "selectedContent": {
        "publicCourseIds": [
            101,
            102
        ],
        "privateCourseIds": [
            201,
            202
        ],
        "publicLearningPathIds": [
            301,
            302
        ],
        "publicLearningPathNames": [
            "Beginner Path",
            "Intermediate Path"
        ],
        "privateLearningPathIds": [
            401
        ],
        "privateLearningPathNames": [
            "Advanced Path"
        ],
        "privateMembershipId": 501,
        "privateMembershipName": "Gold Membership"
    },
    "learnerDashboard": "dashboard"
}
 

Example response (404):


{
    "message": "Portal not found."
}
 

Request   

GET api/portal/{portalId}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer   

The ID of the portal to retrieve. Example: 42

Update a portal

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/portal/{portalId}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalName\": \"et\",
    \"portalSlug\": \"libero\",
    \"totalSeatAccess\": \"veniam\",
    \"expiryDate\": \"officia\",
    \"expiryMessage\": \"nostrum\",
    \"accessPermission\": \"ea\",
    \"seatAccess\": \"sed\",
    \"logoImageUrl\": \"http:\\/\\/www.halvorson.org\\/laudantium-odit-sit-quas-sed-occaecati-provident\",
    \"miniLogoImageUrl\": \"http:\\/\\/www.towne.com\\/voluptatem-quibusdam-reprehenderit-aut-minus-sint-et.html\",
    \"brandColor\": \"quo\",
    \"bodyBackgroundColor\": \"vero\",
    \"bodyTextColor\": \"sit\",
    \"headerBackgroundColor\": \"perspiciatis\",
    \"selectedPrimaryLanguage\": \"delectus\",
    \"isActive\": \"illo\",
    \"publicSelectedCourses\": \"est\",
    \"privateSelectedCourses\": \"iste\",
    \"selectedPublicLearningPaths\": \"alias\",
    \"selectedPrivateLearningPaths\": \"numquam\",
    \"selectedPrivateMembership\": \"nam\",
    \"customStyle\": \"maiores\",
    \"customFont\": \"natus\",
    \"customCode\": \"laboriosam\",
    \"allowedEmails\": \"architecto\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/{portalId}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalName": "et",
    "portalSlug": "libero",
    "totalSeatAccess": "veniam",
    "expiryDate": "officia",
    "expiryMessage": "nostrum",
    "accessPermission": "ea",
    "seatAccess": "sed",
    "logoImageUrl": "http:\/\/www.halvorson.org\/laudantium-odit-sit-quas-sed-occaecati-provident",
    "miniLogoImageUrl": "http:\/\/www.towne.com\/voluptatem-quibusdam-reprehenderit-aut-minus-sint-et.html",
    "brandColor": "quo",
    "bodyBackgroundColor": "vero",
    "bodyTextColor": "sit",
    "headerBackgroundColor": "perspiciatis",
    "selectedPrimaryLanguage": "delectus",
    "isActive": "illo",
    "publicSelectedCourses": "est",
    "privateSelectedCourses": "iste",
    "selectedPublicLearningPaths": "alias",
    "selectedPrivateLearningPaths": "numquam",
    "selectedPrivateMembership": "nam",
    "customStyle": "maiores",
    "customFont": "natus",
    "customCode": "laboriosam",
    "allowedEmails": "architecto"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "Portal updated successfully"
}
 

Request   

PUT api/portal/{portalId}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalName   string   

The name of the portal. Example: et

portalSlug   string   

The slug of the portal. Example: libero

totalSeatAccess   int|null  optional  

The total number of seats for the portal. Example: veniam

expiryDate   date|null  optional  

The date when the portal will expire. Example: officia

expiryMessage   string|null  optional  

The message to be displayed when the portal expires. Example: nostrum

accessPermission   string|null  optional  

The type of access for the portal. Example: ea

seatAccess   string|null  optional  

The type of seat access for the portal. Example: sed

logoImageUrl   string|null  optional  

The url of the logo image for the portal. Example: http://www.halvorson.org/laudantium-odit-sit-quas-sed-occaecati-provident

miniLogoImageUrl   string|null  optional  

The url of the mini logo image for the portal. Example: http://www.towne.com/voluptatem-quibusdam-reprehenderit-aut-minus-sint-et.html

brandColor   string|null  optional  

The brand color of the portal. Example: quo

bodyBackgroundColor   string|null  optional  

The background color of the portal's body. Example: vero

bodyTextColor   string|null  optional  

The text color of the portal's body. Example: sit

headerBackgroundColor   string|null  optional  

The background color of the portal's header. Example: perspiciatis

selectedPrimaryLanguage   string|null  optional  

The primary language of the portal. Example: delectus

isActive   boolean|null  optional  

Whether the portal is active or not. Example: illo

publicSelectedCourses   array|null  optional  

The courses that are selected as public courses. Example: est

privateSelectedCourses   array|null  optional  

The courses that are selected as private courses. Example: iste

selectedPublicLearningPaths   array|null  optional  

The learning paths that are selected as public learning paths. Example: alias

selectedPrivateLearningPaths   array|null  optional  

The learning paths that are selected as private learning paths. Example: numquam

selectedPrivateMembership   int|null  optional  

The membership that is selected as private membership. Example: nam

customStyle   string|null  optional  

The custom CSS for the portal. Example: maiores

customFont   string|null  optional  

The custom font for the portal. Example: natus

customCode   string|null  optional  

The custom code for the portal. Example: laboriosam

allowedEmails   string|null  optional  

The emails that are allowed to access the portal. Example: architecto

Update the branding settings of a portal

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/updateBranding" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"logoImageUrl\": \"https:\\/\\/example.com\\/logo.png\",
    \"miniLogoImageUrl\": \"https:\\/\\/example.com\\/mini-logo.png\",
    \"brandColor\": \"#2e1e55\",
    \"bodyBackgroundColor\": \"#f8f8f8\",
    \"bodyTextColor\": \"#1b1e24\",
    \"headerBackgroundColor\": \"#2e1e55\",
    \"selectedPrimaryLanguage\": \"en\",
    \"customStyle\": \"CSS code\",
    \"customCode\": \"JavaScript code\",
    \"customFont\": \"font family name\",
    \"learnerDashboard\": \"{\\\"type\\\": \\\"page\\\", \\\"id\\\": 1} or {\\\"type\\\": \\\"menu\\\", \\\"id\\\": \\\"menu-name\\\"}\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/updateBranding"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "logoImageUrl": "https:\/\/example.com\/logo.png",
    "miniLogoImageUrl": "https:\/\/example.com\/mini-logo.png",
    "brandColor": "#2e1e55",
    "bodyBackgroundColor": "#f8f8f8",
    "bodyTextColor": "#1b1e24",
    "headerBackgroundColor": "#2e1e55",
    "selectedPrimaryLanguage": "en",
    "customStyle": "CSS code",
    "customCode": "JavaScript code",
    "customFont": "font family name",
    "learnerDashboard": "{\"type\": \"page\", \"id\": 1} or {\"type\": \"menu\", \"id\": \"menu-name\"}"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Portal branding updated successfully"
}
 

Request   

POST api/portal/updateBranding

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

portalId   string   

Portal ID of the user. Example: 1

Body Parameters

logoImageUrl   string   

Logo image URL of the portal. Example: https://example.com/logo.png

miniLogoImageUrl   string   

Mini logo image URL of the portal. Example: https://example.com/mini-logo.png

brandColor   string   

Brand color of the portal. Example: #2e1e55

bodyBackgroundColor   string   

Body background color of the portal. Example: #f8f8f8

bodyTextColor   string   

Body text color of the portal. Example: #1b1e24

headerBackgroundColor   string   

Header background color of the portal. Example: #2e1e55

selectedPrimaryLanguage   string   

Selected primary language of the portal. Example: en

customStyle   string   

Custom CSS for the portal. Example: CSS code

customCode   string   

Custom JavaScript code for the portal. Example: JavaScript code

customFont   string   

Custom font for the portal. Example: font family name

learnerDashboard   string   

JSON object for learner dashboard. Example: {"type": "page", "id": 1} or {"type": "menu", "id": "menu-name"}

Add a sub portal to the given portal

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/addSubPortals" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"subPortal\": \"[{\\\"name\\\": \\\"Sub Portal 1\\\", \\\"referralCode\\\": \\\"sp1\\\"}, {\\\"name\\\": \\\"Sub Portal 2\\\", \\\"referralCode\\\": \\\"sp2\\\"}]\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/addSubPortals"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "subPortal": "[{\"name\": \"Sub Portal 1\", \"referralCode\": \"sp1\"}, {\"name\": \"Sub Portal 2\", \"referralCode\": \"sp2\"}]"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Sub Portal added successfully"
}
 

Request   

POST api/portal/addSubPortals

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

portalId   string   

Portal ID of the user. Example: 1

Body Parameters

subPortal   required  optional  

An array of sub portals. Example: [{"name": "Sub Portal 1", "referralCode": "sp1"}, {"name": "Sub Portal 2", "referralCode": "sp2"}]

Delete a portal

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalId\": 5
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalId": 5
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "Portal deleted successfully"
}
 

Request   

POST api/portal/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalId   integer   

The ID of the portal. Example: 5

Delete multiple sub portals

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/sub-portal-delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/sub-portal-delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Sub Portals deleted successfully"
}
 

Request   

POST api/portal/sub-portal-delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

ids   string   

Comma separated sub portal IDs. Example: 1,2,3

portalId   string   

The parent portal ID. Example: 1

Save the menu items for the given portal. The menu items should be an array of objects with the following properties:

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/menus" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalId\": 123,
    \"menuList\": [
        \"voluptatum\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/menus"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalId": 123,
    "menuList": [
        "voluptatum"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Menu updated successfully"
}
 

Example response (400):


{
    "message": "Invalid request. Portal ID is required."
}
 

Request   

POST api/portal/menus

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalId   integer   

The ID of the portal. Example: 123

menuList   string[]   

An array of menu items.

Add users to learner list of the portal.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/users/addToLearner" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"userIds\": [
        \"similique\"
    ],
    \"portalId\": 17
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/users/addToLearner"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "userIds": [
        "similique"
    ],
    "portalId": 17
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "User updated successfully"
}
 

Request   

POST api/portal/users/addToLearner

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

userIds   string[]   

The IDs of the users to add to learner list.

portalId   integer   

The ID of the portal to add users to. Example: 17

Update a user to portal admin

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/users/updateToPortalAdmin" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"userId\": 19,
    \"portalId\": 1,
    \"portalAdminPermissions\": [
        \"distinctio\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/users/updateToPortalAdmin"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "userId": 19,
    "portalId": 1,
    "portalAdminPermissions": [
        "distinctio"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "User updated successfully"
}
 

Request   

POST api/portal/users/updateToPortalAdmin

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

userId   integer   

The id of the user Example: 19

portalId   integer   

The id of the portal Example: 1

portalAdminPermissions   string[]   

The permissions for the portal admin

Update the status of a given portal(s)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/updatePortalStatus" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"ids\": [
        \"illum\"
    ],
    \"status\": \"earum\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/updatePortalStatus"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "ids": [
        "illum"
    ],
    "status": "earum"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "Status updated successfully"
}
 

Request   

POST api/portal/updatePortalStatus

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

ids   string[]   

The IDs of the portals to update.

status   string   

The status to set for the portals. Options: 'Active', 'InActive'. Example: earum

Retrieve a paginated list of portals in a tabular format.

Fetches portals with optional filtering by status and portal name, and returns the results in a paginated format with sorting options. The function also provides the total and filtered records count.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portals/tabularlist?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A%22desc%22%7D&search_param=%7B%22status%22%3A%22active%22%2C+%22portalName%22%3A%22Example+Portal%22%7D&portalId=velit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portals/tabularlist"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction":"desc"}",
    "search_param": "{"status":"active", "portalName":"Example Portal"}",
    "portalId": "velit",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 100,
    "recordsFiltered": 20,
    "records": [
        {
            "id": 1,
            "name": "Portal Name",
            "parentPortalId": "Parent Portal",
            "referralCode": "ABC123",
            "totalSeat": 50,
            "usedSeat": 25,
            "seatAccess": "full",
            "status": "active",
            "slug": "portal-name",
            "portalAdmins": "Admin Name",
            "portalAdminsCount": 3,
            "created_by": "Creator Name",
            "created_at": "Sep 10, 2023 10:00 AM",
            "totalLearner": 10
        }
    ]
}
 

Request   

GET api/portals/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of items per page. Example: 50

page_number   string   

The current page number. Example: 1

order_by   string  optional  

Optional JSON for sorting. Example: {"colName":"created_at", "direction":"desc"}

search_param   string  optional  

Optional JSON for filtering. Example: {"status":"active", "portalName":"Example Portal"}

portalId   string  optional  

Optional The parent portal ID for filtering sub-portals. Example: velit

Lookup Portals

Retrieves portals based on the specified type, portal ID, and search term. If the portal ID is provided and not -1, it fetches sub-portals or reports/portals based on the type. If a search term is provided, it filters portals by name. Returns a list of portals with their ID, name, total seats, used seats, and available seats.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portals/lookup?type=subPortals&portalId=5&search_term=Portal+1&user_id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portals/lookup"
);

const params = {
    "type": "subPortals",
    "portalId": "5",
    "search_term": "Portal 1",
    "user_id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Portal 1",
        "totalSeats": 100,
        "usedSeat": 50,
        "availableSeats": 50
    }
]
 

Request   

GET api/portals/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

type   string  optional  

The type of lookup to perform (e.g., subPortals, reports, portals). Example: subPortals

portalId   integer  optional  

The portal ID to filter by (use -1 to skip filtering). Example: 5

search_term   string  optional  

The search term to filter portals by name. Example: Portal 1

user_id   integer  optional  

The ID of the user performing the lookup. Example: 1

Retrieves all the menus with all its associated items

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portals/menus/list?portalId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portals/menus/list"
);

const params = {
    "portalId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "name": "Main Menu",
        "items": [
            {
                "label": "Home",
                "type": "page",
                "custom_link": null,
                "page_id": 1,
                "display_order": 1,
                "css_class": null,
                "restrictions": null,
                "open_in_new_tab": false,
                "level": 1,
                "isCollapsed": true,
                "hyperlink": "/"
            },
            {
                "label": "Courses",
                "type": "page",
                "custom_link": null,
                "page_id": 2,
                "display_order": 2,
                "css_class": null,
                "restrictions": null,
                "open_in_new_tab": false,
                "level": 1,
                "isCollapsed": true,
                "hyperlink": "http://localhost:8000/course-catalog"
            },
            {
                "label": "Our Team",
                "type": "page",
                "custom_link": null,
                "page_id": 3,
                "display_order": 3,
                "css_class": null,
                "restrictions": null,
                "open_in_new_tab": false,
                "level": 1,
                "isCollapsed": true,
                "hyperlink": "http://localhost:8000/about-us"
            },
            {
                "label": "Contact Us",
                "type": "page",
                "custom_link": null,
                "page_id": 6,
                "display_order": 4,
                "css_class": null,
                "restrictions": null,
                "open_in_new_tab": false,
                "level": 1,
                "isCollapsed": true,
                "hyperlink": "http://localhost:8000/contact-us"
            }
        ]
    },
    {
        "id": 2,
        "name": "Top Bar Menu",
        "items": [
            {
                "label": "Dashboard",
                "type": "custom_link",
                "custom_link": "/dashboard",
                "page_id": null,
                "display_order": 1,
                "css_class": null,
                "restrictions": null,
                "open_in_new_tab": false,
                "level": 1,
                "isCollapsed": true,
                "hyperlink": "/dashboard"
            },
            {
                "label": "Cart",
                "type": "page",
                "custom_link": null,
                "page_id": 5,
                "display_order": 2,
                "css_class": null,
                "restrictions": null,
                "open_in_new_tab": false,
                "level": 1,
                "isCollapsed": true,
                "hyperlink": "http://localhost:8000/cart"
            }
        ]
    },
    {
        "id": 3,
        "name": "Footer Menu",
        "items": []
    }
]
 

Request   

GET api/portals/menus/list

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer  optional  

The portal ID to filter menus by. Example: 1

Get the permissions of a portal admin

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/admin/permissions/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/admin/permissions/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
 "portalUsers": [
     {
         "portalId": 1,
         "portalName": "Portal 1",
         "permissions": [
             "manage_course",
             "manage_learning_path",
         ]
     }
 ]
}
 

Request   

GET api/admin/permissions/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

User ID of the portal admin. Example: 1

Page dropdown list

Returns a list of pages of the associated portal with their ID and Name based on the provided portal ID and search term. If a valid portal ID is provided, it filters pages associated with the portal. If no portal ID or an invalid one (e.g., -1) is given, it returns all pages.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portals/pages/dropdownlist?portalId=5&search_term=%22Advanced%22" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portals/pages/dropdownlist"
);

const params = {
    "portalId": "5",
    "search_term": ""Advanced"",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "id": 1,
        "title": "Page 1"
    },
    {
        "id": 2,
        "title": "Page 2"
    }
]
 

Request   

GET api/portals/pages/dropdownlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer  optional  

The portal ID to filter pages by portal. Use -1 to skip portal filtering. Example: 5

search_term   string  optional  

The search term to filter pages by title. Example: "Advanced"

Retrieve the menu and pages for a specific portal.

This endpoint retrieves the list of pages associated with a given portal and the sidebar menu items for the portal user.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portals/pages/getPortalLearnerPagesMenu" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalId\": 123
}"
const url = new URL(
    "https://demo.aomlms.com/api/portals/pages/getPortalLearnerPagesMenu"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalId": 123
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "pages": [
        {
            "id": 1,
            "title": "Home Page"
        },
        {
            "id": 2,
            "title": "About Us"
        }
    ],
    "menus": [
        "Dashboard",
        "My Profile",
        "Settings"
    ]
}
 

Example response (400):


{
    "message": "Invalid request. Portal ID is required."
}
 

Request   

GET api/portals/pages/getPortalLearnerPagesMenu

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalId   integer   

The ID of the portal. Example: 123

Retrieve checkout details for a portal order

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portals/checkout" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalId\": \"dolore\",
    \"qty\": \"laboriosam\",
    \"billingAddress\": \"dolorum\",
    \"shippingAddress\": \"sunt\",
    \"selectedBillingAddress\": \"tempore\",
    \"selectedShippingAddress\": \"animi\",
    \"isShippingSameAsBilling\": \"in\",
    \"shippingMethodId\": \"aliquid\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/portals/checkout"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalId": "dolore",
    "qty": "laboriosam",
    "billingAddress": "dolorum",
    "shippingAddress": "sunt",
    "selectedBillingAddress": "tempore",
    "selectedShippingAddress": "animi",
    "isShippingSameAsBilling": "in",
    "shippingMethodId": "aliquid"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "recurringItems": [],
    "hasSubscriptionWithFreeTrial": false,
    "hasSubscriptionProduct": false,
    "productDetails": [],
    "totalTax": 0,
    "conditions": [],
    "taxRates": [],
    "taxSettings": {},
    "total": 0,
    "subtotal": 0,
    "itemQuantity": 1,
    "portalId": 1,
    "currentPortalSeats": 0,
    "cartErrors": {
        "message": null,
        "portalMessages": null
    }
}
 

Request   

GET api/portals/checkout

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalId   required  optional  

The ID of the portal. Example: dolore

qty   required  optional  

The quantity of the product to be purchased. Example: laboriosam

billingAddress   required  optional  

The customer billing address. Example: dolorum

shippingAddress   required  optional  

The customer shipping address. Example: sunt

selectedBillingAddress   required  optional  

The customer selected billing address. Example: tempore

selectedShippingAddress   required  optional  

The customer selected shipping address. Example: animi

isShippingSameAsBilling   required  optional  

Whether the shipping address is the same as the billing address. Example: in

shippingMethodId   required  optional  

The ID of the shipping method. Example: aliquid

Updates the current portal for a user

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/portal/users/updateCurrentPortal?portalId=1&userId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/users/updateCurrentPortal"
);

const params = {
    "portalId": "1",
    "userId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Current portal updated successfully"
}
 

Request   

PUT api/portal/users/updateCurrentPortal

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   integer   

ID of the portal to set as current. Example: 1

userId   integer  optional  

optional ID of the user to update the current portal for. Defaults to the ID of the authenticated user. Example: 1

Retrieve Portal Details Report

Provides detailed report information for portals based on the specified parameters.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/portals/details/report?page_size=10&page_number=1&order_by=doloremque" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/portals/details/report"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "doloremque",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 100,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "name": "Portal 1",
            "parentPortalName": "Parent Portal",
            "totalSeat": 100,
            "usedSeat": 50,
            "status": "active",
            "seatAccess": "open",
            "portalUserIds": [
                1,
                2,
                3
            ],
            "portalAdminsCount": 2,
            "created_by": "Admin User",
            "created_at": "2023-01-01 12:00:00",
            "portalExpireOn": "2024-01-01 12:00:00",
            "totalLearner": 50,
            "portalUserDetails": [
                {
                    "email": "[email protected]",
                    "firstName": "John",
                    "lastName": "Doe",
                    "isLearner": true,
                    "isAdmin": "admin"
                }
            ]
        }
    ]
}
 

Request   

GET api/portals/details/report

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of results per page. Example: 10

page_number   string   

The current page number. Example: 1

order_by   string  optional  

optional The column to sort the results by in the format {"colName": "name", "direction": "asc"} Example: doloremque

Clone a portal and optionally its sub-portal.

This endpoint clones a portal and its associated data (such as branding, settings, etc.), including an optional sub-portal. A new referral code is generated for each cloned portal.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/portal/clone" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"portalId\": 5,
    \"portalName\": \"My Cloned Portal\",
    \"subPortals\": true
}"
const url = new URL(
    "https://demo.aomlms.com/api/portal/clone"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "portalId": 5,
    "portalName": "My Cloned Portal",
    "subPortals": true
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Portal Cloned Successfully"
}
 

Request   

POST api/portal/clone

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

portalId   integer   

The ID of the portal to be cloned. Example: 5

portalName   string   

The name of the new cloned portal. Example: My Cloned Portal

subPortals   boolean  optional  

Optional flag indicating whether to clone a sub-portal. Example: true

Powerpoint

A Powerpoint Module is used as course content. Helps to perform CRUD operation to and for Powerpoint modules.

Powerpoint Modules Tabular List

Returns all the powerpoint modules in a tabular list format with pagination. Filters can be applied using search parameters such as moduleCategoryIds, associatedCourse, and moduleName. Data can be sorted using order_by.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/powerpoint?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22moduleCategoryIds%22%3A+%5B%5D%2C+%22associatedCourse%22%3A+%22%22%2C+%22moduleName%22%3A+%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/powerpoint"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"moduleCategoryIds": [], "associatedCourse": "", "moduleName": ""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 5,
    "records": [
        {
            "id": 1,
            "name": "Powerpoint Module 1",
            "slug": "powerpoint-module-1",
            "type": "powerpoint",
            "icon": "<i class=\"el-icon-presentation\"></i>",
            "author": "John Doe",
            "showMappedCourses": false,
            "created_at": "Aug 03, 2020 09:56 AM",
            "course_count": 2
        }
    ]
}
 

Request   

GET api/modules/powerpoint

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of items per page. Example: 50

page_number   string   

Current page number for pagination. Example: 1

order_by   string  optional  

Optional JSON for sorting items by column. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

Optional JSON for searching by moduleCategoryIds, associatedCourse, and moduleName. Example: {"moduleCategoryIds": [], "associatedCourse": "", "moduleName": ""}

Create a new Powerpoint module

Creates a new Powerpoint module. Returns the ID of the newly created module.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/modules/powerpoint?name=Getting+Started&viewer=microsoft_office&content=%3Cp%3EThis+is+the+content+for+the+module%3C%2Fp%3E&url=https%3A%2F%2Fdrive.google.com%2Ffile%2Fd%2F0B5cbJMbHsJ1gc3RhcnRlcl9ma2Rhc2hlclYw%2Fview%3Fusp%3Dsharing&estimatedCompletion=30&estimationCompletedUnit=hour&categories[]=1&categories[]=2&categories[]=3&categories[]=Category+1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/powerpoint"
);

const params = {
    "name": "Getting Started",
    "viewer": "microsoft_office",
    "content": "<p>This is the content for the module</p>",
    "url": "https://drive.google.com/file/d/0B5cbJMbHsJ1gc3RhcnRlcl9ma2Rhc2hlclYw/view?usp=sharing",
    "estimatedCompletion": "30",
    "estimationCompletedUnit": "hour",
    "categories[0]": "1",
    "categories[1]": "2",
    "categories[2]": "3",
    "categories[3]": "Category 1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 6,
    "message": "Module saved successfully"
}
 

Request   

POST api/modules/powerpoint

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

name   string   

Name of the Powerpoint module. Example: Getting Started

viewer   string   

microsoft_office, google_viewer. Example: microsoft_office

content   string  optional  

Content for the text modules that students will see. Example: <p>This is the content for the module</p>

url   string   

URL or actual path of the Powerpoint module that students will see. Example: https://drive.google.com/file/d/0B5cbJMbHsJ1gc3RhcnRlcl9ma2Rhc2hlclYw/view?usp=sharing

estimatedCompletion   integer  optional  

Estimated time in minutes that a student should take to complete this module. Example: 30

estimationCompletedUnit   string  optional  

Required if estimatedCompletion is set. Example: hour

categories   string[]  optional  

of integers or strings List of categories that this module belongs to. If strings are provided, new categories will be created.

Retrieve a Powerpoint Module

Retrieves a Powerpoint module by given id. Returns its details and associated courses.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/powerpoint/6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/powerpoint/6"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 6,
    "name": "Getting Started",
    "slug": "getting-started",
    "content": "<p>This is the content for the module</p>",
    "url": "https://drive.google.com/file/d/0B5cbJMbHsJ1gc3RhcnRlcl9ma2Rhc2hlclYw/view?usp=sharing",
    "estimatedCompletion": 1,
    "estimationCompletedUnit": "hour",
    "categories": [
        1,
        2
    ],
    "courses": [
        {
            "course_id": 1,
            "course_name": "Course 1"
        },
        {
            "course_id": 2,
            "course_name": "Course 2"
        }
    ]
}
 

Request   

GET api/modules/powerpoint/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the Powerpoint module. Example: 6

Update Powerpoint Module

Updates the details of the specified powerpoint module. (See parameters) Powerpoint modules can be used in the course as course content/lesson.

Returns : successfull message

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/modules/powerpoint/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": \"6\",
    \"viewer\": \"<iframe src=\\\"https:\\/\\/view.officeapps.live.com\\/op\\/embed.aspx?src=https:\\/\\/example.com\\/powerpoint.pptx\\\" width=\\\"100%\\\" height=\\\"600px\\\"><\\/iframe>\",
    \"name\": \"My-powerpoint-lesson\",
    \"content\": \"<p>This is the content for the module<\\/p>\",
    \"url\": \"https:\\/\\/drive.google.com\\/file\\/d\\/0B5cbJMbHsJ1gc3RhcnRlcl9ma2Rhc2hlclYw\\/view?usp=sharing\",
    \"estimatedCompletion\": 30,
    \"estimationCompletedUnit\": \"hour\",
    \"categories\": [
        1,
        2,
        3,
        \"Category 1\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/powerpoint/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": "6",
    "viewer": "<iframe src=\"https:\/\/view.officeapps.live.com\/op\/embed.aspx?src=https:\/\/example.com\/powerpoint.pptx\" width=\"100%\" height=\"600px\"><\/iframe>",
    "name": "My-powerpoint-lesson",
    "content": "<p>This is the content for the module<\/p>",
    "url": "https:\/\/drive.google.com\/file\/d\/0B5cbJMbHsJ1gc3RhcnRlcl9ma2Rhc2hlclYw\/view?usp=sharing",
    "estimatedCompletion": 30,
    "estimationCompletedUnit": "hour",
    "categories": [
        1,
        2,
        3,
        "Category 1"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Module updated successfully"
}
 

Request   

PUT api/modules/powerpoint/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   required  optional  

The ID of the powerpoint module. Example: 6

viewer   required  optional   " data-component="body">

Viewer for the module. Example: <iframe src="https://view.officeapps.live.com/op/embed.aspx?src=https://example.com/powerpoint.pptx" width="100%" height="600px"></iframe>

name   string   

Name of the powerpoint module. Example: My-powerpoint-lesson

content   string   

Content for the powerpoint modules that students will see. Example: <p>This is the content for the module</p>

url   string   

URL or actual path of the powerpoint module that students will see. Example: https://drive.google.com/file/d/0B5cbJMbHsJ1gc3RhcnRlcl9ma2Rhc2hlclYw/view?usp=sharing

estimatedCompletion   integer  optional  

Estimated time in minutes that a student should take to complete this module. Example: 30

estimationCompletedUnit   string  optional  

Required if estimatedCompletion is set. Example: hour

categories   string[]  optional  

of integers or strings List of categories that this module belongs to. If strings are provided, new categories will be created.

Get Powerpoint Module Details

To get the details of a powerpoint module, you need to use this request. (See parameters)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/powerpoint/details" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/powerpoint/details"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "First Powerpoint",
    "slug": "first-powerpoint",
    "content": "A brief description",
    "courseName": "First Course",
    "courseSlug": "http://localhost:8000/courses/1/launch",
    "url": "http://localhost:8000/courses/1/modules/2/launch",
    "totalPoints": 20,
    "shouldBeEvaluated": true,
    "min_time_spent": 90,
    "otherModules": [],
    "launchCheck": {},
    "prevSlug": "first-video",
    "nextSlug": "second-video",
    "currentUserId": 1,
    "currentStudentAvatar": "http://localhost:8000/storage/avatars/1.png",
    "currentUserName": "John Doe",
    "status": "In Progress",
    "statusRowId": 1,
    "timeSpent": 0,
    "course_newly_completed": false,
    "timeToBeSpent": 1,
    "instructorResponse": null
}
 

Request   

GET api/module/powerpoint/details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

registrationId   string   

ID of the course registration. Example: 1

moduleId   string   

ID of the powerpoint module. Example: 2

portalId   integer  optional  

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Retrieve Detailed Powerpoint Module Info

Retrieves details of a Powerpoint module for the current user. Returns related fields such as module name, slug, viewer type, URL, content, and time spent on the module.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/powerpoint/content-details?moduleId=9" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/powerpoint/content-details"
);

const params = {
    "moduleId": "9",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "Module Name",
    "slug": "module-slug",
    "viewer": "google_viewer",
    "url": "//docs.google.com/viewer?url=...",
    "content": "Module content here...",
    "timeSpent": 120
}
 

Request   

GET api/module/powerpoint/content-details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

moduleId   string   

The ID of the Powerpoint module. Example: 9

Questions

Manage Questions. Questions can be added in the Quiz module for learners to answer. Helps to perform CRUD operations for and to questions.

Questions Tabular List

Returns all the questions in a tabular list format in paginated mode. You can apply filter using search_param via questionTypes, questionCategoryIds, quizModuleId and questionName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/questions/tabularlist?page_size=50&page_number=1&order_by=%7B%22colName%22%3A+%22name%22%2C+%22direction%22%3A+%22asc%22%7D&search_param=%7B%22questionTypes%22%3A%5B%5D%2C%22questionCategoryIds%22%3A%5B%5D%2C%22quizModuleId%22%3A%22%22%2C%22questionName%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/questions/tabularlist"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName": "name", "direction": "asc"}",
    "search_param": "{"questionTypes":[],"questionCategoryIds":[],"quizModuleId":"","questionName":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "title": "Question-1",
            "type": "multiple_choice",
            "display_type": "Multiple Choice",
            "categories": "Category-1",
            "author": "John Doe",
            "created_at": "2021-01-01 12:00:00"
        }
    ]
}
 

Request   

GET api/questions/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName": "name", "direction": "asc"}

search_param   string  optional  

for searching items based on field names. Example: {"questionTypes":[],"questionCategoryIds":[],"quizModuleId":"","questionName":""}

Lookup for question types.

Returns an array of all available question types.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/questions/type/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/questions/type/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "db_value": "multiple_choice",
    "display_value": "Multiple Choice"
}
 

Request   

GET api/questions/type/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Lookup for questions.

Searches for questions based on a search term provided in the request. Returns a list of questions with their IDs and titles that match the search term. The response is formatted to include 'value' as the question ID and 'label' as the question title for each matching question.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/question/lookup?search_term=nobis" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/question/lookup"
);

const params = {
    "search_term": "nobis",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "value": 1,
        "label": "Question Title 1"
    },
    {
        "value": 2,
        "label": "Question Title 2"
    }
]
 

Request   

GET api/question/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

search_term   string   

The term to search for in question titles. Example: nobis

Quick Edit

Updates the details in bulk for a specified question. Parameters is provided which needs to be updated. (See Parameters)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/questions/quickEdit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"question_ids\": [
        3,
        2
    ],
    \"author_id\": 1,
    \"categories_id\": [
        6
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/questions/quickEdit"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "question_ids": [
        3,
        2
    ],
    "author_id": 1,
    "categories_id": [
        6
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Questions updated Successfully"
}
 

Request   

POST api/questions/quickEdit

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

question_ids   string[]   

All question IDs which needs to be updated.

author_id   integer  optional  

Update the instructor/Author for the selected questions. Example: 1

categories_id   string[]  optional  

Update the categories of selected questions.

Creates a new question with the given details.

Validates the question details and stores the question in the database.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/questions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"title\": \"Q1\",
    \"content\": \"<p>This is the short content here<\\/p>\",
    \"type\": \"multiple_choice\",
    \"hint\": \"SpaceX owner\",
    \"explanation\": \"Elon owns Tesla car company\",
    \"categories\": [
        12,
        16
    ],
    \"options\": [
        \"soluta\"
    ],
    \"matchPossibilities\": \"{ \\\"item\\\": \\\"Apple\\\", \\\"match\\\": \\\"Fruit\\\" }\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/questions"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "title": "Q1",
    "content": "<p>This is the short content here<\/p>",
    "type": "multiple_choice",
    "hint": "SpaceX owner",
    "explanation": "Elon owns Tesla car company",
    "categories": [
        12,
        16
    ],
    "options": [
        "soluta"
    ],
    "matchPossibilities": "{ \"item\": \"Apple\", \"match\": \"Fruit\" }"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 4,
    "message": "Question saved successfully"
}
 

Request   

POST api/questions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

title   string   

Title of the question. Example: Q1

content   string  optional  

Content for the text modules that students will see. Example: <p>This is the short content here</p>

type   string   

Type of the question. Type options: multiple_choice, multiple_correct or short_answers. Example: multiple_choice

hint   string  optional  

Hint for the question for students. Example: SpaceX owner

explanation   string  optional  

Explanation of the answer for students. Example: Elon owns Tesla car company

categories   string[]  optional  

Categories for the question.

options   string[]  optional  

Options and correct answer for this question.

matchPossibilities   string  optional  

Match possibilities for the question. Example: { "item": "Apple", "match": "Fruit" }

Retrieves the details of a specified question. Helps in fetching question using its ID. (See Parameters)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/question/2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/question/2"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 4,
    "title": "Q1",
    "content": "<p>This is the short content here</p>",
    "hint": "SpaceX owner",
    "explanation": "Elon owns Tesla car company",
    "type": "multiple_choice",
    "categories": [
        12,
        16
    ],
    "options": [
        {
            "value": "Elon Musk",
            "is_correct": true
        },
        {
            "value": "Jeff bezos",
            "is_correct": false
        }
    ]
}
 

Request   

GET api/question/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer   

ID of the question you want to fetch the details of. Example: 2

Update Question

Updates the details of a specified question. (See parameters) Questions can be used in the quizzes as quiz's content.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/question/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": \"7\",
    \"title\": \"Q1\",
    \"content\": \"<p>This is the short content here<\\\\\\/p>\",
    \"type\": \"multiple_choice\",
    \"hint\": \"Hint here\",
    \"explanation\": \"This is the explanation\",
    \"options\": \"[{value: \\\\\\\"Elon Musk\\\\\\\", is_correct: true}, {value: \\\\\\\"Jeff bezos\\\\\\\", is_correct: false}]\",
    \"categories\": [
        3,
        4
    ],
    \"matchPossibilities\": \"Possibility 1, Possibility 2\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/question/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": "7",
    "title": "Q1",
    "content": "<p>This is the short content here<\\\/p>",
    "type": "multiple_choice",
    "hint": "Hint here",
    "explanation": "This is the explanation",
    "options": "[{value: \\\"Elon Musk\\\", is_correct: true}, {value: \\\"Jeff bezos\\\", is_correct: false}]",
    "categories": [
        3,
        4
    ],
    "matchPossibilities": "Possibility 1, Possibility 2"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Question updated successfully"
}
 

Request   

PUT api/question/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   required  optional  

ID of the question you want to edit. Example: 7

title   required  optional  

Title of the question. Example: Q1

content   string  optional  

Content for the text modules that students will see. Example: <p>This is the short content here<\/p>

type   required  optional  

Type of the question. Type options: multiple_choice, multiple_correct or short_answers. Example: multiple_choice

hint   string  optional  

Hint for the question for students. Example: Hint here

explanation   string  optional  

Explanation of the answer for students. Example: This is the explanation

options   required  optional  

Array of options and correct answer for this question. Example: [{value: \"Elon Musk\", is_correct: true}, {value: \"Jeff bezos\", is_correct: false}]

categories   string[]  optional  

Categories of the question.

matchPossibilities   string   

if type is match_answers. Example: Possibility 1, Possibility 2

Delete question

To delete a question, you need to use this request. Returns number of question deleted(if multiple selected) and also not deleted. (See Response)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/question/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"delete_ids\": [
        1,
        12,
        15
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/question/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "delete_ids": [
        1,
        12,
        15
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "3 question(s) deleted 2 question(s) not deleted as it is used in quiz. Please remove the question(s) from the quiz and try again.",
    "deletedQuestions": [
        1,
        2,
        3
    ],
    "notDeletedQuestions": [
        5,
        6
    ],
    "usedInPlaces": {
        "Question Category-1": [
            {
                "id": 1,
                "name": "Quiz-1"
            }
        ],
        "Question Category-2": [
            {
                "id": 2,
                "name": "Quiz-2"
            }
        ]
    }
}
 

Request   

POST api/question/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string[]   

All question IDs which needs to be deleted.

Bulk upload questions from CSV file

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/question/bulkUpload" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"questionList\": [
        \"deserunt\"
    ],
    \"quizIds\": [
        \"at\"
    ],
    \"quiztype\": \"non\",
    \"newQuiz\": \"labore\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/question/bulkUpload"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "questionList": [
        "deserunt"
    ],
    "quizIds": [
        "at"
    ],
    "quiztype": "non",
    "newQuiz": "labore"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "message": "Question(s) uploaded successfully",
    "status": "success",
    "title": "Success",
    "errors": [
        [
            "Row #1 : Question Type is not correct.",
            "Row #2 : Empty Title/Title too large(It must be under 500 characters).",
            "Row #2 : Multiple Choice - Incorrect value in Correct_Answer column. Correct_Answer column must contain only Numbers(>0)"
        ]
    ],
    "successfulRow": 4,
    "skipped": 2,
    "insertedQuestions": [
        {
            "id": 1,
            "title": "Question1"
        },
        {
            "id": 2,
            "title": "Question2"
        },
        {
            "id": 3,
            "title": "Question3"
        },
        {
            "id": 4,
            "title": "Question4"
        }
    ]
}
 

Request   

POST api/question/bulkUpload

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

questionList   string[]   

Question List. See the example request.

quizIds   string[]   

Quiz Ids to which the questions should be added

quiztype   string   

Type of quiz, new or existing Example: non

newQuiz   string   

Name of the new quiz Example: labore

QuickBooks Integration

This controller handles all API interactions related to QuickBooks integration. * Endpoints in this controller are responsible for managing QuickBooks-specific operations, ensuring seamless integration between the system and QuickBooks.

Returns all the QuickBooks logs in a tabular list format in paginated mode.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/quickbooks/logs?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22entity%22%3A+%22order%22%2C+%22entityId%22%3A+10%2C+%22status%22%3A+%22success%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/quickbooks/logs"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"entity": "order", "entityId": 10, "status": "success"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "event": "new_account_created",
            "data": [],
            "status": "success",
            "errorMessage": "",
            "created_at": "Aug 03, 2020 09:56 AM",
            "showData": false
        }
    ]
}
 

Request   

GET api/quickbooks/logs

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the QuickBooks action. Example: 50

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

For filtering records based on the columns provided in JSON format. Example: {"entity": "order", "entityId": 10, "status": "success"}

Quizzes

A Quiz Module is a quiz used as course content. Helps to perform CRUD operation to and for quiz modules.

Quizzes Tabular List

Returns all the quizzes in a tabular list format with pagination. Filters can be applied using search parameters for associated courses and module names.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/quiz?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22associatedCourse%22%3A+%22%22%2C+%22moduleName%22%3A+%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/quiz"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"associatedCourse": "", "moduleName": ""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 5,
    "records": [
        {
            "id": 1,
            "name": "Quiz 1",
            "slug": "quiz-1",
            "type": "quiz",
            "totalQuestions": 5,
            "icon": "<i class=\"el-icon-tickets\"></i>",
            "author": "John Doe",
            "showMappedCourses": false,
            "created_at": "Aug 03, 2020 09:56 AM",
            "course_count": 2
        }
    ]
}
 

Request   

GET api/modules/quiz

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of items per page. Example: 50

page_number   string   

Current page number for pagination. Example: 1

order_by   string  optional  

Optional JSON for sorting items by column. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

Optional JSON for searching by associatedCourse and moduleName. Example: {"associatedCourse": "", "moduleName": ""}

Creates a new Quiz Module.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/modules/quiz" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"nam\",
    \"content\": \"aut\",
    \"type\": \"eius\",
    \"showCorrectAnswerOption\": \"dolorum\",
    \"shuffleQuestions\": false,
    \"forceSequential\": false,
    \"realTimeGrading\": true,
    \"noOfRetakesAllowed\": 7,
    \"minimumPassingMarks\": 18,
    \"questions\": \"vero\",
    \"questionCategories\": \"praesentium\",
    \"maxSpentHour\": 5,
    \"maxSpentMinutes\": 8,
    \"estimatedCompletion\": \"autem\",
    \"estimationCompletedUnit\": \"qui\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/quiz"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "nam",
    "content": "aut",
    "type": "eius",
    "showCorrectAnswerOption": "dolorum",
    "shuffleQuestions": false,
    "forceSequential": false,
    "realTimeGrading": true,
    "noOfRetakesAllowed": 7,
    "minimumPassingMarks": 18,
    "questions": "vero",
    "questionCategories": "praesentium",
    "maxSpentHour": 5,
    "maxSpentMinutes": 8,
    "estimatedCompletion": "autem",
    "estimationCompletedUnit": "qui"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Module saved successfully"
}
 

Request   

POST api/modules/quiz

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   required  optional  

The name of the quiz module. Example: nam

content   string  optional  

The content of the quiz module. Example: aut

type   required  optional  

The type of the quiz, either static or dynamic. Example: eius

showCorrectAnswerOption   required  optional  

Whether to show correct answer. Options: always, never, not_till_retake_allowed. Example: dolorum

shuffleQuestions   boolean  optional  

Whether to shuffle the questions. Example: false

forceSequential   boolean  optional  

Whether to force the questions sequential. Example: false

realTimeGrading   boolean  optional  

Whether to grade the quiz in real time. Example: true

noOfRetakesAllowed   integer  optional  

The number of retakes allowed. 0 means unlimited. Example: 7

minimumPassingMarks   integer  optional  

The minimum passing marks. Example: 18

questions   required_if:type,static  optional  

The questions to be included in the quiz. Example: vero

questionCategories   required_if:type,dynamic  optional  

The categories of questions to be included in the quiz. Example: praesentium

maxSpentHour   integer  optional  

The maximum time to be spent in hours. Example: 5

maxSpentMinutes   integer  optional  

The maximum time to be spent in minutes. Example: 8

estimatedCompletion   string  optional  

The estimated time to complete the quiz. Example: autem

estimationCompletedUnit   string  optional  

The unit of estimated time to complete the quiz. Example: qui

Get Quiz Module

Returns the details of the specified quiz module.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/quiz/{id}?id=6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/quiz/{id}"
);

const params = {
    "id": "6",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 8,
    "name": "Quiz-2",
    "slug": "quiz-2",
    "content": "<p>afegrshtdh</p>",
    "type": "static",
    "shuffleQuestions": true,
    "forceSequential": true,
    "realTimeGrading": true,
    "showCorrectAnswerOption": "always",
    "noOfRetakesAllowed": 3,
    "minimumPassingMarks": null,
    "questions": [
        {
            "id": 3,
            "title": "Is red a color?"
        }
    ],
    "questionCategories": [],
    "maxSpentMinutes": "",
    "maxSpentHour": ""
}
 

Request   

GET api/modules/quiz/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

ID of the quiz module. Example: 6

Update Quiz Module

Updates the details of a specified quiz module. This includes both static and dynamic types. Validates and processes the module details, including questions or question categories, and updates the associated database records accordingly.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/modules/quiz/5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Quiz-1\",
    \"content\": \"<p>Quiz content<\\/p>\",
    \"type\": \"et\",
    \"showCorrectAnswerOption\": \"qui\",
    \"shuffleQuestions\": true,
    \"forceSequential\": true,
    \"realTimeGrading\": false,
    \"noOfRetakesAllowed\": 4,
    \"minimumPassingMarks\": 4,
    \"questions\": [
        \"voluptatem\"
    ],
    \"questionCategories\": [
        \"dolorum\"
    ],
    \"maxSpentHour\": 16,
    \"maxSpentMinutes\": 11,
    \"estimatedCompletion\": \"00:30:00\",
    \"estimationCompletedUnit\": \"minutes\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/quiz/5"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Quiz-1",
    "content": "<p>Quiz content<\/p>",
    "type": "et",
    "showCorrectAnswerOption": "qui",
    "shuffleQuestions": true,
    "forceSequential": true,
    "realTimeGrading": false,
    "noOfRetakesAllowed": 4,
    "minimumPassingMarks": 4,
    "questions": [
        "voluptatem"
    ],
    "questionCategories": [
        "dolorum"
    ],
    "maxSpentHour": 16,
    "maxSpentMinutes": 11,
    "estimatedCompletion": "00:30:00",
    "estimationCompletedUnit": "minutes"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 5,
    "message": "Module saved successfully"
}
 

Request   

PUT api/modules/quiz/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the quiz module to be updated. Example: 5

Body Parameters

name   string   

Name of the quiz module. Example: Quiz-1

content   string  optional  

Content for the quiz module. Example: <p>Quiz content</p>

type   string   

Type of the quiz, either 'static' or 'dynamic'. Example: et

showCorrectAnswerOption   string   

Option to show correct answers: always, never, or not_till_retake_allowed. Example: qui

shuffleQuestions   boolean  optional  

Shuffle the questions in the quiz. Example: true

forceSequential   boolean  optional  

Display questions in a fixed order. Example: true

realTimeGrading   boolean  optional  

Enable real-time grading. Example: false

noOfRetakesAllowed   integer  optional  

Maximum number of retakes allowed for the quiz. Maximum: 9999. Example: 4

minimumPassingMarks   integer  optional  

Minimum percentage required to pass the quiz. Example: 4

questions   string[]  optional  

required_if:type,static List of questions for static quizzes.

questionCategories   string[]  optional  

required_if:type,dynamic List of question categories for dynamic quizzes.

maxSpentHour   integer  optional  

Maximum hours allowed for the quiz. Minimum: 0. Example: 16

maxSpentMinutes   integer  optional  

Maximum minutes allowed for the quiz. Minimum: 0. Example: 11

estimatedCompletion   string  optional  

Estimated time to complete the quiz. Example: 00:30:00

estimationCompletedUnit   string  optional  

Unit of estimated time to complete. Example: minutes

Retrieves the details of the specified quiz module. Helps in fetching quiz module using module ID.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/quiz/details?moduleId=1&registrationId=2&portalId=3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/quiz/details"
);

const params = {
    "moduleId": "1",
    "registrationId": "2",
    "portalId": "3",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "Quiz-2",
    "slug": "quiz-2",
    "content": "<p>afegrshtdh</p>",
    "courseId": 6,
    "courseName": "Course 1",
    "courseSlug": "/course/1/launch",
    "type": "static",
    "shuffleQuestion": true,
    "forceSequential": true,
    "realTimeGrading": true,
    "showCorrectAnswerOption": "always",
    "minimumPassingMarks": null,
    "maxTimer": "",
    "maxRetakesAllowed": 0,
    "min_time_spent": 0,
    "questions": [],
    "otherModules": [],
    "launchCheck": {
        "canbeLaunched": true,
        "reason": ""
    },
    "userId": 1,
    "showInstructionButton": true,
    "prevSlug": "",
    "nextSlug": ""
}
 

Request   

GET api/module/quiz/details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

moduleId   string   

ID of the module. Example: 1

registrationId   string   

ID of the course registration. Example: 2

portalId   string   

ID of the portal. Example: 3

Save the answer of the question in the quiz module

Saves the answer of the question in the quiz module. Updates the status of quiz to completed if student is finished the quiz and submits. (See Parameters)

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/modules/quiz/{id}/saveAnswer?questionId=1&moduleStatusId=10&isAnswerSubmitted=true&markedAnswer=A" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/quiz/{id}/saveAnswer"
);

const params = {
    "questionId": "1",
    "moduleStatusId": "10",
    "isAnswerSubmitted": "true",
    "markedAnswer": "A",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Answer saved successfully",
    "isCorrect": true
}
 

Request   

PUT api/modules/quiz/{id}/saveAnswer

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

questionId   string   

ID of the question is user is answering. Example: 1

moduleStatusId   string   

ID of the Module status of the current quiz. Example: 10

isAnswerSubmitted   string   

boolean to check if answer is submitted or not. Example: true

markedAnswer   string   

Answer marked by the user. Example: A

Submits the quiz after attempting all the questions of the quiz. Updates the status of quiz to completed if student is finished the quiz and submits.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/modules/quiz/{id}/submitQuiz?portalId=1&questions=%5B%7B%22id%22%3A1%2C%22type%22%3A%22multiple_choice%22%2C%22markedAnswer%22%3A%22A%22%7D%5D&statusRowId=10&retakeCounter=2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/quiz/{id}/submitQuiz"
);

const params = {
    "portalId": "1",
    "questions": "[{"id":1,"type":"multiple_choice","markedAnswer":"A"}]",
    "statusRowId": "10",
    "retakeCounter": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Quiz Submitted Successfully",
    "course_newly_completed": false
}
 

Request   

PUT api/modules/quiz/{id}/submitQuiz

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

portalId   string   

The ID of the portal for the user. Example: 1

questions   string   

An array of questions in the current quiz. Example: [{"id":1,"type":"multiple_choice","markedAnswer":"A"}]

statusRowId   string   

The ID of the module status for the current quiz. Example: 10

retakeCounter   string   

The number of times the quiz has been retaken. Example: 2

Get Quiz Module Results

Retrieves the quiz module results based on the status row ID specified.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/quiz/results?statusRowId=10&studentId=2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/quiz/results"
);

const params = {
    "statusRowId": "10",
    "studentId": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "Quiz 1",
    "slug": "quiz-1",
    "status": "Completed",
    "questions": [
        {
            "id": 1,
            "title": "Question 1",
            "type": "Multiple Choice",
            "content": "What is your question?",
            "explanation": "This is the explanation",
            "is_correct": true,
            "marked_answer": "A",
            "correct_answer": "A",
            "created_at": "2020-03-03 10:30:00"
        }
    ],
    "studentName": "John Doe",
    "totalQuestions": 5,
    "totalCorrect": 4,
    "totalInCorrect": 1,
    "minimumPassingAchieved": true,
    "score": 80,
    "percentAchieved": 80,
    "showCorrectAnswerOption": true,
    "courseCompleted": false,
    "totalRetakeallowed": 3,
    "attemptCount": 2,
    "timeSpent": "00:30:00",
    "minimumPassingMarks": 90,
    "isRetakeAllowed": true
}
 

Request   

GET api/module/quiz/results

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

statusRowId   string   

The ID of the status row. Example: 10

studentId   string   

The ID of the student. Example: 2

Quiz Lookup

Retrieves all the quiz modules. Helps while showing quiz names in form elements like dropdown. You can apply filters using search_term parameter. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/quiz/dropdownlist?search_term=molestiae" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/quiz/dropdownlist"
);

const params = {
    "search_term": "molestiae",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "value": 1,
        "label": "First-quiz"
    },
    {
        "value": 2,
        "label": "Quiz-2"
    }
]
 

Request   

GET api/quiz/dropdownlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

search_term   string   

The name or substring of the quiz name to search for that module. Example: molestiae

Returns the analysis details of a quiz, including the questions, options selected, percentages etc.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/quiz/quizAnalysis" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"page_size\": 17,
    \"page_number\": 14,
    \"search_param\": \"aspernatur\",
    \"quiz_id\": 10
}"
const url = new URL(
    "https://demo.aomlms.com/api/quiz/quizAnalysis"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "page_size": 17,
    "page_number": 14,
    "search_param": "aspernatur",
    "quiz_id": 10
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "quizName": "Quiz Example",
    "totalSubmissions": 5,
    "questionDetails": [
        {
            "id": 1,
            "name": "What is your name?",
            "questionType": "Multiple Choice",
            "correctOption": [
                1,
                2
            ],
            "optionsWithPercentage": {
                "Option A": 20,
                "Option B": 40,
                "Option C": 40
            }
        },
        {
            "id": 2,
            "name": "What is your age?",
            "questionType": "Short Answer",
            "correctOption": [],
            "optionsWithPercentage": {
                "18-24": 60,
                "25-34": 20,
                "35-44": 20
            }
        }
    ],
    "totalQuestions": 5,
    "recordsFiltered": 5,
    "quizStatistics": {
        "averageScore": 80,
        "averageTimeSpent": "00:30:00",
        "totalSubmissions": 5
    },
    "averageTimeSpent": "00:30:00",
    "totalAttempts": 10,
    "headers": [
        "optionName_1",
        "markedPercentageOfOption_1",
        "optionName_2",
        "markedPercentageOfOption_2",
        "optionName_3",
        "markedPercentageOfOption_3"
    ]
}
 

Request   

GET api/quiz/quizAnalysis

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

page_size   integer   

The number of records to return per page. Example: 17

page_number   integer   

The page number to return. Example: 14

search_param   string  optional  

The search query to filter the results by. Example: aspernatur

quiz_id   integer   

The id of the quiz module. Example: 10

Get the question submission details

Retrieves the question submission details based on the question ID and quiz ID specified.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/quiz/getQuestionSubmissionDetails?quiz_id=1&question_id=1&page_size=10&page_number=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/quiz/getQuestionSubmissionDetails"
);

const params = {
    "quiz_id": "1",
    "question_id": "1",
    "page_size": "10",
    "page_number": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "totalRecords": 100,
    "records": [
        {
            "courseName": "Course 1",
            "firstName": "John",
            "lastName": "Doe",
            "email": "[email protected]",
            "questionType": "Multiple Choice",
            "markedAnswer": "A",
            "isCorrectResponse": "Yes"
        }
    ]
}
 

Request   

GET api/quiz/getQuestionSubmissionDetails

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

quiz_id   string   

The ID of the quiz. Example: 1

question_id   string   

The ID of the question. Example: 1

page_size   string   

The number of records to be returned in a single page. Example: 10

page_number   string   

The page number to be returned. Example: 1

Downloads the quiz response as a PDF.

Generates a PDF file containing the details of the quiz response, including the name, retake information, time spent, questions, answers, and scores. The PDF is then returned as a downloadable file.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/quiz/pdf/{id}?statusRowId=consequuntur" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/quiz/pdf/{id}"
);

const params = {
    "statusRowId": "consequuntur",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


PDF file containing the quiz response details.
 

Request   

GET api/quiz/pdf/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

statusRowId   string   

The ID of the status row. Example: consequuntur

Send the quiz score achieved by the user to the LTI consumer.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/quiz/sendScore?statusRowId=10&userId=2&ltiRegistrationId=1&courseId=3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/quiz/sendScore"
);

const params = {
    "statusRowId": "10",
    "userId": "2",
    "ltiRegistrationId": "1",
    "courseId": "3",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "success",
    "message": "Score submitted successfully."
}
 

Example response (500):


{
    "status": "error",
    "message": "Error occured while submitting the score in a LTI. ModuleStatusId #<statusRowId> Error = <error message>"
}
 

Request   

POST api/quiz/sendScore

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

statusRowId   string   

The ID of the status row. Example: 10

userId   string   

The ID of the user. Example: 2

ltiRegistrationId   string   

The ID of the LTI registration. Example: 1

courseId   string   

The ID of the course. Example: 3

Get the quiz module content details

Retrieves the quiz module content details based on the quiz ID specified.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/quiz/content-details?id=1&name=Quiz+1&content=Quiz+1+content&type=static&shuffleQuestions=true&forceSequential=true&realTimeGrading=true&slug=quiz-1&showCorrectAnswerOption=always&noOfRetakesAllowed=2&questionCategories=%5B%7B%22categoryId%22%3A+1%2C+%22numOfQuestions%22%3A+2%7D%5D&questions=%5B%7B%22id%22%3A+1%2C+%22title%22%3A+%22Question+1%22%2C+%22content%22%3A+%22Question+1+content%22%2C+%22type%22%3A+%22multiple_choice%22%2C+%22hint%22%3A+%22Hint+1%22%2C+%22explanation%22%3A+%22Explanation+1%22%7D%5D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/quiz/content-details"
);

const params = {
    "id": "1",
    "name": "Quiz 1",
    "content": "Quiz 1 content",
    "type": "static",
    "shuffleQuestions": "true",
    "forceSequential": "true",
    "realTimeGrading": "true",
    "slug": "quiz-1",
    "showCorrectAnswerOption": "always",
    "noOfRetakesAllowed": "2",
    "questionCategories": "[{"categoryId": 1, "numOfQuestions": 2}]",
    "questions": "[{"id": 1, "title": "Question 1", "content": "Question 1 content", "type": "multiple_choice", "hint": "Hint 1", "explanation": "Explanation 1"}]",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Quiz 1",
    "content": "Quiz 1 content",
    "type": "static",
    "shuffleQuestions": true,
    "forceSequential": true,
    "realTimeGrading": true,
    "slug": "quiz-1",
    "showCorrectAnswerOption": "always",
    "noOfRetakesAllowed": 2,
    "questionCategories": [
        {
            "categoryId": 1,
            "numOfQuestions": 2
        }
    ],
    "questions": [
        {
            "id": 1,
            "title": "Question 1",
            "content": "Question 1 content",
            "type": "multiple_choice",
            "hint": "Hint 1",
            "explanation": "Explanation 1"
        }
    ]
}
 

Request   

GET api/module/quiz/content-details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

The ID of the quiz. Example: 1

name   string   

The name of the quiz. Example: Quiz 1

content   string   

The content of the quiz. Example: Quiz 1 content

type   string   

The type of the quiz. Example: static

shuffleQuestions   string  optional  

optional Whether to shuffle the questions or not. Example: true

forceSequential   string  optional  

optional Whether to force sequential questions or not. Example: true

realTimeGrading   string  optional  

optional Whether to enable real time grading or not. Example: true

slug   string   

The slug of the quiz. Example: quiz-1

showCorrectAnswerOption   string   

The option to show correct answer. Example: always

noOfRetakesAllowed   string   

The number of retakes allowed. Example: 2

questionCategories   string   

The question categories. Example: [{"categoryId": 1, "numOfQuestions": 2}]

questions   string   

The questions. Example: [{"id": 1, "title": "Question 1", "content": "Question 1 content", "type": "multiple_choice", "hint": "Hint 1", "explanation": "Explanation 1"}]

SCORM Packages

SCORM packages can be used in course as course scorm module. Endpoints for managing SCORM Packages.

Tabular List

Retrieves all the SCORM packages in a tabular list format in paginated mode. You can apply filter using search_param via name(package name), scormTypes(scorm type).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/scormpackages/tabularlist?page_size=50&page_number=1&order_by=%7B%22colName%22%3A+%22name%22%2C+%22direction%22%3A+%22asc%22%7D&search_param=%7B%22name%22%3A+%22my+package%22%2C+%22scormTypes%22%3A+%5B%22SCORM+1.2%22%2C+%22xAPI%22%5D%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/scormpackages/tabularlist"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName": "name", "direction": "asc"}",
    "search_param": "{"name": "my package", "scormTypes": ["SCORM 1.2", "xAPI"]}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "name": "My Package",
            "url": "https://example.com/scorm/1",
            "uploadId": 1,
            "launchFile": "launch.html",
            "status": "Completed",
            "downloadStatus": "Completed",
            "downloadPath": "https://example.com/scorm/1.zip",
            "full_url": "https://example.com/scorm/1.zip",
            "version": "SCORM 1.2",
            "author": "John Doe",
            "created_at": "2021-01-01 12:00:00"
        }
    ]
}
 

Request   

GET api/scormpackages/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName": "name", "direction": "asc"}

search_param   string  optional  

for searching items based on field names. Example: {"name": "my package", "scormTypes": ["SCORM 1.2", "xAPI"]}

Retrieve scorm type lookup

Returns all the supported scorm types in a list format.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/scormpackages/scormTypeLookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/scormpackages/scormTypeLookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {'db_value' : 'SCORM 1.2', 'display_value' : 'Scorm version 1.2'},
    {'db_value' : 'SCORM 2004', 'display_value' : 'Scorm version 2004'},
    {'db_value' : 'xAPI', 'display_value' : 'xAPI'}
]
 

Request   

GET api/scormpackages/scormTypeLookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Get Scorm Package

Fetch the details of a specified scorm package. (See parameters) Scorm packages can be used in course as course content/lesson.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/scormpackage/{id}?id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/scormpackage/{id}"
);

const params = {
    "id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "New Scorm",
    "url": "https://aomlms.com/scorm/sample-course/scormcontent/index.html",
    "version": "1.2",
    "launch_file": "index_lms.html"
}
 

Request   

GET api/scormpackage/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

ID of the scorm package you want to fetch the details of. Example: 1

Deletes a scorm package.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/scormpackage/delete" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/scormpackage/delete"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "1 package(s) deleted 0 package(s) not deleted as it is used in Module. Please remove the scorm Package from the module and try again."
}
 

Request   

POST api/scormpackage/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

delete_ids   string   

IDs of the scorm package you want to delete. Example: maiores

Download a SCORM package

This endpoint downloads a SCORM package by ID. After download, the status is reset to "Not Started" and the download path is cleared. The file is automatically deleted after being sent.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/scormpackage/download" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 5
}"
const url = new URL(
    "https://demo.aomlms.com/api/scormpackage/download"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 5
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


file binary The SCORM package ZIP file.
 

Request   

POST api/scormpackage/download

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   integer   

The ID of the SCORM package to download. Example: 5

Export Scorm Package

Only admin, owner and staff can export the scorm package.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/scormpackage/export" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/scormpackage/export"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "In Progress"
}
 

Request   

POST api/scormpackage/export

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the scorm package you want to export. Example: in

Returns the status of a scorm package.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/scormpackage/getDownloadStatus/aperiam" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/scormpackage/getDownloadStatus/aperiam"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "Not Started"
}
 

Request   

GET api/scormpackage/getDownloadStatus/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the scorm package. Example: aperiam

SCORMs

An SCORM Module is used as course content. Helps to perform CRUD operation to and for SCORM modules.

Get fake Tin Can state

Returns a JSON response of true.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/aom-tincan-fake/v1/activities/state" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/aom-tincan-fake/v1/activities/state"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "success": true
}
 

Request   

GET api/aom-tincan-fake/v1/activities/state

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

modulesStatusId   integer   

ID of the module status you want to update the Tin Can state of. Example: 3

Get fake Tin Can state

Returns a JSON response of true.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/aom-tincan-fake/v1/activities/state" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/aom-tincan-fake/v1/activities/state"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "success": true
}
 

Request   

PUT api/aom-tincan-fake/v1/activities/state

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

modulesStatusId   integer   

ID of the module status you want to update the Tin Can state of. Example: 10

Get fake Tin Can state

Returns a JSON response of true.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/aom-tincan-fake/v1/statements" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/aom-tincan-fake/v1/statements"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "success": true
}
 

Request   

PUT api/aom-tincan-fake/v1/statements

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

modulesStatusId   integer   

ID of the module status you want to update the Tin Can state of. Example: 18

Get TinCan (xAPI) state for a module in a course registration.

This endpoint retrieves the SCORM/xAPI state (like suspend_data or other tracking keys) for a specific module within a registered course. The state is retrieved based on the stateId and a given registration string.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/aom-tincan/v1/activities/state?stateId=suspend_data&activityId=http%3A%2F%2Fexample.com%2Factivity&registration=123%7C456%7C789" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/aom-tincan/v1/activities/state"
);

const params = {
    "stateId": "suspend_data",
    "activityId": "http://example.com/activity",
    "registration": "123|456|789",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "suspend_data": "c2Vzc2lvbl9zdGF0ZT0yMDE=",
    "progress": "75%",
    "lesson_status": "incomplete"
}
 

Example response (404):


{
    "message": "Course registration or module not found."
}
 

Request   

GET api/aom-tincan/v1/activities/state

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

stateId   string   

The key/state ID to retrieve (e.g., suspend_data). Example: suspend_data

activityId   string   

The activity ID of the xAPI object. Example: http://example.com/activity

registration   string   

Pipe-separated values: registrationId|moduleId|packageId. Example: 123|456|789

Update TinCan (xAPI) state for a module in a course registration.

This endpoint allows updating a SCORM/xAPI state value (e.g., suspend_data or lesson_status) for a specific module within a course registration. If a state already exists, it will be updated; otherwise, a new state record will be created.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/aom-tincan/v1/activities/state?stateId=suspend_data&activityId=http%3A%2F%2Fexample.com%2Factivity&registration=123%7C456%7C789" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"string\": \"{\\\"score\\\":85,\\\"lesson_status\\\":\\\"completed\\\"}\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/aom-tincan/v1/activities/state"
);

const params = {
    "stateId": "suspend_data",
    "activityId": "http://example.com/activity",
    "registration": "123|456|789",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "string": "{\"score\":85,\"lesson_status\":\"completed\"}"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


true
 

Example response (404):


{
    "message": "Course registration or module not found."
}
 

Request   

PUT api/aom-tincan/v1/activities/state

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

stateId   string   

The key/state ID to update. Example: suspend_data

activityId   string   

The activity ID of the xAPI object. Example: http://example.com/activity

registration   string   

Pipe-separated values: registrationId|moduleId|packageId. Example: 123|456|789

Body Parameters

string   required  optional  

Raw SCORM/xAPI value to store in the state. Example: {"score":85,"lesson_status":"completed"}

Save TinCan (xAPI) statement for course progress tracking.

This endpoint accepts and stores xAPI statements sent by a learning module. It handles different types of verbs like attempted, completed, passed, failed, and answered, and processes scoring, progress, and interactions accordingly.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/aom-tincan/v1/statements" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"verb\": {
        \"id\": \"http:\\/\\/adlnet.gov\\/expapi\\/verbs\\/completed\"
    },
    \"object\": [],
    \"result\": {
        \"score\": {
            \"raw\": 90,
            \"max\": 100
        },
        \"success\": true,
        \"completion\": true
    },
    \"timestamp\": \"2024-05-01T10:00:00Z\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/aom-tincan/v1/statements"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "verb": {
        "id": "http:\/\/adlnet.gov\/expapi\/verbs\/completed"
    },
    "object": [],
    "result": {
        "score": {
            "raw": 90,
            "max": 100
        },
        "success": true,
        "completion": true
    },
    "timestamp": "2024-05-01T10:00:00Z"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


true
 

Request   

PUT api/aom-tincan/v1/statements

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

verb   object   

The verb of the xAPI statement.

context   object  optional  
registration   string   

A pipe-separated string containing registrationId, moduleId, packageId, and portalId. Example: 123|456|789|10

object   object   

The object of the statement containing details about the learning activity.

result   object  optional  

The result of the statement, such as scores and success.

timestamp   string  optional  

The timestamp of when the interaction happened. Example: 2024-05-01T10:00:00Z

SCORM Modules Tabular List

Returns all the SCORM modules in a tabular list format in paginated mode. You can apply filter using search_param via moduleTypes(module type), associatedCourse(modules used in course) and moduleName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/scorm?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22moduleTypes%22%3A+%5B%22scorm%22%5D%2CassociatedCourse%3A%22%22%2CmoduleName%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/scorm"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"moduleTypes": ["scorm"],associatedCourse:"",moduleName:""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "name": "test",
            "slug": "test",
            "type": "scorm",
            "icon": "<i class=\"el-icon-document\"></i>",
            "author": "Aom Staff",
            "created_at": "Aug 03, 2020 09:56 AM",
            "course_count": 1
        }
    ]
}
 

Request   

GET api/modules/scorm

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

for searching items based on field names. Example: {"moduleTypes": ["scorm"],associatedCourse:"",moduleName:""}

Create SCORM Module

This function creates a new SCORM module with the provided details. It validates the request, saves module details, and associates categories.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/modules/scorm" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"New Scorm Module\",
    \"trackCompletion\": \"true\",
    \"scormPackageId\": \"1\",
    \"launchNewWindow\": \"true\",
    \"categories\": \"[1, \\\"New Category\\\"]\",
    \"estimatedCompletion\": \"10\",
    \"estimationCompletedUnit\": \"minutes\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/scorm"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "New Scorm Module",
    "trackCompletion": "true",
    "scormPackageId": "1",
    "launchNewWindow": "true",
    "categories": "[1, \"New Category\"]",
    "estimatedCompletion": "10",
    "estimationCompletedUnit": "minutes"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "id": 1,
    "message": "Module saved successfully"
}
 

Request   

POST api/modules/scorm

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   required  optional  

The name of the SCORM module. Example: New Scorm Module

trackCompletion   required  optional  

Boolean indicating if the module should track completion. Example: true

scormPackageId   required  optional  

The ID of the SCORM package. Example: 1

launchNewWindow   required  optional  

Boolean indicating if the module should launch in a new window. Example: true

categories   array|nullable  optional  

Array of category IDs or names associated with the module. Example: [1, "New Category"]

estimatedCompletion   int|nullable  optional  

Estimated time to complete the module in minutes. Example: 10

estimationCompletedUnit   string|nullable  optional  

Unit of the estimated time to complete the module. Example: minutes

Update SCORM Module

This function updates an existing SCORM module with the provided details. It validates the request, saves module details, and associates categories.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/modules/scorm/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": \"1\",
    \"name\": \"Updated Scorm Module\",
    \"trackCompletion\": \"true\",
    \"launchNewWindow\": \"true\",
    \"scormPackageId\": \"1\",
    \"categories\": \"[1, \\\"New Category\\\"]\",
    \"estimatedCompletion\": \"10\",
    \"estimationCompletedUnit\": \"minutes\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/scorm/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": "1",
    "name": "Updated Scorm Module",
    "trackCompletion": "true",
    "launchNewWindow": "true",
    "scormPackageId": "1",
    "categories": "[1, \"New Category\"]",
    "estimatedCompletion": "10",
    "estimationCompletedUnit": "minutes"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Module updated successfully"
}
 

Request   

PUT api/modules/scorm/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   required  optional  

The ID of the SCORM module you want to update. Example: 1

name   required  optional  

The name of the SCORM module. Example: Updated Scorm Module

trackCompletion   required  optional  

Boolean indicating if the module should track completion. Example: true

launchNewWindow   required  optional  

Boolean indicating if the module should launch in a new window. Example: true

scormPackageId   required  optional  

The ID of the SCORM package. Example: 1

categories   array|nullable  optional  

Array of category IDs or names associated with the module. Example: [1, "New Category"]

estimatedCompletion   int|nullable  optional  

Estimated time to complete the module in minutes. Example: 10

estimationCompletedUnit   string|nullable  optional  

Unit of the estimated time to complete the module. Example: minutes

Get Scorm Module

Fetch the details of a specified scorm module. (See parameters) Scorm modules can be used in the course as course content/lesson.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/scorm/{id}?id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/scorm/{id}"
);

const params = {
    "id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "New Scorm",
    "slug": "new-scorm",
    "trackCompletion": true,
    "launchNewWindow": false,
    "scormPackageId": 1,
    "scormPackageFullUrl": "https://aomlms.com/scorm/sample-course/scormcontent/index.html",
    "scormProxyUrl": "https://aomlms.com/scorm-proxy",
    "estimatedCompletion": null,
    "estimationCompletedUnit": null,
    "categories": [
        1,
        2,
        3
    ],
    "courses": [
        {
            "course_id": 1,
            "course_name": "Testing"
        },
        {
            "course_id": 2,
            "course_name": "Testing 2"
        }
    ]
}
 

Request   

GET api/modules/scorm/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

ID of the scorm module you want to fetch the details of. Example: 1

Retrieve Detailed Scorm Module Info

Retrieves detailed information about a SCORM module including its name, slug, content, associated course details, SCORM URL, tracking and launching options, and more. It also handles the SCORM package versioning and generates authorization tokens for xAPI integration if applicable. The function checks and updates the module status, calculates time spent, and fetches SCORM keys for the module.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/scorm/details?registrationId=16&moduleId=11&portalId=5&openInNewWindow=true" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/scorm/details"
);

const params = {
    "registrationId": "16",
    "moduleId": "11",
    "portalId": "5",
    "openInNewWindow": "true",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{"name": "Module Name", "slug": "module-slug", "content": "Module content if available", "courseName": "Course Name", "courseSlug": "Course Launch URL", "packageId": 1, "scormUrl": "https://scorm.url", "scormProxyUrl": "https://scorm-proxy.url", "version": "SCORM Version", "trackCompletion": true, "launchNewWindow": false, "min_time_spent": 0, "otherModules": [], "launchCheck": {...}, "prevSlug": "previous-module-slug", "nextSlug": "next-module-slug", "scormKeys": {...}, "status": "In Progress", "statusRowId": 19, "timeSpent": 13, "course_newly_completed": false, "timeToBeSpent": 0}
 

Request   

GET api/module/scorm/details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

registrationId   string   

ID of the course registration for which this module is attached. Example: 16

moduleId   string   

ID of the SCORM module. Example: 11

portalId   string  optional  

optional ID of the portal for course launch URL. Example: 5

openInNewWindow   string  optional  

optional If true, the module is launched in a new window. Example: true

Get scorm module report details

Returns the scorm module report details for the given module status id.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/scorm-report" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/scorm-report"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "moduleName": "Sample Scorm",
    "moduleId": 1,
    "score": 100,
    "studentName": "Aom Staff",
    "interactions": [
        {
            "slide": "1",
            "question": "What is your name?",
            "questionType": "text",
            "studentResponse": "John Doe",
            "correctResponse": "",
            "result": "correct",
            "time": "2022-01-01 12:00:00 PM"
        },
        {
            "slide": "2",
            "question": "What is your email?",
            "questionType": "text",
            "studentResponse": "[email protected]",
            "correctResponse": "",
            "result": "correct",
            "time": "2022-01-01 12:00:00 PM"
        }
    ],
    "courseId": 1,
    "courseName": "Sample Course"
}
 

Request   

GET api/scorm-report

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

modulesStatusId   integer   

ID of the module status you want to fetch the report of. Example: 12

studentId   integer   

ID of the student you want to fetch the report for. Example: 9

Get TinCan (xAPI) report for a specific module attempt.

This endpoint retrieves the TinCan (xAPI) interaction report for a given learner's module status. It includes detailed interaction logs, score calculations, and context information for analysis.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/scorm-activity-report?modulesStatusId=42&studentId=2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/scorm-activity-report"
);

const params = {
    "modulesStatusId": "42",
    "studentId": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "score": 90,
    "studentName": "John Doe",
    "moduleName": "Workplace Safety 101",
    "interactions": [
        {
            "id": 123,
            "modulesStatusId": 42,
            "verb": "http://adlnet.gov/expapi/verbs/completed",
            "activity": "Completed",
            "objectType": "Activity",
            "objectName": "Introduction Slide",
            "statementRaw": null,
            "createdBy": 7,
            "createdAt": "April 16, 2025 02:45 PM",
            "message": "You completed 'Introduction Slide'"
        }
    ]
}
 

Request   

GET api/scorm-activity-report

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

modulesStatusId   integer   

The ID of the module status. Example: 42

studentId   integer   

The ID of the student. Example: 2

Generate SCORM report as PDF

This endpoint generates a PDF report of SCORM interactions and scores for a given module status ID. It includes question responses, time spent, score percentage, and interaction details. The PDF is returned as a downloadable file.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/scorm-report-pdf" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"modulesStatusId\": 42
}"
const url = new URL(
    "https://demo.aomlms.com/api/scorm-report-pdf"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "modulesStatusId": 42
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


file binary The downloadable PDF report for the specified SCORM module status.
 

Request   

GET api/scorm-report-pdf

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

modulesStatusId   integer   

The ID of the module status for which the SCORM report is to be generated. Example: 42

Get scorm module content details

Returns the scorm module content details.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/scorm/content-details" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/scorm/content-details"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "Sample Scorm",
    "slug": "sample-scorm",
    "content": "Sample Scorm Content",
    "scormUrl": "https://staging.aomlms.com/storage/scorm/sample-course/scormcontent/index.html",
    "scormProxyUrl": "https://aom-s3-proxy.herokuapp.com",
    "version": "1.2",
    "trackCompletion": true,
    "scormKeys": {
        "cmi.suspend_data": "",
        "cmi.core.lesson_location": "",
        "cmi.core.lesson_mode": "normal",
        "cmi.mode": "normal",
        "cmi.core.lesson_status": "incomplete",
        "cmi.success_status": "",
        "cmi.completion_status": "incomplete",
        "cmi.core.student_id": 2,
        "cmi.core.student_name": "Aom Staff",
        "cmi.location": ""
    },
    "timeSpent": "0h 0m"
}
 

Request   

GET api/module/scorm/content-details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

moduleId   integer   

ID of the module you want to fetch the details of. Example: 14

Salesforce Integration

It allows you to track learner activity and progress in the LMS, and trigger changes in Salesforce data accordingly.

Salesforce Event Lookup

Retrieves all the events for the salesforce actions. Helps showing options in dropdowns elements

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/integrations/salesforce/eventLookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/integrations/salesforce/eventLookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "events": [
        {
            "db_value": "new_account_created",
            "display_value": "New Account Created",
            "crud_op": "Create",
            "salesforce_crud": [
                {
                    "db_value": "salesforce_contact",
                    "display_value": "Salesforce Contacts"
                }
            ]
        },
        {
            "db_value": "account_updated",
            "display_value": "Account Updated",
            "crud_op": "Update",
            "salesforce_crud": [
                {
                    "db_value": "salesforce_contact",
                    "display_value": "Salesforce Contacts"
                }
            ]
        },
        {
            "db_value": "course_enrolled",
            "display_value": "Enrolled in a course",
            "crud_op": "Update",
            "salesforce_crud": [
                {
                    "db_value": "salesforce_custom_registration_object",
                    "display_value": "Salesforce Custom Course Registration Object"
                }
            ]
        },
        {
            "db_value": "course_completed",
            "display_value": "Course Completed",
            "crud_op": "Update",
            "salesforce_crud": [
                {
                    "db_value": "salesforce_custom_registration_object",
                    "display_value": "Salesforce Custom Course Registration Object"
                }
            ]
        },
        {
            "db_value": "course_started",
            "display_value": "Course Started",
            "crud_op": "Update",
            "salesforce_crud": [
                {
                    "db_value": "salesforce_custom_registration_object",
                    "display_value": "Salesforce Custom Course Registration Object"
                }
            ]
        },
        {
            "db_value": "course_progress",
            "display_value": "Course Progress Tracking",
            "crud_op": "Update",
            "salesforce_crud": [
                {
                    "db_value": "salesforce_custom_registration_object",
                    "display_value": "Salesforce Custom Course Registration Object"
                }
            ]
        }
    ]
}
 

Request   

GET api/integrations/salesforce/eventLookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Field Lookup

Retrieves all the fields for the given object type - contact or custom_course_object. Helps showing options in dropdowns elements

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/integrations/salesforce/fieldLookup?type=contact" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/integrations/salesforce/fieldLookup"
);

const params = {
    "type": "contact",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "lms_fields": [
        {
            "db_value": "email"
        },
        {
            "db_value": "last_name"
        },
        {
            "db_value": "first_name"
        },
        {
            "db_value": "last_login_ip"
        },
        {
            "db_value": "is_disabled"
        }
    ],
    "salesforce_fields": [
        {
            "db_value": "email"
        },
        {
            "db_value": "lastName"
        },
        {
            "db_value": "firstName"
        }
    ],
    "courses": [
        {
            "id": 1,
            "name": "Course 1"
        },
        {
            "id": 2,
            "name": "Course 2"
        }
    ]
}
 

Request   

GET api/integrations/salesforce/fieldLookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

type   string   

The object type - contact or custom_course_object. Example: contact

Tabular List

Retrieves all the salesforce integrations in a tabular list format in paginated mode. You can apply filter using search_param via events(salesforce integration events).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/salesforces?order_by=%7B%22colName%22%3A+%22name%22%2C+%22direction%22%3A+%22asc%22%7D&search_param=0&page_size=10&page_number=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/salesforces"
);

const params = {
    "order_by": "{"colName": "name", "direction": "asc"}",
    "search_param": "0",
    "page_size": "10",
    "page_number": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "event": "course_enrolled",
            "event_display_value": "Enrolled in a Course",
            "object": "salesforce_contact",
            "object_display_value": "Salesforce Contact",
            "action": "created",
            "author": "John Doe",
            "created_at": "2021-01-01 12:00:00"
        }
    ]
}
 

Request   

GET api/salesforces

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName": "name", "direction": "asc"}

search_param   integer  optional  

for searching items based on field names. Example: 0

page_size   string   

The number of the items you want for a page. Example: 10

page_number   string   

Current page number in pagination. Example: 1

Create Salesforce Action

To create a Salesforce Action, you need to use this request. Provide event, action and object and it will be created. (See parameters)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/salesforce/action/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"event\": \"course_enrolled\",
    \"action\": \"create.\",
    \"object\": \"salesforce_contact\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/salesforce/action/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "event": "course_enrolled",
    "action": "create.",
    "object": "salesforce_contact"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Action created Successfully"
}
 

Request   

POST api/salesforce/action/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

event   string   

Event for which you want to create action. Example: course_enrolled

action   string   

Action will be create of the event by default. Example: create.

object   string   

Select the object from the dropdown list from Salesforce contact. Example: salesforce_contact

Save Salesforce Mapping

Saves the mapping of salesforce mapping. Helps in saving salesforce mapping using its type. (See Parameters)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/salesforce/mapping/save" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"type\": \"salesforce_contact\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/salesforce/mapping/save"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "type": "salesforce_contact"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "is_success": true,
    "message": "Mapping saved Successfully"
}
 

Request   

POST api/salesforce/mapping/save

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

type   required  optional  

Type of the salesforce mapping you want to save the details of. Example: salesforce_contact

Retrieve Salesforce Mapping

Retrieves the details of the salesforce mapping. Helps in fetching salesforce mapping using its type. (See Parameters)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/salesforce/mappings" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"type\": \"salesforce_contact\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/salesforce/mappings"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "type": "salesforce_contact"
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "type": "salesforce_contact",
    "userFieldProperties": [],
    "courseFieldProperties": []
}
 

Example response (200):


{
    "type": "salesforce_course_and_registration_custom_object",
    "courseFieldProperties": [],
    "courseRegistrationFieldProperties": [],
    "sfCustomObjectNames": [],
    "isSyncCourseCompleted": true
}
 

Request   

GET api/salesforce/mappings

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

type   required  optional  

Type of the salesforce mapping you want to fetch the details of. Example: salesforce_contact

Update Salesforce Action

Updates a Salesforce action based on the provided ID.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/salesforce/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"event\": \"New Account Created\",
    \"action\": \"create\",
    \"object\": \"Salesforce Contact\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/salesforce/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "event": "New Account Created",
    "action": "create",
    "object": "Salesforce Contact"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Salesforce updated successfully"
}
 

Request   

PUT api/salesforce/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the Salesforce action to be updated. Example: 1

Body Parameters

event   required  optional  

The event of the Salesforce action. Example: New Account Created

action   required  optional  

The action of the Salesforce action. Example: create

object   required  optional  

The object of the Salesforce action. Example: Salesforce Contact

Delete Salesforce Action

To delete a Salesforce Action, you need to use this request. Provide id and it will be deleted. (See parameters)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/salesforce/action/delete/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/salesforce/action/delete/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Salesforce deleted successfully"
}
 

Request   

POST api/salesforce/action/delete/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the salesforce action. Example: 3

Retrieves Salesforce logs in a paginated format.

This function returns logs related to a specific Salesforce action identified by its ID. The logs are presented in a tabular format, allowing pagination and optional sorting.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/salesforce/logs/50?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/salesforce/logs/50"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 100,
    "recordsFiltered": 50,
    "records": [
        {
            "id": 1,
            "event": "New Account Created",
            "data": [],
            "status": "success",
            "display_status": "Success",
            "errorMessage": "",
            "created_at": "Aug 03, 2020 09:56 AM",
            "showData": false
        }
    ]
}
 

Request   

GET api/salesforce/logs/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the Salesforce action whose logs are to be retrieved. Example: 50

Query Parameters

page_size   string   

The number of items per page. Example: 50

page_number   string   

The current page number for pagination. Example: 1

order_by   string  optional  

Optional parameter for sorting items based on columns in JSON format. Example: {"colName":"created_at", "direction": "desc"}

Staffs

You can perform staff management tasks like creating, deleting and updating staffs.

Tabular List

Retrieves all the staffs in a tabular list format with pagination mode. You can apply filter using search_param via name or email.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/staffs/tabularlist?page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C%22direction%22%3A%22desc%22%7D&search_param=%7B%22nameOrEmail%22%3A%22John+Doe%22%2C%22membershipId%22%3A1%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/staffs/tabularlist"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at","direction":"desc"}",
    "search_param": "{"nameOrEmail":"John Doe","membershipId":1}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 4,
    "recordsFiltered": 4,
    "records": [
        {
            "id": 4,
            "first_name": "John",
            "last_name": "Doe",
            "email": "[email protected]",
            "avatar": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"40\" height=\"40\" viewBox=\"0 0 40 40\"><circle cx=\"20\" cy=\"20\" r=\"20\" stroke=\"background\" stroke-width=\"0\" fill=\"#03A9F4\"/><text x=\"20\" y=\"20\" font-size=\"14\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">JD</text></svg>",
            "user_type": "general",
            "display_user_type": "General",
            "created_at": "Aug 06, 2020 07:20 AM",
            "last_login": "2 days ago"
        }
    ]
}
 

Request   

GET api/staffs/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the users you want for a page. Example: 10

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at","direction":"desc"}

search_param   string  optional  

for searching items based on name, email. Example: {"nameOrEmail":"John Doe","membershipId":1}

Retrieves detailed report for all staffs.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/staff/report?page_size=10&page_number=1&registered_between=%7B%22first_name%22%3A%22John%22%2C%22last_name%22%3A%22Doe%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/staff/report"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "registered_between": "{"first_name":"John","last_name":"Doe"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "totalNotStarted": 1,
    "totalInProgress": 0,
    "totalCompleted": 0,
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "first_name": "John",
            "last_name": "Doe",
            "email": "[email protected]",
            "user_type": "General",
            "created_at": "Aug 09, 2020",
            "last_login": "Oct 09, 2020"
        }
    ]
}
 

Request   

GET api/staff/report

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

Number of the result row you want in each page. Example: 10

page_number   string   

Current Page number. Example: 1

registered_between   string  optional  

Returns search filtered data. Example: {"first_name":"John","last_name":"Doe"}

Creates a new staff member.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/staff/create?firstName=John&lastName=Doe&email=john.doe%40example.com&password=Nv10%3D80l%5E&staffPermissions=%5B1%2C2%2C3%5D&userType=staff" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/staff/create"
);

const params = {
    "firstName": "John",
    "lastName": "Doe",
    "email": "[email protected]",
    "password": "Nv10=80l^",
    "staffPermissions": "[1,2,3]",
    "userType": "staff",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Staff created successfully"
}
 

Request   

POST api/staff/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

firstName   string   

First name of the staff. Example: John

lastName   string   

Last name of the staff. Example: Doe

email   string   

Email of the staff. Example: [email protected]

password   string   

Password for the staff. Must be at least 8 characters long and should not have been compromised according to the haveibeenpwned.com API. Example: Nv10=80l^

staffPermissions   string   

if userType is set to staff. Array of permission IDs to assign to the staff. Example: [1,2,3]

userType   string   

Type of the user to create. Example: staff

Retrieve Staff By ID

This endpoint returns the staff details based on the ID specified.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/staff/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/staff/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "firstName": "John",
    "lastName": "Doe",
    "email": "[email protected]",
    "lastLoggedIn": "2 hours ago",
    "avatar": "<svg xmlns=\"http://www.w3.org/2000/svg\" width=\"100\" height=\"100\" viewBox=\"0 0 100 100\"><circle cx=\"50\" cy=\"50\" r=\"50\" stroke=\"background\" stroke-width=\"0\" fill=\"#03A9F4\" /><text x=\"50\" y=\"50\" font-size=\"40\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">JD</text></svg>",
    "disabled": false,
    "userType": "staff",
    "currentLoggedUserType": "owner",
    "membership": {
        "id": 1,
        "name": "Silver",
        "expiryDate": null
    },
    "customUserMetas": {
        "full_name": {
            "type": "text",
            "label": "Full Name",
            "submitted_value": "John Doe",
            "placeholder_value": ""
        },
        "user_type": {
            "type": "dropdown",
            "label": "User Type",
            "submitted_value": 1,
            "placeholder_value": "",
            "option_label": [
                "Staff",
                "Owner"
            ],
            "option_value": [
                1,
                2
            ]
        }
    },
    "internal_note": null
}
 

Request   

GET api/staff/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the staff. Example: 1

Update Staff/Owner details

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/staff/8" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": \"2\",
    \"firstName\": \"John\",
    \"lastName\": \"Doe\",
    \"email\": \"[email protected]\",
    \"disabled\": \"0\",
    \"internal_note\": \"This is a note.\",
    \"customUserMetas\": \"{\\\"meta_key1\\\":{\\\"type\\\":\\\"text\\\",\\\"submitted_value\\\":\\\"value1\\\"},\\\"meta_key2\\\":{\\\"type\\\":\\\"checkbox\\\",\\\"submitted_value\\\":[1,2,3]}}\",
    \"userType\": \"staff\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/staff/8"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": "2",
    "firstName": "John",
    "lastName": "Doe",
    "email": "[email protected]",
    "disabled": "0",
    "internal_note": "This is a note.",
    "customUserMetas": "{\"meta_key1\":{\"type\":\"text\",\"submitted_value\":\"value1\"},\"meta_key2\":{\"type\":\"checkbox\",\"submitted_value\":[1,2,3]}}",
    "userType": "staff"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Owner/Staff updated successfully"
}
 

Request   

PUT api/staff/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer  optional  

The ID of the staff. Exmaple: 2 Example: 8

Body Parameters

id   required  optional  

The ID of the staff to update. Example: 2

firstName   required  optional  

First name of the staff. Example: John

lastName   required  optional  

Last name of the staff. Example: Doe

email   required  optional  

Email of the staff. Example: [email protected]

disabled   required  optional  

boolean whether the staff is disabled or not. Example: 0

internal_note   optional  optional  

Internal note for the staff. Example: This is a note.

customUserMetas   optional  optional  

Custom user meta fields. Example: {"meta_key1":{"type":"text","submitted_value":"value1"},"meta_key2":{"type":"checkbox","submitted_value":[1,2,3]}}

userType   required  optional  

Type of the user to update. Example: staff

Get Staff Permissions

Returns all permissions for the staff

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/staff/permissions/16" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/staff/permissions/16"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "permissions": []
}
 

Request   

GET api/staff/permissions/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   integer  optional  

The ID of the staff. Exmaple: 2 Example: 16

Update Staff Permissions

Update the permissions of a staff member

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/staff/updatePermission/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"permissions\": [
        1,
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/staff/updatePermission/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "permissions": [
        1,
        2,
        3
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Permissions updated successfully"
}
 

Request   

PUT api/staff/updatePermission/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the staff. Example: 1

Body Parameters

permissions   string[]   

The permissions for the staff.

Subscription Products

A subscription product whose amount will be paid in subscriptions (in between intervals) by your learners. Helps in performing CRUD operations for and to subscription products.

Retrieve Subscription

To retrieve a subscription, you need to use this request. (See parameters)

Returns : success status and successfull message

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/subscription/{id}?id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/subscription/{id}"
);

const params = {
    "id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": "ACTIVE",
    "endDate": "2020-10-01 00:00:00",
    "nextPaymentDate": "2020-10-01 00:00:00",
    "userName": "John Doe (#1 - [email protected])",
    "paymentGatewayId": 1
}
 

Request   

GET api/subscription/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

Subscription ID of the subscription. Example: 1

Returns product title, price, and image url.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/subscription/product/related?id=laudantium" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/subscription/product/related"
);

const params = {
    "id": "laudantium",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "product_id": 1,
    "title": "Product 1",
    "subscription_price": "$10.00 / month",
    "product_image_url": "https://example.com/product-1.jpg"
}
 

Retrieves the related orders of a given subscription id.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/subscription/orders/tabularlist?subscription_id=recusandae&page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22orderStatus%22%3A+%5B%22IN-PROGRESS%22%2C+%22COMPLETED%22%5D%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/subscription/orders/tabularlist"
);

const params = {
    "subscription_id": "recusandae",
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"orderStatus": ["IN-PROGRESS", "COMPLETED"]}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "total": 100,
            "status": "IN-PROGRESS",
            "relationship": "Parent Order",
            "created_at": "Jan 01, 2021 12:00 AM"
        }
    ]
}
 

Request   

GET api/subscription/orders/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

subscription_id   string   

The subscription id whose related orders you want to retrieve. Example: recusandae

page_size   string   

The amount of records to return per page. Example: 50

page_number   string   

The page number of the records to return. Example: 1

order_by   string   

The order by parameters. Example: {"colName":"created_at", "direction": "desc"}

search_param   string   

The search parameters. Example: {"orderStatus": ["IN-PROGRESS", "COMPLETED"]}

Create Subscription

Creates a new subscription based on an order, selected subscription products, and optional coupon/payment token.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/subscription/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"orderId\": 1001,
    \"paymentToken\": \"sk_test_abc123\",
    \"productQuantity\": {
        \"12\": 1,
        \"15\": 2
    }
}"
const url = new URL(
    "https://demo.aomlms.com/api/subscription/create"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "orderId": 1001,
    "paymentToken": "sk_test_abc123",
    "productQuantity": {
        "12": 1,
        "15": 2
    }
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (201):


{
    "success": true,
    "message": "Subscription has been created"
}
 

Request   

POST api/subscription/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

orderId   integer   

The ID of the order containing the subscription products. Example: 1001

paymentToken   string  optional  

Optional token for payment processing. Example: sk_test_abc123

productQuantity   object   

A key-value pair of product IDs and their quantities.

Tabular List

Retrieves all the subscriptions in a tabular list format with pagination mode. You can apply filter using search_param via productTitle, subscriptionStatus(active, cancelled, expired, on-hold), nameOrEmail and subscriptionOrderMonth.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/subscriptions/tabularlist?page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C%22direction%22%3A%22desc%22%7D&search_param=%7B%22productTitle%22%3A+%22%22%2C+%22subscriptionStatus%22%3A+%5B%22ACTIVE%22%2C+%22CANCELLED%22%5D%2C+%22nameOrEmail%22%3A+%22john%40example.com%22%2C+%22subscriptionOrderMonth%22%3A+%222020-01%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/subscriptions/tabularlist"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at","direction":"desc"}",
    "search_param": "{"productTitle": "", "subscriptionStatus": ["ACTIVE", "CANCELLED"], "nameOrEmail": "[email protected]", "subscriptionOrderMonth": "2020-01"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 10,
    "recordsFiltered": 10,
    "records": [
        {
            "id": 1,
            "user_name": "John Doe",
            "user_id": 1,
            "product": "Product 1",
            "product_id": 1,
            "subscription_price": "$10.00 / month",
            "next_payment_date": "Jan 01, 2021 12:00 AM",
            "status": "ACTIVE",
            "created_at": "Jan 01, 2021 12:00 AM"
        }
    ]
}
 

Request   

GET api/subscriptions/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the subscriptions you want for a page. Example: 10

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at","direction":"desc"}

search_param   string  optional  

for searching items based on field names. Example: {"productTitle": "", "subscriptionStatus": ["ACTIVE", "CANCELLED"], "nameOrEmail": "[email protected]", "subscriptionOrderMonth": "2020-01"}

Subscription Status Lookup

Retrieves all the statuses for a subscription the platform offers like Active, Cancelled, Expired, On-Hold. Helps showing options in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/subscription/status/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/subscription/status/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "ACTIVE",
        "display_value": "Active"
    },
    {
        "db_value": "CANCELLED",
        "display_value": "Cancelled"
    },
    {
        "db_value": "EXPIRED",
        "display_value": "Expired"
    },
    {
        "db_value": "ON-HOLD",
        "display_value": "On-Hold"
    }
]
 

Request   

GET api/subscription/status/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update Subscription

To update a subscription, you need to use this request. (See parameters) Subscription can be only created by purchasing subscription product.

Returns : success status and successfull message

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/subscription/{id}?id=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"status\": \"ACTIVE\",
    \"endDate\": \"2020-10-01 00:00:00\",
    \"nextPaymentDate\": \"2020-10-01 00:00:00\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/subscription/{id}"
);

const params = {
    "id": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "status": "ACTIVE",
    "endDate": "2020-10-01 00:00:00",
    "nextPaymentDate": "2020-10-01 00:00:00"
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Subscription updated successfully"
}
 

Request   

PUT api/subscription/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string   

Subscription ID of the subscription. Example: 1

Body Parameters

status   required  optional  

Status of the subscription. Example: ACTIVE

endDate   nullable  optional  

End date of the subscription. Example: 2020-10-01 00:00:00

nextPaymentDate   required  optional  

Next payment date of the subscription. Example: 2020-10-01 00:00:00

Quick Edit Subscriptions

Updates the status of the specified subscriptions in bulk.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/subscription/quickEdit" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"subscription_ids\": [
        1,
        2
    ],
    \"status\": \"\\\"ACTIVE\\\"\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/subscription/quickEdit"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "subscription_ids": [
        1,
        2
    ],
    "status": "\"ACTIVE\""
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Subscriptions updated Successfully"
}
 

Request   

POST api/subscription/quickEdit

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

subscription_ids   string[]   

The IDs of the subscriptions to be updated.

status   string   

The new status to set for the subscriptions. Example: "ACTIVE"

Process Subscription Action

Perform a specific action on the subscription like process renewal.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/subscription/process-subscription-action" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 1,
    \"action\": \"PROCESS_RENEWAL\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/subscription/process-subscription-action"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": 1,
    "action": "PROCESS_RENEWAL"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "success": true,
    "message": "Process Renewal Successfully completed"
}
 

Request   

POST api/subscription/process-subscription-action

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   integer   

The ID of the subscription. Example: 1

action   string   

The action to perform on the subscription. Example: PROCESS_RENEWAL

Subscription Action Lookup

Retrieves all the actions that can be performed on a subscription like Process renewal. Helps showing options in form elements like dropdowns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/subscription/action/lookup" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/subscription/action/lookup"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


[
    {
        "db_value": "PROCESS_RENEWAL",
        "display_value": "Process renewal"
    },
    {
        "db_value": "CREATE_PENDING_RENEWAL_ORDER",
        "display_value": "Create pending renewal order"
    }
]
 

Request   

GET api/subscription/action/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Survey Modules

A survey module is a feedback module that you can add as course content to get learners feedback about your course(How they felt about course, ratings, etc). Helps in performing CRUD operation to and for survey modules.

Get paginated list of survey modules.

Returns a paginated, searchable, and sortable list of survey-type modules with metadata such as author, course mapping, and timestamps.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/survey?page_size=10&page_number=1&order_by[colName]=name&order_by[direction]=asc" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/survey"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by[colName]": "name",
    "order_by[direction]": "asc",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 52,
    "recordsFiltered": 7,
    "records": [
        {
            "id": 12,
            "name": "Employee Feedback Survey",
            "slug": "employee-feedback-survey",
            "type": "survey",
            "icon": "fa-poll",
            "author": "Jane Smith",
            "showMappedCourses": false,
            "created_at": "April 15, 2025 03:20 PM",
            "course_count": 3
        }
    ]
}
 

Request   

GET api/modules/survey

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   integer   

The number of records per page. Example: 10

page_number   integer   

The current page number. Example: 1

order_by   object  optional  

An object containing sorting preferences.

search_param   object  optional  

Optional search filters.

Creates a new survey module

Creates a new survey module using form fields provided in the request body.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/modules/survey" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Feedback\",
    \"content\": \"This is the short content here\",
    \"submitButtonText\": \"Submit Survey\",
    \"submitOption\": \"save_to_db\",
    \"fields\": [
        {
            \"type\": \"text\",
            \"label\": \"How you left\",
            \"defaultValue\": \"\",
            \"isRequired\": false,
            \"optionLabel\": []
        },
        {
            \"type\": \"rating\",
            \"label\": \"How you rate us\",
            \"defaultValue\": \"\",
            \"isRequired\": false,
            \"optionLabel\": []
        }
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/survey"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Feedback",
    "content": "This is the short content here",
    "submitButtonText": "Submit Survey",
    "submitOption": "save_to_db",
    "fields": [
        {
            "type": "text",
            "label": "How you left",
            "defaultValue": "",
            "isRequired": false,
            "optionLabel": []
        },
        {
            "type": "rating",
            "label": "How you rate us",
            "defaultValue": "",
            "isRequired": false,
            "optionLabel": []
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Module saved successfully"
}
 

Request   

POST api/modules/survey

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

Name of the text module. Example: Feedback

content   string  optional  

Content for the text modules that learners will see. Example: This is the short content here

submitButtonText   string   

Text for the submit button. Example: Submit Survey

submitOption   string   

Submission options for learners. Example: save_to_db

fields   string[]   

Form fields inside the Survey form(like radio, dropdown, rating, text, textarea, etc).

Update the specified survey module in storage.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/modules/survey/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": \"1\",
    \"name\": \"Feedback\",
    \"content\": \"A brief Description\",
    \"trackCompletion\": false,
    \"estimatedCompletion\": 60,
    \"estimationCompletedUnit\": \"minutes\",
    \"submitButtonText\": \"Submit Form\",
    \"submitOption\": \"send_email\",
    \"fields\": [
        \"quos\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/survey/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "id": "1",
    "name": "Feedback",
    "content": "A brief Description",
    "trackCompletion": false,
    "estimatedCompletion": 60,
    "estimationCompletedUnit": "minutes",
    "submitButtonText": "Submit Form",
    "submitOption": "send_email",
    "fields": [
        "quos"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Module updated successfully"
}
 

Request   

PUT api/modules/survey/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

id   required  optional  

The ID of the survey module. Example: 1

name   required  optional  

The name of the survey module. Example: Feedback

content   The  optional  

content of the survey module. Example: A brief Description

trackCompletion   boolean  optional  

Whether the module is being tracked(whether its finished or not) in course player. Example: false

estimatedCompletion   integer  optional  

The estimated time in minutes to complete the module. Example: 60

estimationCompletedUnit   string  optional  

The unit of estimated completion time. Example: minutes

submitButtonText   string  optional  

The text for the submit button. Example: Submit Form

submitOption   string  optional  

The option on how to submit the form. Example: send_email

fields   string[]  optional  

Array of form fields.

Retrieves the details of the specified survey module.

Retrieves the details of the specified survey module. Helps in fetching survey module using its ID. (See Parameters)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/survey/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/survey/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "Feedback",
    "slug": "feedback",
    "content": "A brief Description",
    "redirect": null,
    "trackCompletion": false,
    "submitButtonText": "Submit Survey",
    "submitOption": "save_to_db",
    "fields": [
        {
            "id": 1,
            "type": "text",
            "label": "How you left",
            "defaultValue": "",
            "isRequired": false,
            "optionLabel": []
        },
        {
            "id": 2,
            "type": "rating",
            "label": "How you rate us",
            "defaultValue": "",
            "isRequired": false,
            "optionLabel": []
        }
    ]
}
 

Request   

GET api/modules/survey/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The ID of the survey module. Example: 1

Get Survey Module Details

Retrieves the details of a survey module including its name, slug, content, course information, track completion status, launch checks, and form field data for a specific course registration and module.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/survey/details" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/survey/details"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{"name": "Survey Module", "slug": "survey-module", "content": "Detailed content here", "courseName": "Course 1", "courseSlug": "http://localhost:8000/courses/1/launch", "trackCompletion": true, "min_time_spent": 90, "otherModules": [], "launchCheck": {...}, "errors": [], "course_id": 1, "prevSlug": "previous-module", "nextSlug": "next-module", "status": "In Progress", "timeSpent": 0, "statusRowId": 1, "form_id": 3, "has_form_fields": true, "form_fields": [], "timeToBeSpent": 1}
 

Request   

GET api/module/survey/details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

registrationId   string   

The ID of the course registration. Example: 1

moduleId   string   

The ID of the survey module. Example: 2

portalId   integer  optional  

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Mark Complete Survey Module

Updates the status of the survey module to completed. Changes the completion percentage to 100% and marks completed the survey module.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/module/survey/markComplete?statusRowId=4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/survey/markComplete"
);

const params = {
    "statusRowId": "4",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Module Completed Successfully"
}
 

Request   

PUT api/module/survey/markComplete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

statusRowId   string   

ID of the ModuleStatus Row belongs to current survey module. Example: 4

Get Student Response

Returns all the survey module user response of the course in a tabular list format in paginated mode. You can apply filter using search_param via name and scormType(version).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/survey/student-details" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/survey/student-details"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "question": [
        "How you felt",
        "How you rate us"
    ],
    "answer": [
        "Awesome course it was",
        "5"
    ]
}
 

Request   

GET api/module/survey/student-details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

statusRowId   string   

ID of the ModuleStatus Row belongs to current text module. Example: totam

Survey User Response

Retrieves all the survey modules user response of the course in a tabular list format in paginated mode. You can apply filter using search_param via name and scormType(version).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/survey/course-details?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=%7B%22userName%22%3A%22%22%7D&course_id=4&portalId=1&type=export" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/survey/course-details"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"userName":""}",
    "course_id": "4",
    "portalId": "1",
    "type": "export",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "headers": [
        "student_id",
        "student_name",
        "student_email",
        "first_name",
        "last_name",
        "email",
        "submitted_on"
    ],
    "form_data": [
        {
            "student_id": 1,
            "student_name": "John Doe",
            "student_email": "[email protected]",
            "Question 1": "Answer 1",
            "Question 2": "Answer 2",
            "Submitted On": "10-Aug-2020"
        }
    ],
    "form_id": [
        1,
        2
    ],
    "course_name": "My Course Name"
}
 

Request   

GET api/module/survey/course-details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}}

search_param   string  optional  

For searching items based on field names. Example: {"userName":""}

course_id   string   

Course ID for which you want to get user response. Example: 4

portalId   string   

Portal ID for which you want to get user response. Example: 1

type   string   

Type of the response. Example: export

Retrieves the count of the maximum number of the form submissions in a single form in a specified course.

Used to estimiate the number of seperate requests are needed to fetch all responses in chunks. (See response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/survey/course-details-count?course_id=4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/survey/course-details-count"
);

const params = {
    "course_id": "4",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "max_form_data_count": 2
}
 

Request   

GET api/module/survey/course-details-count

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

course_id   string   

Course ID for which you want to get user response. Example: 4

Survey Report

Retrieves a paginated list of courses along with their associated survey modules. The result can be filtered by course name or ID, and restricted to specific portals. The function also supports ordering of the result set based on specified columns.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/survey/survey-count?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22name%22%2C+%22direction%22%3A+%22asc%22%7D&search_param=%7B%22courseName%22%3A%22Math%22%2C+%22courseId%22%3A1%7D&portalId=2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/survey/survey-count"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"name", "direction": "asc"}",
    "search_param": "{"courseName":"Math", "courseId":1}",
    "portalId": "2",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 100,
    "recordsFiltered": 50,
    "records": [
        {
            "id": 1,
            "name": "Course Name",
            "survey": [
                {
                    "id": 1,
                    "name": "Survey Name",
                    "formId": 123,
                    "count": 10
                }
            ],
            "count": 10
        }
    ]
}
 

Request   

GET api/module/survey/survey-count

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of items you want per page. Example: 50

page_number   string   

The current page number in pagination. Example: 1

order_by   string  optional  

JSON object for ordering items based on columns. Example: {"colName":"name", "direction": "asc"}

search_param   string  optional  

JSON object for searching courses by name or ID. Example: {"courseName":"Math", "courseId":1}

portalId   string  optional  

Optional portal ID to restrict results to a specific portal and its sub-portals. Example: 2

Get All Users’ Survey Responses by Course and Module

Retrieves paginated survey/form responses submitted by users for a specific module within a course. Supports search filtering, sub-portal filtering, and returns processed answers per question.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/survey/survey-check?page_size=10&page_number=1&course_id=42&module_id=108&portalId=3&search_param=%7B%22userName%22%3A%22John%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/survey/survey-check"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "course_id": "42",
    "module_id": "108",
    "portalId": "3",
    "search_param": "{"userName":"John"}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "form_data": [
        {
            "submissions": [
                {
                    "question": "How would you rate this course?",
                    "answer": "5"
                },
                {
                    "question": "Any comments?",
                    "answer": "Very helpful!"
                }
            ],
            "name": "John Doe",
            "email": "[email protected]"
        }
    ],
    "courseName": "Introduction to Programming",
    "moduleName": "Module 1: Basics",
    "form_data_count": 1,
    "recordsTotal": 10,
    "recordsFiltered": 1
}
 

Request   

GET api/survey/survey-check

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   integer   

The number of records per page. Example: 10

page_number   integer   

The current page number. Example: 1

course_id   integer   

The ID of the course. Example: 42

module_id   integer   

The ID of the module. Example: 108

portalId   integer  optional  

optional The ID of the portal to filter user responses by portal and sub-portals. Example: 3

search_param   string  optional  

optional JSON-encoded object to filter by user name or email. Example: {"userName":"John"}

Saves the survey form submission data

Saves the survey form submission data and returns the id of the saved form submission

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/module/survey/save-response" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"content\": \"A brief Description\",
    \"form_id\": 1,
    \"name\": \"Feedback\",
    \"form_fields\": [
        {
            \"type\": \"text\",
            \"label\": \"How you left\",
            \"submitted_value\": \"\",
            \"options_label\": [],
            \"options_value\": []
        },
        {
            \"type\": \"rating\",
            \"label\": \"How you rate us\",
            \"submitted_value\": 5,
            \"options_label\": [],
            \"options_value\": []
        }
    ],
    \"statusRowId\": \"7\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/module/survey/save-response"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "content": "A brief Description",
    "form_id": 1,
    "name": "Feedback",
    "form_fields": [
        {
            "type": "text",
            "label": "How you left",
            "submitted_value": "",
            "options_label": [],
            "options_value": []
        },
        {
            "type": "rating",
            "label": "How you rate us",
            "submitted_value": 5,
            "options_label": [],
            "options_value": []
        }
    ],
    "statusRowId": "7"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Form saved successfully"
}
 

Request   

POST api/module/survey/save-response

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

content   string   

Content of the text module. Example: A brief Description

form_id   integer   

Form ID for which you want to save the form submission. Example: 1

name   string   

Name of the form. Example: Feedback

form_fields   string[]   

Form fields inside the Survey form(like radio, dropdown, rating, text, textarea, etc).

statusRowId   required  optional  

ID of the Module status of the current survey module. Example: 7

Text Modules

A Text Module is a lesson module used as course content. Helps to perform CRUD operation to and for Text modules.

Text Modules Tabular List

Returns all the text modules in a tabular list format in paginated mode. You can apply filter using search_param via moduleTypes(module type), associatedCourse(modules used in course) and moduleName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/text?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=%7B%22moduleTypes%22%3A+%5B%22text%22%5D%2CassociatedCourse%22%3A%22%22%2C%22moduleName%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/text"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"moduleTypes": ["text"],associatedCourse":"","moduleName":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{"recordsTotal":1,"recordsFiltered":1,"records":[{"id":1,"name":"test","slug":"test","type":"text","icon":"<i class=\"el-icon-document\"><\/i>","author":"Aom Staff","created_at":"Aug 03, 2020 09:56 AM","course_count":1}]}}
 

Request   

GET api/modules/text

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}}

search_param   string  optional  

for searching items based on field names. Example: {"moduleTypes": ["text"],associatedCourse":"","moduleName":""}

Get Text Module

Retrieves the details of the specified text module. Helps in fetching text module using module ID. (See Parameters) Returns : id, name, slug, content, trackCompletion, estimatedCompletion, estimationCompletedUnit and categories of the text module created.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/text/6" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/text/6"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 6,
    "name": "Getting Started",
    "slug": "getting-started",
    "content": " ",
    "trackCompletion": false,
    "estimatedCompletion": null,
    "estimationCompletedUnit": null,
    "categories": [
        1,
        2,
        3
    ],
    "courses": [
        {
            "course_id": 1,
            "course_name": "Course Name"
        }
    ]
}
 

Request   

GET api/modules/text/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the text module. Example: 6

Create Text Module

Creates a new text module. (See parameters)

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/modules/text" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Getting Started\",
    \"content\": \"<p>This is the updated short content here<\\/p>\",
    \"trackCompletion\": true,
    \"estimatedCompletion\": \"00:30:00\",
    \"estimationCompletedUnit\": \"minutes\",
    \"categories\": [
        1,
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/text"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "Getting Started",
    "content": "<p>This is the updated short content here<\/p>",
    "trackCompletion": true,
    "estimatedCompletion": "00:30:00",
    "estimationCompletedUnit": "minutes",
    "categories": [
        1,
        2,
        3
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Module saved successfully"
}
 

Request   

POST api/modules/text

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   required  optional  

Name of the text module. Example: Getting Started

content   string   

Content for the text modules that students will see. Example: <p>This is the updated short content here</p>

trackCompletion   boolean   

If true, the module is being tracked(whether its finished or not) in course player. Example: true

estimatedCompletion   string  optional  

Estimated time to complete in course player. Example: 00:30:00

estimationCompletedUnit   string  optional  

Unit of estimated time to complete in course player. Example: minutes

categories   string[]  optional  

Categories to be added to the module.

Update Text Module

Updates the details of the specified text module. (See parameters) Text modules can be used in the course as course content/lesson.

Returns : Successfull message

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/modules/text/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"My-text-lesson\",
    \"content\": \"<p>This is the updated short content here<\\/p>\",
    \"trackCompletion\": true,
    \"estimatedCompletion\": \"00:30:00\",
    \"estimationCompletedUnit\": \"minutes\",
    \"categories\": [
        1,
        2,
        3
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/text/{id}"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "My-text-lesson",
    "content": "<p>This is the updated short content here<\/p>",
    "trackCompletion": true,
    "estimatedCompletion": "00:30:00",
    "estimationCompletedUnit": "minutes",
    "categories": [
        1,
        2,
        3
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Module updated successfully"
}
 

Request   

PUT api/modules/text/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   required  optional  

Name of the text module. Example: My-text-lesson

content   string   

Content for the text modules that students will see. Example: <p>This is the updated short content here</p>

trackCompletion   boolean   

If true, the module is being tracked(whether its finished or not) in course player. Example: true

estimatedCompletion   string  optional  

Estimated time to complete in course player. Example: 00:30:00

estimationCompletedUnit   string  optional  

Unit of estimated time to complete in course player. Example: minutes

categories   string[]  optional  

Categories to be added to the module.

Get Text Module Details

To get the details of a text module, you need to use this request. (See parameters)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/text/details" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/text/details"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{"name": "First Text", "slug": "first-text", "content": "A brief description", "courseName": "First Course", "courseSlug": "http://localhost:8000/courses/1/launch", "url": "http://localhost:8000/courses/1/modules/2/launch", "totalPoints": 20, "shouldBeEvaluated": true, "min_time_spent": 90, "otherModules": []], "launchCheck": {...}, "prevSlug": "first-video", "nextSlug": "second-video", "currentUserId": 1, "currentStudentAvatar": "http://localhost:8000/storage/avatars/1.png", "currentUserName": "John Doe", "status": "In Progress", "statusRowId": 1, "timeSpent": 0, "course_newly_completed": false, "timeToBeSpent": 1, "instructorResponse": null}
 

Request   

GET api/module/text/details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

registrationId   string   

ID of the course registration. Example: 1

moduleId   string   

ID of the text module. Example: 2

portalId   integer  optional  

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Mark Complete Text Module

Updates the status of the text module to completed. Changes the completion percentage to 100% and marks completed the text module.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/module/text/markComplete?statusRowId=4" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/text/markComplete"
);

const params = {
    "statusRowId": "4",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "is_success": true,
    "message": "Module Completed Successfully",
    "course_newly_completed": false
}
 

Request   

PUT api/module/text/markComplete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

statusRowId   string   

ID of the ModuleStatus Row belongs to current text module. Example: 4

Retrieve Detailed Text Module Info for Membership content

Retrieves details of text module in depth for the same membership the current text module is attached to. Returns related fields value. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/text/content-details?moduleId=9" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/text/content-details"
);

const params = {
    "moduleId": "9",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "Getting Started",
    "slug": "getting-started",
    "content": " ",
    "trackCompletion": true,
    "timeSpent": null
}
 

Request   

GET api/module/text/content-details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

moduleId   string   

ID of the text module. Example: 9

Videos

A Video Module is a lesson module used as course content. Helps to perform CRUD operation to and for Video modules.

Video Modules Tabular List

Returns all the video modules in a tabular list format in paginated mode. You can apply filter using search_param via associatedCourse(modules used in course) and moduleName.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/video?page_size=50&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D&search_param=%7B%22associatedCourse%22%3A%22%22%2C%22moduleName%22%3A%22%22%7D" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/video"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}",
    "search_param": "{"associatedCourse":"","moduleName":""}",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 1,
            "name": "test",
            "slug": "test",
            "type": "video",
            "icon": "<i class=\"el-icon-document\"></i>",
            "author": "Aom Staff",
            "created_at": "Aug 03, 2020 09:56 AM",
            "course_count": 1
        }
    ]
}
 

Request   

GET api/modules/video

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: 1

order_by   string  optional  

For ordering items based on columns provided in JSON format. Example: {"colName":"created_at", "direction": "desc"}

search_param   string  optional  

for searching items based on field names. Example: {"associatedCourse":"","moduleName":""}

Create Video Module

Creates a new video module with the provided details. (See parameters) Video modules can be used in the course as course content/lesson.

Returns : id of the video module created and success message

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/modules/video" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"My-video-lesson\",
    \"content\": \"Brief Description\",
    \"url\": \"https:\\/\\/player.vimeo.com\\/video\\/382947752\",
    \"provider\": \"vimeo\",
    \"coverUrl\": \"https:\\/\\/picsum.photos\\/200\\/300\",
    \"trackCompletion\": true,
    \"estimatedCompletion\": \"00:30:00\",
    \"estimationCompletedUnit\": \"minutes\",
    \"disableForwardSeek\": true,
    \"categories\": [
        1,
        2,
        3
    ],
    \"subtitleType\": \"upload\",
    \"interactions\": [
        {
            \"type\": \"quiz\",
            \"time\": \"00:05:00\"
        }
    ],
    \"subtitles\": [
        {
            \"language\": \"en\",
            \"subtitleContent\": \"Subtitle text\"
        }
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/video"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "name": "My-video-lesson",
    "content": "Brief Description",
    "url": "https:\/\/player.vimeo.com\/video\/382947752",
    "provider": "vimeo",
    "coverUrl": "https:\/\/picsum.photos\/200\/300",
    "trackCompletion": true,
    "estimatedCompletion": "00:30:00",
    "estimationCompletedUnit": "minutes",
    "disableForwardSeek": true,
    "categories": [
        1,
        2,
        3
    ],
    "subtitleType": "upload",
    "interactions": [
        {
            "type": "quiz",
            "time": "00:05:00"
        }
    ],
    "subtitles": [
        {
            "language": "en",
            "subtitleContent": "Subtitle text"
        }
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "message": "Module saved successfully"
}
 

Request   

POST api/modules/video

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

name   string   

Name of the video module. Example: My-video-lesson

content   string  optional  

Content for the video modules that students will see. Example: Brief Description

url   string   

Url path for the video module. Example: https://player.vimeo.com/video/382947752

provider   string   

Provider of the video. Options: vimeo, in-house, youtube. Example: vimeo

coverUrl   string  optional  

Cover url path for the video module. Example: https://picsum.photos/200/300

trackCompletion   boolean  optional  

Whether the module is tracked for completion in the course player. Example: true

estimatedCompletion   string  optional  

Estimated time to complete in course player. Example: 00:30:00

estimationCompletedUnit   string  optional  

Unit of estimated time to complete in course player. Example: minutes

disableForwardSeek   boolean  optional  

If true, students cannot skip forward in the video. Example: true

categories   string[]  optional  

Categories to associate with the module.

subtitleType   string  optional  

Type of subtitle in the video. Options: upload, nocaption. Example: upload

interactions   string[]  optional  

Interactions to add in the video.

subtitles   string[]  optional  

Subtitles to add if subtitleType is 'upload'.

Video Module Details

Returns a video module details given its Id. This API is used by the course player to fetch the video module details while playing the course.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/video/3" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/video/3"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "id": 1,
    "name": "test",
    "slug": "test",
    "content": "This is a test video module.",
    "provider": "vimeo",
    "url": "https://vimeo.com/123456789",
    "coverUrl": "https://picsum.photos/200/300",
    "disableForwardSeek": false,
    "trackCompletion": false,
    "estimatedCompletion": null,
    "estimationCompletedUnit": null,
    "subtitleType": "",
    "subtitleFilePath": [
        {
            "language": "en",
            "filePath": "/storage/vtt/en_1.vtt"
        }
    ],
    "categories": [
        1,
        2
    ],
    "courses": [
        {
            "course_id": 1,
            "course_name": "My Course"
        }
    ],
    "subtitleDetails": [
        {
            "subtitleContent": "This is a test subtitle.",
            "language": "en"
        }
    ]
}
 

Request   

GET api/modules/video/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The id of the video module. Example: 3

Update the specified video module in storage.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/modules/video/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/video/1"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Module updated successfully"
}
 

Request   

PUT api/modules/video/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

The id of the video module. Example: 1

Video Module Details

Returns a video module details given its Id. This API is used by the course player to fetch the video module details while playing the course.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/video/details" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/video/details"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "test",
    "slug": "test",
    "content": "This is a test video module.",
    "courseName": "My Course",
    "courseSlug": "my-course",
    "min_time_spent": 5,
    "otherModules": [
        {
            "module_id": 1,
            "module_name": "Module 1",
            "module_slug": "module-1",
            "display_order": 1
        },
        {
            "module_id": 2,
            "module_name": "Module 2",
            "module_slug": "module-2",
            "display_order": 2
        }
    ],
    "subtitleType": "",
    "subtitleFilePath": [
        {
            "language": "en",
            "filePath": "/storage/vtt/en_1.vtt"
        }
    ],
    "launchCheck": {
        "canbeLaunched": true,
        "errDesc": ""
    },
    "prevSlug": "module-1",
    "nextSlug": "module-2",
    "provider": "vimeo",
    "coverUrl": "https://picsum.photos/200/300",
    "url": "https://vimeo.com/123456789",
    "disableForwardSeek": false,
    "trackCompletion": false,
    "interactions": [],
    "courseStatus": "In Progress",
    "status": "In Progress",
    "statusRowId": 1,
    "timeSpent": 0,
    "lastWatchedTime": 0,
    "isReady": true,
    "course_newly_completed": false
}
 

Request   

GET api/module/video/details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

registrationId   string   

The id of the registration. Example: 1

moduleId   string   

The id of the video module. Example: 3

portalId   string   

The id of the portal. Example: 1

Mark Complete Video Module

Updates the status of the video module to completed. Changes the completion percentage to 100% and marks completed the video module.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/module/video/markComplete?statusRowId=4&videoDuration=90&portalId=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/video/markComplete"
);

const params = {
    "statusRowId": "4",
    "videoDuration": "90",
    "portalId": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "status": true,
    "message": "Module completed successfully",
    "course_newly_completed": false
}
 

Request   

PUT api/module/video/markComplete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

statusRowId   string   

ID of the ModuleStatus Row belongs to current video module. Example: 4

videoDuration   string   

The duration of the video in seconds. Example: 90

portalId   integer  optional  

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Retrieve Detailed Video Module Info for Membership content

This function retrieves details of a video module, including its name, slug, content, provider, cover URL, and URL. It checks if the video is ready to be viewed, updates the time spent and last watched time, and indicates whether the video is part of membership content. If the video is not ready, an error message is included in the response.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/video/content-details?moduleId=9" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/video/content-details"
);

const params = {
    "moduleId": "9",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "name": "Module Name",
    "slug": "module-slug",
    "content": "Content of the module",
    "provider": "in-house",
    "coverUrl": "https://example.com/cover.jpg",
    "url": "https://example.com/video.mp4",
    "disableForwardSeek": false,
    "trackCompletion": true,
    "timeSpent": 120,
    "lastWatchedTime": 30,
    "isPartOfMembershipContent": true,
    "isReady": true
}
 

Request   

GET api/module/video/content-details

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

moduleId   string   

ID of the video module. Example: 9

Webinar Management API

This controller handles all API interactions related to webinar management within the platform. It provides endpoints for creating, updating, deleting, and retrieving webinar details, as well as managing attendee registrations, webinar sessions, and related content.

Endpoints in this controller are focused on managing the lifecycle of webinars, from setup to attendee interactions and webinar reporting.

Delete a webinar module

Deletes a webinar module and it's associated schedules.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/webinar/deleteWebinar?webinarId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/webinar/deleteWebinar"
);

const params = {
    "webinarId": "1",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "POST",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Webinar deleted successfully"
}
 

Example response (200):


{}
 

Request   

POST api/webinar/deleteWebinar

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

webinarId   string   

ID of the webinar module. Example: 1

Create a new webinar module with recurrence.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/webinar/recurrence-webinar" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"attendanceThreshold\": 17,
    \"startDate\": \"rerum\",
    \"startTime\": \"veniam\",
    \"endTime\": \"numquam\",
    \"location\": 18,
    \"instructor\": 12,
    \"serviceProvider\": \"quibusdam\",
    \"enableCloudRecording\": false,
    \"allowDownload\": false,
    \"meetingUrl\": \"http:\\/\\/www.maggio.info\\/in-repellat-repellendus-vero-praesentium-commodi-dolor\",
    \"enableAutoAttendance\": false,
    \"enableRecurrence\": false,
    \"frequency\": \"error\",
    \"interval\": 6,
    \"end\": \"tenetur\",
    \"webinarDays\": 13
}"
const url = new URL(
    "https://demo.aomlms.com/api/webinar/recurrence-webinar"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "attendanceThreshold": 17,
    "startDate": "rerum",
    "startTime": "veniam",
    "endTime": "numquam",
    "location": 18,
    "instructor": 12,
    "serviceProvider": "quibusdam",
    "enableCloudRecording": false,
    "allowDownload": false,
    "meetingUrl": "http:\/\/www.maggio.info\/in-repellat-repellendus-vero-praesentium-commodi-dolor",
    "enableAutoAttendance": false,
    "enableRecurrence": false,
    "frequency": "error",
    "interval": 6,
    "end": "tenetur",
    "webinarDays": 13
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "recurrenceWebinar": [
        {
            "startDate": "2020-01-01",
            "endDate": "2020-01-01",
            "startTime": "10:00:00",
            "endTime": "11:00:00",
            "location": 1,
            "instructor": 1,
            "showEdit": false,
            "serviceProvider": "zoom",
            "enableCloudRecording": true,
            "allowDownload": true,
            "meetingUrl": "https://zoom.us/j/1234567890",
            "enableAutoAttendance": true,
            "attendanceThreshold": 80
        }
    ],
    "message": "Webinar created successfully",
    "status": "success"
}
 

Request   

POST api/webinar/recurrence-webinar

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

attendanceThreshold   integer   

The attendance threshold for the webinar. Must be between 0 and 100. Example: 17

startDate   string   

The start date of the webinar in the format 'Y-m-d'. Example: rerum

startTime   string   

The start time of the webinar in the format 'H:i:s'. Example: veniam

endTime   string   

The end time of the webinar in the format 'H:i:s'. Example: numquam

location   integer   

The location id of the webinar. Example: 18

instructor   integer   

The instructor id of the webinar. Example: 12

serviceProvider   string   

The service provider for the webinar. Example: quibusdam

enableCloudRecording   boolean   

Whether to enable cloud recording for the webinar. Example: false

allowDownload   boolean   

Whether to allow download of the webinar. Example: false

meetingUrl   string   

The meeting url for the webinar. Example: http://www.maggio.info/in-repellat-repellendus-vero-praesentium-commodi-dolor

enableAutoAttendance   boolean   

Whether to enable auto attendance for the webinar. Example: false

enableRecurrence   boolean   

Whether to enable recurrence for the webinar. Example: false

frequency   string   

The frequency of the recurrence. Example: error

interval   integer   

The interval of the recurrence. Example: 6

end   string   

The end date of the recurrence in the format 'Y-m-d'. Example: tenetur

webinarDays   integer   

The number of days for the recurrence. Example: 13

Validate the webinar request.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/webinar/validate-webinar" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"attendanceThreshold\": 8,
    \"startDate\": \"architecto\",
    \"startTime\": \"sequi\",
    \"endTime\": \"eveniet\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/webinar/validate-webinar"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "attendanceThreshold": 8,
    "startDate": "architecto",
    "startTime": "sequi",
    "endTime": "eveniet"
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Webinar updated successfully",
    "status": "success"
}
 

Request   

POST api/webinar/validate-webinar

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

attendanceThreshold   integer   

The attendance threshold for the webinar. Must be between 0 and 100. Example: 8

startDate   string   

The start date of the webinar in the format 'Y-m-d'. Example: architecto

startTime   string   

The start time of the webinar in the format 'H:i:s'. Example: sequi

endTime   string   

The end time of the webinar in the format 'H:i:s'. Example: eveniet

Update a webinar for the given course

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/webinar/update-webinar" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"course_id\": 4,
    \"id\": 20,
    \"webinarList\": [
        \"similique\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/webinar/update-webinar"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "course_id": 4,
    "id": 20,
    "webinarList": [
        "similique"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Webinar updated successfully",
    "status": "success"
}
 

Example response (422):


{
    "message": "The given data was invalid.",
    "errors": {
        "message": [
            "Start date and time cannot be in the past."
        ]
    }
}
 

Request   

POST api/webinar/update-webinar

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

course_id   integer   

The ID of the course Example: 4

id   integer   

The ID of the webinar Example: 20

webinarList   string[]   

The webinar list

startDate   string   

The start date of the webinar Example: animi

endDate   string   

The end date of the webinar Example: consequuntur

startTime   string   

The start time of the webinar Example: quo

endTime   string   

The end time of the webinar Example: ab

location   integer   

The location of the webinar Example: 18

instructor   integer   

The instructor of the webinar Example: 4

serviceProvider   string   

The service provider of the webinar Example: ullam

allowDownload   integer   

The allow download of the webinar Example: 15

enableCloudRecording   integer   

The enable cloud recording of the webinar Example: 11

enableAutoAttendance   integer   

The enable auto attendance of the webinar Example: 19

attendanceThreshold   integer   

The attendance threshold of the webinar Example: 6

meetingUrl   string   

The meeting url of the webinar Example: http://daniel.net/

providerProperties   string[]   

The provider properties of the webinar

Create a new webinar in the database.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/webinar/add-webinar" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"course_id\": 14,
    \"webinarList\": [
        \"error\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/webinar/add-webinar"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "course_id": 14,
    "webinarList": [
        "error"
    ]
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Webinar created successfully",
    "status": "success"
}
 

Request   

POST api/webinar/add-webinar

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

course_id   integer   

The id of the course for which the webinar is being created. Example: 14

webinarList   string[]   

The array of webinars to be created, each containing the following:

startDate   string   

The start date of the webinar in the format 'Y-m-d'. Example: ut

endDate   string   

The end date of the webinar in the format 'Y-m-d'. Example: corporis

startTime   string   

The start time of the webinar in the format 'H:i:s'. Example: quos

endTime   string   

The end time of the webinar in the format 'H:i:s'. Example: voluptatem

location   integer   

The id of the location of the webinar. Example: 10

instructor   integer   

The id of the instructor of the webinar. Example: 20

serviceProvider   string   

The service provider of the webinar. Example: blanditiis

allowDownload   boolean   

Whether the attendees can download the recording. Example: false

enableCloudRecording   boolean   

Whether the cloud recording is enabled. Example: false

enableAutoAttendance   boolean   

Whether the automated attendance is enabled. Example: true

attendanceThreshold   integer   

The attendance threshold for the webinar. Must be between 0 and 100. Example: 1

meetingUrl   string  optional  

optional The meeting url of the webinar. Example: http://frami.net/

Export attendance report for a given webinar

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/webinar/export-attendance" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"webinarId\": 7,
    \"pageSize\": 12,
    \"pageNumber\": 16,
    \"portalId\": 14
}"
const url = new URL(
    "https://demo.aomlms.com/api/webinar/export-attendance"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "webinarId": 7,
    "pageSize": 12,
    "pageNumber": 16,
    "portalId": 14
};

fetch(url, {
    method: "GET",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "courseName": "Course Name",
    "startDate": "2020-12-01 10:00:00",
    "endDate": "2020-12-01 11:00:00",
    "recordsTotal": 100,
    "totalAttended": 50,
    "totalNoShow": 20,
    "totalCancelled": 10,
    "totalPartiallyAttended": 20,
    "records": [
        {
            "firstName": "John",
            "lastName": "Doe",
            "email": "[email protected]",
            "status": "Attended",
            "attendanceRecordingType": "Manual",
            "notes": "Test notes",
            "recordedAt": "2020-12-01 10:00:00"
        }
    ]
}
 

Request   

GET api/webinar/export-attendance

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

webinarId   integer   

The ID of the webinar Example: 7

pageSize   integer   

The page size of the report Example: 12

pageNumber   integer   

The page number of the report Example: 16

portalId   integer   

The ID of the portal Example: 14

Webinars

A Webinar Module is used as course content. Helps to perform CRUD operation to and for Webinar modules.

Handle Zoom Webhook

Receives Zoom webhook events. When a meeting.ended event is received, it processes webinar attendance.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/zoom/webhook" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"event\": \"meeting.ended\",
    \"payload\": []
}"
const url = new URL(
    "https://demo.aomlms.com/api/zoom/webhook"
);

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

let body = {
    "event": "meeting.ended",
    "payload": []
};

fetch(url, {
    method: "POST",
    headers,
    body: JSON.stringify(body),
}).then(response => response.json());

Example response (200):


{
    "message": "Event received"
}
 

Example response (204):

Empty response
 

Request   

POST api/zoom/webhook

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

event   string   

The Zoom event type. Example: meeting.ended

payload   object   

The payload object from Zoom.

object   object  optional  
id   integer   

The Zoom meeting ID. Example: 1234567890

Get Launch Details

Retrieves the launch details for the webinar modules. Returned data includes webinar provider name(like vimeo, zoom, big blue button, etc), whether webinar is created successfully or not, etc This information helps while launching the webinar for learners.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/webinar/launch?moduleId=12&portalId=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/webinar/launch"
);

const params = {
    "moduleId": "12",
    "portalId": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "provider": "zoom",
    "webinarDetails": {
        "is_success": true,
        "message": "Meeting started successfully",
        "url": "https://zoom.us/j/11111111111"
    }
}
 

Request   

GET api/module/webinar/launch

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

moduleId   string   

ID of the webinar module. Example: 12

portalId   integer  optional  

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5

Mark Complete Webinar Module

Updates the status of the webinar module to completed. Changes the completion percentage to 100% and marks completed the webinar module.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/module/webinar/markComplete?statusRowId=4&portalId=5" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/module/webinar/markComplete"
);

const params = {
    "statusRowId": "4",
    "portalId": "5",
};
Object.keys(params)
    .forEach(key => url.searchParams.append(key, params[key]));

const headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

fetch(url, {
    method: "PUT",
    headers,
}).then(response => response.json());

Example response (200):


{
    "message": "Module completed successfully",
    "course_newly_completed": false
}
 

Request   

PUT api/module/webinar/markComplete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

statusRowId   string   

ID of the ModuleStatus Row belongs to current webinar module. Example: 4

portalId   integer  optional  

The portal ID to filter users by portal and sub-portals. Use -1 to skip portal filtering. Example: 5