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 onthe 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": [
        {
            "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/customRegistrationFields

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

GET api/user/portals

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/portals" \
    --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 headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 300
x-ratelimit-remaining: 294
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

GET api/user/portals

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

User Type

Retrieve all user types

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 courseCategoryIds(course category ID), courseName

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%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/users/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,
            "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"
        },
        {
            "id": 2,
            "first_name": "Client",
            "last_name": "Admin",
            "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=\"#673AB7\" /><text x=\"20\" y=\"20\" font-size=\"14\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">CA</text></svg>",
            "user_type": "owner",
            "display_user_type": "Owner",
            "created_at": "Aug 03, 2020 09:31 AM",
            "last_login": "Never"
        },
        {
            "id": 3,
            "first_name": "Demoss",
            "last_name": "Student",
            "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=\"#FF5722\" /><text x=\"20\" y=\"20\" font-size=\"14\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">DS</text></svg>",
            "user_type": "general",
            "display_user_type": "General",
            "created_at": "Aug 03, 2020 09:31 AM",
            "last_login": "5 days ago"
        },
        {
            "id": 1,
            "first_name": "Aom",
            "last_name": "Staff",
            "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=\"#00BCD4\" /><text x=\"20\" y=\"20\" font-size=\"14\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">AS</text></svg>",
            "user_type": "admin",
            "display_user_type": "Admin",
            "created_at": "Aug 03, 2020 09:31 AM",
            "last_login": "1 minute ago"
        }
    ]
}
 

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 user 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"}

User Type

Retrieve details of users of type Staff

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/getUsersByType?userType=10" \
    --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": "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: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "records": [
        {
            "id": 4,
            "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. Example: 10

User Lookup

Retrieves all the users. Helps in showing users in forms elements like dropdown.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/lookup" \
    --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 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": "Aom Staff",
        "email": "[email protected]"
    },
    {
        "id": 2,
        "full_name": "Client Admin",
        "email": "[email protected]"
    },
    {
        "id": 3,
        "full_name": "Demoss Student",
        "email": "[email protected]"
    },
    {
        "id": 4,
        "full_name": "John Doe",
        "email": "[email protected]"
    }
]
 

Request   

GET api/users/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Create User

To create user, you need to use this request.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/user/create" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"firstName\": \"John\",
    \"lastName\": \"Doe\",
    \"email\": \"[email protected]\",
    \"password\": \"somePassword\",
    \"password_confirmation\": \"somePassword\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/user/create"
);

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

let body = {
    "firstName": "John",
    "lastName": "Doe",
    "email": "[email protected]",
    "password": "somePassword",
    "password_confirmation": "somePassword"
};

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

Example response (200):


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

Request   

POST api/user/create

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  optional  

Last Name of the user. Example: Doe

email   string   

Email of the user. Example: [email protected]

password   string   

Password for the user. Example: somePassword

password_confirmation   string   

Password for the user. Example: somePassword

Bulk Upload

To create users in bulk, you need to use this request.

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\": [
        {
            \"email\": \"[email protected]\",
            \"first_name\": \"Fake FName\",
            \"last_name\": \"Fake LName\",
            \"password\": \"Qwerty@123\"
        },
        {
            \"email\": \"[email protected]\",
            \"first_name\": \"Fake FName 2\",
            \"last_name\": \"Fake LName 2\",
            \"password\": \"\"
        }
    ],
    \"selectedCourses\": [
        1,
        2
    ],
    \"membershipId\": 12,
    \"classIds\": [
        1,
        2
    ]
}"
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": [
        {
            "email": "[email protected]",
            "first_name": "Fake FName",
            "last_name": "Fake LName",
            "password": "Qwerty@123"
        },
        {
            "email": "[email protected]",
            "first_name": "Fake FName 2",
            "last_name": "Fake LName 2",
            "password": ""
        }
    ],
    "selectedCourses": [
        1,
        2
    ],
    "membershipId": 12,
    "classIds": [
        1,
        2
    ]
};

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

Example response (200):


{
    "message": "User(s) uploaded successfully"
}
 

Request   

POST api/user/bulkUpload

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

userList   string[]   

Users list that needs to be added.

selectedCourses   string[]  optional  

creates all users and add users in specified courses.

membershipId   integer  optional  

creates all users under specified membership. Example: 12

classIds   string[]  optional  

creates all users and add users in specified classes.

Retrieve Sample file for Bulk Upload

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"
    ],
    "records": [
        {
            "email": "[email protected]",
            "first_name": "Fake FName1",
            "last_name": "Fake LName1",
            "password": "Qwerty@123"
        },
        {
            "email": "[email protected]",
            "first_name": "Fake FName2",
            "last_name": "Fake LName2",
            "password": ""
        }
    ]
}
 

Request   

GET api/user/getBulkUploadSampleFile

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

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


{
    "firstName": "John",
    "lastName": "Doe",
    "email": "[email protected]",
    "lastLoggedIn": "Never",
    "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
}
 

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

Update User

Updates user details using parameters mentioned.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/user/11" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"id\": 9,
    \"firstName\": \"John\",
    \"lastName\": \"Doe\",
    \"email\": \"[email protected]\",
    \"lastLoggedIn\": \"Never\",
    \"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=\\\\\\\"#E91E63\\\\\\\" \\/><text x=\\\\\\\"50\\\\\\\" y=\\\\\\\"50\\\\\\\" font-size=\\\\\\\"40\\\\\\\" fill=\\\\\\\"#FFFFFF\\\\\\\" alignment-baseline=\\\\\\\"middle\\\\\\\" text-anchor=\\\\\\\"middle\\\\\\\" dominant-baseline=\\\\\\\"central\\\\\\\">AW<\\/text><\\/svg>\",
    \"disabled\": false,
    \"customUserMetas\": [
        \"sed\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/user/11"
);

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

let body = {
    "id": 9,
    "firstName": "John",
    "lastName": "Doe",
    "email": "[email protected]",
    "lastLoggedIn": "Never",
    "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=\\\"#E91E63\\\" \/><text x=\\\"50\\\" y=\\\"50\\\" font-size=\\\"40\\\" fill=\\\"#FFFFFF\\\" alignment-baseline=\\\"middle\\\" text-anchor=\\\"middle\\\" dominant-baseline=\\\"central\\\">AW<\/text><\/svg>",
    "disabled": false,
    "customUserMetas": [
        "sed"
    ]
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).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}

URL Parameters

id   string   

ID of the user. Example: 11

Body Parameters

id   integer   

ID of the user whom we want to update. Example 11 Example: 9

firstName   string   

First Name of the user. Example: John

lastName   string  optional  

Last Name of the user. Example: Doe

email   string   

Email of the user. Example: [email protected]

lastLoggedIn   string   

Datetime or Never. Example: Never

avatar   string    AW" data-component="body">

Avatar svg icon for the user. Example: <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=\"#E91E63\" /><text x=\"50\" y=\"50\" font-size=\"40\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">AW</text></svg>

disabled   boolean   

User needs to be disabled or not. Example: false

customUserMetas   string[]  optional  

of metas if there are any custom usermetas present on the platform else empty array

Update User's Membership

Updates user membership plan using parameters mentioned.

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

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

let body = {
    "membership": "{\"id\":4,\"name\":\"Gold Plan\",\"expired_at\": \"2021-10-01 23:00:00\"}"
};

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

Example response (200):


{
    "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   

ID of the user. Example: 11

Body Parameters

membership   json   

Membership plan for the user. Example: {"id":4,"name":"Gold Plan","expired_at": "2021-10-01 23:00:00"}

Update Password

Updates password for the user.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/user/updatePassword/11" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"password\": \"somePassword\",
    \"confirmPassword\": \"Doe\",
    \"userId\": 11
}"
const url = new URL(
    "https://demo.aomlms.com/api/user/updatePassword/11"
);

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

let body = {
    "password": "somePassword",
    "confirmPassword": "Doe",
    "userId": 11
};

fetch(url, {
    method: "PUT",
    headers,
    body: JSON.stringify(body),
}).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}

URL Parameters

id   string   

ID of the user. Example: 11

Body Parameters

password   string   

Password for the user. Example: somePassword

confirmPassword   string  optional  

Confirm Password for the user. Example: Doe

userId   integer   

ID of the user for whom we want to update the password. Example: 11

Enrolled Courses

Retrieves all the courses opted by specified user. You can apply filters using search_param via status(course status)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/enrolled-courses?user_id=4&page_size=10&page_number=1&order_by=registered_on&search_param=%7B%22status%22%3A%5B%22In+Progress%22%2C%22Not+Started%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/enrolled-courses"
);

const params = {
    "user_id": "4",
    "page_size": "10",
    "page_number": "1",
    "order_by": "registered_on",
    "search_param": "{"status":["In Progress","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: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 6,
            "courseId": 1,
            "featuredImageUrl": null,
            "courseSlug": "http://localhost:8000/course/course-1",
            "courseName": "course 1",
            "lastAccessed": "Never",
            "status": "Not Started",
            "display_status": "Not Started",
            "accessStatus": "Allowed",
            "percentComplete": 0,
            "registered_on": "Aug 09, 2020",
            "started_on": "",
            "completed_on": "",
            "expire_on": "Never",
            "isExpired": false
        }
    ]
}
 

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. Example: 4

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":["In Progress","Not Started"]}

Delete User

To delete a user, you need to use this request.

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

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

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

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

Example response (200):


{
    "message": "2 student(s) not deleted as they has enrollments. Please remove the student(s) from the course and try again."
}
 

Request   

POST api/user/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string[]   

All user IDs which needs to be deleted.

Quick Edit

Updates the details in bulk for a specified user. Parameters is provided which needs to be updated.

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\": [
        4,
        2
    ],
    \"disabled\": false,
    \"course_ids\": [
        1,
        2
    ]
}"
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": [
        4,
        2
    ],
    "disabled": false,
    "course_ids": [
        1,
        2
    ]
};

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[]   

All user IDs which needs to be updated.

disabled   string[]   

Whether user will be disabled or not. Example: false

course_ids   string[]  optional  

User will be enrolled into the course specified.

Add Address

To add address for a user, you need to use this request using mentioned parameters.

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

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

let body = {
    "fullName": "John Doe",
    "addressLine1": "Boring Street",
    "addressLine2": "Awesome Colony",
    "zipcode": "123456",
    "city": "Mumbai",
    "state": "NY",
    "country": "US",
    "isDefault": false,
    "userId": 4
};

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

Example response (200):


{
    "message": "Address added successfully"
}
 

Request   

POST api/user/{id}/addAddress

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

userId   string   

User ID for which we want to add address. Example: 4

Body Parameters

fullName   string   

Full Name of the user. Example: John Doe

addressLine1   string   

Address line1 of the user. Example: Boring Street

addressLine2   string  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  

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

userId   integer   

ID of the user for whom we want to the address. Example: 4

Retrieve Addresses

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

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

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. Example: 4

Retrieve Dashboard Stats

Retrieves Dashboard details for specified user. Returned information contains in-progress, notStarted and completed items details as well as time spent details.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/dashboard/statistics?user_id=4&page_size=10&page_number=1&order_by=registered_on&search_param=%7B%22status%22%3A%5B%22In+Progress%22%2C%22Not+Started%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/user/dashboard/statistics"
);

const params = {
    "user_id": "4",
    "page_size": "10",
    "page_number": "1",
    "order_by": "registered_on",
    "search_param": "{"status":["In Progress","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: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "notStarted": 1,
    "inProgress": 0,
    "completed": 0,
    "total": 1,
    "studentName": "John Doe",
    "timeSpent": {
        "hours": 0,
        "minutes": 0,
        "seconds": 0,
        "totalSeconds": 0
    }
}
 

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

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":["In Progress","Not Started"]}

Retrieve User Activities

Returns all activities performed by a specified user. You can apply filter using search_param via courseCategoryIds(course category ID), courseName or status(course status)

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%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=admin" \
    --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",
};
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": "<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>",
    "name": "John Doe",
    "email": "[email protected]",
    "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   string   

ID of the user. Example: 4

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: {"colName":"created_at", "direction": "desc"}}

search_param   string  optional  

Search parameters related to course. Example: {"courseCategoryIds":[],"courseName":"course-1","status":"In Progress"}

context   string   

Context for the details. Example: admin

Retrieve User Orders

Retrieve order details, purchased by a specified user. Returned data is in pagination form.

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%7D" \
    --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"}}",
};
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": "<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>",
    "recordsTotal": 0,
    "recordsFiltered": 0,
    "currencySymbol": "&#36;",
    "records": []
}
 

Request   

GET api/user-orders

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

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   

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

Retrieve Certificates

Retrieve all certificates earned by the user for every course they pursued/completed.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user-certificates/4?page_size=10&page_number=1&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=%7B%22courseCategoryIds%22%3A%5B%5D%2C%22courseName%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/user-certificates/4"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"courseCategoryIds":[],"courseName":""}",
};
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,
            "courseId": 1,
            "userId": 3,
            "templateId": 1,
            "courseName": "course 1",
            "coursefeaturedImage": null,
            "issueDate": "Aug 03, 2020 10:02 AM"
        }
    ]
}
 

Request   

GET api/user-certificates/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the user. Example: 4

Query Parameters

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: {"colName":"created_at", "direction": "desc"}}

search_param   string  optional  

Apply search parameter. Example: {"courseCategoryIds":[],"courseName":""}

Remove Certificate

To removes the certificate for a specified user, you need to use this request.

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 certificate belongs to user. Example: 1

Update Certificate Issue Date

Updates the Issue date of Certificate for a user.

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

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

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

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

Example response (200):


{
    "message": "Issue Date Updated Successfully"
}
 

Request   

PUT api/update-certificate-issue-date

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

rowId   integer   

ID of the user certificate. Example: 1

newIssueDate   datetime   

New datetime for the certificate. Example: 2020-08-04 00:00:00

Retrieve Default Address

Retrieves the default address for the specified user.

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

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,
        "addresstype": null,
        "isDefault": true,
        "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: 4

Retrieve User Address

Retrieves the address for the specified user 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 user address row from UsersAddress Model. Example: 1

Update Address

Updates the address for a specified user using UserAddress ID. (See Parameters)

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\",
    \"addressLine1\": \"Boring Street\",
    \"addressLine2\": \"Awesome Colony\",
    \"zipcode\": \"123456\",
    \"city\": \"Mumbai\",
    \"state\": \"NY\",
    \"country\": \"US\",
    \"isDefault\": false,
    \"userId\": 4
}"
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",
    "addressLine1": "Boring Street",
    "addressLine2": "Awesome Colony",
    "zipcode": "123456",
    "city": "Mumbai",
    "state": "NY",
    "country": "US",
    "isDefault": false,
    "userId": 4
};

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   

User Address row id for UsersAddress model. Example: 1

Body Parameters

fullName   string   

Full Name of the user. Example: John Doe

addressLine1   string   

Address line1 of the user. Example: Boring Street

addressLine2   string  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  

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

userId   integer   

ID of the user for whom we want to update the address. Example: 4

Retrieve User Report

Retrieves detailed report for a specified user. You can apply filter using search_params via course(course ID) and status(course status). (See parameters)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/reports/user-detailed?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%7D&search_param=%7B%22course%22%3A%221%22%2C%22status%22%3A%5B%22In+Progress%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/user/reports/user-detailed"
);

const params = {
    "user_id": "4",
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"course":"1","status":["In Progress"]}",
};
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": [
        {
            "courseName": "course 1",
            "status": "Not Started",
            "percent_complete": 0,
            "access_status": "Allowed",
            "registered_on": "Aug 09, 2020",
            "started_on": "",
            "completed_on": "",
            "expire_on": "Never",
            "last_accessed_on": "Never",
            "total_time_spent": "0h 0m",
            "certifcate_issued": "No"
        }
    ]
}
 

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

page_size   string   

Number of the result row 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: {"colName":"created_at", "direction": "desc"}}

search_param   string  optional  

Returns search filtered data. Example: {"course":"1","status":["In Progress"]}

Retrieve User Report With Custom User Data

Retrieves detailed report for all user.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/report?page_size=10&page_number=1&registered_between=%7B%22first_name%22%3A%22Aom%22%2C%22last_name%22Staff%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/report"
);

const params = {
    "page_size": "10",
    "page_number": "1",
    "registered_between": "{"first_name":"Aom","last_name"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: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "totalNotStarted": 1,
    "totalInProgress": 0,
    "totalCompleted": 0,
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "first_name": "Aom",
            "last_name": "Staff",
            "email": "[email protected]",
            "user_type": "General",
            "created_at": "Aug 09, 2020",
            "last_login": "Oct 09, 2020"
        }
    ]
}
 

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  optional  

Returns search filtered data. Example: {"first_name":"Aom","last_name"Staff"}

Retrieve User Subscription Tabular List

Returns all the user subscriptions created in a tabular list format. You can apply filter using search_param.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user-subscriptions" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"user_id\": 4,
    \"page_size\": \"10\",
    \"page_number\": \"1\",
    \"order_by\": \"{\\\"colName\\\":\\\"created_at\\\",\\\"direction\\\":\\\"desc\\\"}\",
    \"search_param\": \"Active\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/user-subscriptions"
);

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

let body = {
    "user_id": 4,
    "page_size": "10",
    "page_number": "1",
    "order_by": "{\"colName\":\"created_at\",\"direction\":\"desc\"}",
    "search_param": "Active"
};

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

Example response (200):


{
    "avatar": 4,
    "recordsTotal": 1,
    "currencySymbol": "$",
    "recordsFiltered": 1,
    "name": "Aom Staff",
    "email": "[email protected]",
    "records": [
        {
            "id": 3,
            "item": "Professional Training and Education",
            "status": "Active",
            "total": "100",
            "created_at": "Aug 10, 2020 12:43 PM"
        }
    ]
}
 

Request   

GET api/user-subscriptions

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

user_id   integer   

ID of the user. Example: 4

page_size   required  optional  

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

page_number   required  optional  

Current page number in pagination. Example: 1

order_by   For  optional  

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

search_param   for  optional  

Searching items based on status. Example: Active

Retrieve List of User Source

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user-source" \
    --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 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": "Excel",
            "identifier": "excel",
            "description": "Bulk upload user from excel.",
            "logoUrl": "https://demo.aomlms.com/images/excel.svg"
        },
        {
            "id": 2,
            "name": "Hubspot",
            "identifier": "hubspot",
            "description": "Bulk import user from hubspot.",
            "logoUrl": "https://demo.aomlms.com/images/hubspot.svg"
        }
    ]
}
 

Request   

GET api/user-source

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

POST api/user/portal-create

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

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

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

Request   

POST api/user/portal-create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Enrolled Learning Paths

Retrieves all the learning path opted by specified user.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/enrolled-learningpaths" \
    --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 headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 300
x-ratelimit-remaining: 275
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

GET api/users/enrolled-learningpaths

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Get Membership Content

Retrieves all the Membership contents in a tabular list format with pagination mode. You can apply filter using search_param via content-type (course or modules), content name or Description

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%5B%27course%27%5D%2C%22nameOrDescription%22%3A%22course+1+description%22%7D" \
    --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":['course'],"nameOrDescription":"course 1 description"}",
};
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"
        },
        {
            "id": 2,
            "first_name": "Client",
            "last_name": "Admin",
            "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=\"#673AB7\" /><text x=\"20\" y=\"20\" font-size=\"14\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">CA</text></svg>",
            "user_type": "owner",
            "display_user_type": "Owner",
            "created_at": "Aug 03, 2020 09:31 AM",
            "last_login": "Never"
        },
        {
            "id": 3,
            "first_name": "Demoss",
            "last_name": "Student",
            "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=\"#FF5722\" /><text x=\"20\" y=\"20\" font-size=\"14\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">DS</text></svg>",
            "user_type": "general",
            "display_user_type": "General",
            "created_at": "Aug 03, 2020 09:31 AM",
            "last_login": "5 days ago"
        },
        {
            "id": 1,
            "first_name": "Aom",
            "last_name": "Staff",
            "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=\"#00BCD4\" /><text x=\"20\" y=\"20\" font-size=\"14\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">AS</text></svg>",
            "user_type": "admin",
            "display_user_type": "Admin",
            "created_at": "Aug 03, 2020 09:31 AM",
            "last_login": "1 minute ago"
        }
    ]
}
 

Request   

GET api/membership/user-contents

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the user 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: {"type":['course'],"nameOrDescription":"course 1 description"}

Custom User Field Types Lookup

Retrieves all the type of the custom user fields that platform supports. Helps while showing fields types in form elements like dropdown while creating Custom User Fields. Returns a list of all custom user field types. (See Response)

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"
    },
    {
        "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

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 Custom User Fields. (See parameters) Custom User Fields can be used to collect additional details from the user from registration page and user profile page.

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\": [
        {
            \"type\": \"text\",
            \"label\": \"How you left\",
            \"defaultValue\": \"\",
            \"isRequired\": false,
            \"optionLabel\": [],
            \"isFieldOnRegistrationPage\": true,
            \"isFieldOnCertificate\": true,
            \"includeInReportExports\": []
        },
        {
            \"type\": \"date\",
            \"label\": \"What is your Date of Birth\",
            \"defaultValue\": \"\",
            \"isRequired\": false,
            \"optionLabel\": [],
            \"isFieldOnRegistrationPage\": false,
            \"isFieldOnCertificate\": true,
            \"includeInReportExports\": []
        }
    ]
}"
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": [
        {
            "type": "text",
            "label": "How you left",
            "defaultValue": "",
            "isRequired": false,
            "optionLabel": [],
            "isFieldOnRegistrationPage": true,
            "isFieldOnCertificate": true,
            "includeInReportExports": []
        },
        {
            "type": "date",
            "label": "What is your Date of Birth",
            "defaultValue": "",
            "isRequired": false,
            "optionLabel": [],
            "isFieldOnRegistrationPage": false,
            "isFieldOnCertificate": true,
            "includeInReportExports": []
        }
    ]
};

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[]   

Form fields (like radio, dropdown, text, textarea, date etc).

Custom User Field Reports Lookup

Retrieves all the Reports that can include the Custom User Field as an additional column in its export. Helps while showing report name in form field like dropdown while creating Custom User Fields. Returns a list of reports that supports Custom User Fields. (See Response)

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}

Check if the given Custom User Field is eligible for deletion

To delete a custom field, you need to use this request.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/can-delete-field" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"fieldToDelete\": \"{\\\"id\\\":2,\\\"type\\\":\\\"text\\\",\\\"displayType\\\":\\\"Text\\\",\\\"label\\\":\\\"Source\\\",\\\"defaultValue\\\":\\\"Enter Source\\\",\\\"isRequired\\\":false,\\\"userMetaKey\\\":\\\"source\\\",\\\"optionLabel\\\":[],\\\"isFieldOnRegistrationPage\\\":false,\\\"isFieldOnCertificate\\\":false,\\\"includeInReportExports\\\":[],\\\"display_order\\\":0,\\\"error\\\":false}\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/users/can-delete-field"
);

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

let body = {
    "fieldToDelete": "{\"id\":2,\"type\":\"text\",\"displayType\":\"Text\",\"label\":\"Source\",\"defaultValue\":\"Enter Source\",\"isRequired\":false,\"userMetaKey\":\"source\",\"optionLabel\":[],\"isFieldOnRegistrationPage\":false,\"isFieldOnCertificate\":false,\"includeInReportExports\":[],\"display_order\":0,\"error\":false}"
};

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

Example response (200):


{
    "canDeleteField": true,
    "message": "",
    "certificateTemplates": ""
}
 

Request   

GET api/users/can-delete-field

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

fieldToDelete   required  optional  

Fields required. Example: {"id":2,"type":"text","displayType":"Text","label":"Source","defaultValue":"Enter Source","isRequired":false,"userMetaKey":"source","optionLabel":[],"isFieldOnRegistrationPage":false,"isFieldOnCertificate":false,"includeInReportExports":[],"display_order":0,"error":false}

Update class status of the student

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/update-class-status?id=3&status=Attended&classId=1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/users/update-class-status"
);

const params = {
    "id": "3",
    "status": "Attended",
    "classId": "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):


{
    "message": "Status Updated Successfully"
}
 

Request   

GET api/users/update-class-status

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

id   string  optional  

enrollment ID of the student. Example: 3

status   string  optional  

The status of the class. It can be Registered, Attended, No Show, Cancelled. Example: Attended

classId   string  optional  

ID of the class. Example: 1

Retrieve enrolled class details

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/users/enrolled-classes?user_id=3&page_size=50&page_number=1&search_param=%7B%22course_id%22%3A%22%22%7D&order_by=%7B%22colName%22%3A%22registered_on%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/users/enrolled-classes"
);

const params = {
    "user_id": "3",
    "page_size": "50",
    "page_number": "1",
    "search_param": "{"course_id":""}",
    "order_by": "{"colName":"registered_on","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": 6,
            "webinarId": null,
            "classId": 57,
            "title": "test ilt",
            "courseId": 34,
            "studyMethod": "instructor_led",
            "featuredImageUrl": null,
            "launchUrl": "https://staging.aomlms.com/class/test-ilt/launch/webinar/NTc=",
            "classStudyMaterial": "https://staging.aomlms.com/class/test-ilt/study-material/launch/NTc=",
            "status": "Registered",
            "display_status": "Registered",
            "registered_on": "Jan 04, 2024",
            "last_accessed_on": "Never",
            "startDate": "11-Jan-2024",
            "startTime": "21:00 PM",
            "endDate": "31-Jan-2024",
            "endTime": "04:00 AM",
            "location": "Cherry Hill",
            "start": "2024-01-11 21:00:00",
            "end": "2024-01-31 04:00:00",
            "instructor": "t t",
            "class": "orange",
            "add_calendar_link": "https://calendar.google.com/calendar/r/eventedit?text=test+ilt&dates=20240111T210000Z%2F20240131T040000Z&details=test+ilt.+For+details%2C+link+here+%3A+https%3A%2F%2Fstaging.aomlms.com"
        }
    ]
}
 

Request   

GET api/users/enrolled-classes

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

user_id   string  optional  

The ID of the user. Example: 3

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

search_param   string  optional  

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

order_by   string  optional  

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

Retrieve enrolled class details

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user/class/reports?user_id=3&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%22course%22%3A%22%22%2C%22status%22%3A%5B%5D%2C%22started_on%22%3A%5B%5D%2C%22completed_on%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/class/reports"
);

const params = {
    "user_id": "3",
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"registered_on","direction":"desc"}",
    "search_param": "{"course":"","status":[],"started_on":[],"completed_on":[]}",
};
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):


{
    "totalAttended": 0,
    "totalNoshow": 0,
    "totalCancelled": 0,
    "totalRegistered": 1,
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "courseName": "test ilt",
            "start_time": "11-Jan-2024 21:00 PM",
            "end_time": "31-Jan-2024 04:00 AM",
            "location": "Cherry Hill",
            "status": "Registered",
            "display_status": "Registered",
            "registered_on": "Jan 04, 2024",
            "last_accessed_on": "Never",
            "certificate_issued": "No"
        }
    ]
}
 

Request   

GET api/user/class/reports

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

user_id   string  optional  

The ID of the user. Example: 3

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":"registered_on","direction":"desc"}

search_param   string  optional  

For searching items based on field names. Example: {"course":"","status":[],"started_on":[],"completed_on":[]}

Retrieve user badges

This endpoint returns the badges gained based on the user ID specified.

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": "1",
        "badgeIconUrl": "/images/badges/Badge_1.png",
        "points": 1,
        "organizationId": "97852067",
        "count": 2
    }
]
 

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

Retrieve leaderboard details

This endpoint returns the leaderboard detials based on the user ID specified.

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": 24,
            "rank": 1,
            "firstName": "John",
            "lastName": "Doe",
            "points": "6",
            "badgeCount": 2
        },
        {
            "id": 1,
            "rank": 2,
            "firstName": "Aom",
            "lastName": "Staff",
            "points": 0,
            "badgeCount": 0
        }
    ],
    "userTier": "Level 1",
    "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

Retrieve 2fa

Retrieves two factor authentication details for a specified user. Returned data includes QR code and String code.

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


{
    "as_qr_code": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"200\" height=\"200\" viewBox=\"0 0 200 200\"><rect x=\"0\" y=\"0\" width=\"200\" height=\"200\" fill=\"#fefefe\"/><g transform=\"scale(4.444)\"><g transform=\"translate(0,0)\"><path fill-rule=\"evenodd\" d=\"M10 0L10 1L8 1L8 2L9 2L9 3L8 3L8 4L10 4L10 5L8 5L8 7L9 7L9 6L10 6L10 8L6 8L6 9L8 9L8 10L5 10L5 8L0 8L0 9L4 9L4 11L7 11L7 12L5 12L5 13L7 13L7 12L8 12L8 11L9 11L9 14L10 14L10 11L9 11L9 10L10 10L10 8L11 8L11 9L12 9L12 8L11 8L11 6L12 6L12 7L13 7L13 8L14 8L14 7L15 7L15 6L14 6L14 7L13 7L13 6L12 6L12 5L13 5L13 4L12 4L12 2L13 2L13 3L14 3L14 2L16 2L16 3L15 3L15 4L14 4L14 5L15 5L15 4L17 4L17 5L16 5L16 8L18 8L18 9L17 9L17 12L16 12L16 11L15 11L15 10L16 10L16 9L15 9L15 10L14 10L14 9L13 9L13 10L11 10L11 13L12 13L12 12L13 12L13 13L14 13L14 14L13 14L13 15L14 15L14 16L8 16L8 17L10 17L10 18L11 18L11 19L12 19L12 21L14 21L14 22L15 22L15 24L16 24L16 22L15 22L15 21L20 21L20 23L19 23L19 24L20 24L20 25L18 25L18 24L17 24L17 25L18 25L18 26L17 26L17 28L16 28L16 27L15 27L15 26L16 26L16 25L15 25L15 26L14 26L14 25L13 25L13 24L14 24L14 23L13 23L13 24L12 24L12 25L11 25L11 22L9 22L9 21L10 21L10 20L8 20L8 18L6 18L6 17L7 17L7 16L6 16L6 15L7 15L7 14L3 14L3 16L1 16L1 14L2 14L2 13L1 13L1 11L2 11L2 12L3 12L3 10L1 10L1 11L0 11L0 13L1 13L1 14L0 14L0 16L1 16L1 17L0 17L0 20L1 20L1 21L0 21L0 22L1 22L1 23L0 23L0 24L1 24L1 25L4 25L4 26L2 26L2 28L3 28L3 29L2 29L2 30L3 30L3 29L4 29L4 32L5 32L5 33L8 33L8 34L6 34L6 35L8 35L8 36L6 36L6 37L8 37L8 39L9 39L9 40L8 40L8 45L12 45L12 43L11 43L11 42L12 42L12 41L13 41L13 43L14 43L14 44L13 44L13 45L14 45L14 44L15 44L15 45L17 45L17 44L16 44L16 43L14 43L14 41L13 41L13 40L14 40L14 39L12 39L12 38L13 38L13 37L11 37L11 35L12 35L12 36L14 36L14 35L16 35L16 37L14 37L14 38L16 38L16 37L20 37L20 38L19 38L19 40L20 40L20 41L18 41L18 40L17 40L17 41L18 41L18 42L17 42L17 43L18 43L18 42L20 42L20 44L18 44L18 45L20 45L20 44L21 44L21 45L23 45L23 44L24 44L24 45L26 45L26 44L28 44L28 42L34 42L34 43L37 43L37 41L39 41L39 44L38 44L38 45L44 45L44 44L43 44L43 41L42 41L42 40L45 40L45 39L44 39L44 38L45 38L45 36L44 36L44 34L45 34L45 33L44 33L44 34L43 34L43 33L41 33L41 34L39 34L39 33L35 33L35 34L34 34L34 32L35 32L35 31L37 31L37 32L39 32L39 31L38 31L38 30L35 30L35 31L34 31L34 30L33 30L33 29L35 29L35 28L36 28L36 29L38 29L38 28L36 28L36 27L38 27L38 25L42 25L42 26L43 26L43 27L41 27L41 28L39 28L39 30L40 30L40 32L43 32L43 31L44 31L44 32L45 32L45 31L44 31L44 30L45 30L45 27L44 27L44 26L45 26L45 25L44 25L44 22L45 22L45 21L44 21L44 20L43 20L43 19L44 19L44 18L45 18L45 17L44 17L44 16L43 16L43 14L45 14L45 13L43 13L43 11L44 11L44 10L45 10L45 9L44 9L44 8L43 8L43 9L44 9L44 10L42 10L42 8L41 8L41 12L42 12L42 14L39 14L39 15L37 15L37 14L38 14L38 13L37 13L37 12L38 12L38 11L39 11L39 10L40 10L40 8L39 8L39 10L38 10L38 8L37 8L37 6L36 6L36 7L35 7L35 6L34 6L34 5L37 5L37 3L36 3L36 1L37 1L37 0L36 0L36 1L35 1L35 4L32 4L32 3L31 3L31 2L33 2L33 3L34 3L34 2L33 2L33 1L34 1L34 0L32 0L32 1L31 1L31 0L28 0L28 1L26 1L26 0L25 0L25 1L24 1L24 0L23 0L23 3L22 3L22 2L21 2L21 1L22 1L22 0L21 0L21 1L19 1L19 2L18 2L18 0L16 0L16 1L13 1L13 0L12 0L12 1L11 1L11 0ZM28 1L28 2L30 2L30 1ZM10 2L10 4L11 4L11 5L12 5L12 4L11 4L11 2ZM17 2L17 4L18 4L18 6L17 6L17 7L18 7L18 6L19 6L19 7L20 7L20 5L19 5L19 4L20 4L20 3L21 3L21 4L22 4L22 3L21 3L21 2L19 2L19 4L18 4L18 2ZM23 3L23 4L24 4L24 3ZM27 3L27 4L26 4L26 5L27 5L27 7L26 7L26 6L25 6L25 8L27 8L27 9L26 9L26 10L29 10L29 12L27 12L27 11L25 11L25 12L24 12L24 11L20 11L20 12L19 12L19 13L15 13L15 12L14 12L14 11L13 11L13 12L14 12L14 13L15 13L15 15L16 15L16 17L11 17L11 18L13 18L13 19L15 19L15 20L14 20L14 21L15 21L15 20L16 20L16 19L15 19L15 18L16 18L16 17L17 17L17 20L19 20L19 18L21 18L21 19L20 19L20 20L23 20L23 18L24 18L24 16L25 16L25 15L26 15L26 18L25 18L25 19L24 19L24 20L26 20L26 22L28 22L28 23L26 23L26 26L27 26L27 27L26 27L26 28L25 28L25 29L26 29L26 30L25 30L25 33L24 33L24 34L17 34L17 36L18 36L18 35L19 35L19 36L20 36L20 35L22 35L22 36L23 36L23 35L25 35L25 37L26 37L26 38L25 38L25 39L26 39L26 38L28 38L28 39L29 39L29 38L30 38L30 40L26 40L26 42L24 42L24 41L20 41L20 42L24 42L24 44L25 44L25 43L27 43L27 42L28 42L28 41L31 41L31 40L32 40L32 41L34 41L34 42L35 42L35 37L36 37L36 36L39 36L39 34L38 34L38 35L36 35L36 34L35 34L35 36L34 36L34 35L33 35L33 32L34 32L34 31L33 31L33 32L32 32L32 31L30 31L30 30L27 30L27 29L31 29L31 28L32 28L32 29L33 29L33 27L32 27L32 25L33 25L33 26L35 26L35 27L34 27L34 28L35 28L35 27L36 27L36 26L35 26L35 24L36 24L36 23L34 23L34 22L36 22L36 21L34 21L34 20L36 20L36 19L32 19L32 21L31 21L31 22L32 22L32 23L30 23L30 22L29 22L29 20L26 20L26 18L27 18L27 19L28 19L28 17L29 17L29 16L30 16L30 15L31 15L31 16L32 16L32 17L33 17L33 18L35 18L35 17L33 17L33 16L36 16L36 17L37 17L37 16L36 16L36 14L35 14L35 13L36 13L36 11L38 11L38 10L35 10L35 9L37 9L37 8L35 8L35 7L34 7L34 6L33 6L33 7L34 7L34 8L32 8L32 6L31 6L31 5L30 5L30 4L31 4L31 3ZM28 4L28 5L29 5L29 6L28 6L28 8L29 8L29 6L30 6L30 9L29 9L29 10L31 10L31 9L32 9L32 8L31 8L31 6L30 6L30 5L29 5L29 4ZM21 5L21 8L24 8L24 5ZM22 6L22 7L23 7L23 6ZM19 8L19 9L18 9L18 11L19 11L19 9L20 9L20 10L24 10L24 9L20 9L20 8ZM32 10L32 11L33 11L33 12L34 12L34 11L35 11L35 10L34 10L34 11L33 11L33 10ZM30 11L30 12L31 12L31 13L30 13L30 14L28 14L28 13L27 13L27 12L26 12L26 13L25 13L25 14L23 14L23 15L25 15L25 14L26 14L26 15L27 15L27 16L29 16L29 15L30 15L30 14L32 14L32 16L33 16L33 15L34 15L34 14L32 14L32 12L31 12L31 11ZM21 12L21 14L20 14L20 13L19 13L19 14L17 14L17 15L19 15L19 16L18 16L18 18L19 18L19 16L20 16L20 17L23 17L23 16L22 16L22 15L21 15L21 14L22 14L22 13L23 13L23 12ZM26 13L26 14L27 14L27 15L28 15L28 14L27 14L27 13ZM19 14L19 15L20 15L20 16L21 16L21 15L20 15L20 14ZM39 15L39 17L38 17L38 18L39 18L39 20L41 20L41 19L40 19L40 17L41 17L41 18L42 18L42 19L43 19L43 18L42 18L42 17L43 17L43 16L42 16L42 17L41 17L41 16L40 16L40 15ZM5 16L5 17L6 17L6 16ZM2 17L2 21L1 21L1 22L2 22L2 23L1 23L1 24L2 24L2 23L3 23L3 21L4 21L4 20L3 20L3 19L5 19L5 20L7 20L7 19L6 19L6 18L3 18L3 17ZM29 18L29 19L31 19L31 18ZM5 21L5 24L8 24L8 21ZM21 21L21 24L24 24L24 21ZM32 21L32 22L34 22L34 21ZM37 21L37 24L40 24L40 21ZM6 22L6 23L7 23L7 22ZM17 22L17 23L18 23L18 22ZM22 22L22 23L23 23L23 22ZM38 22L38 23L39 23L39 22ZM9 23L9 24L10 24L10 23ZM28 23L28 24L27 24L27 25L28 25L28 24L29 24L29 26L28 26L28 27L27 27L27 28L29 28L29 26L31 26L31 25L32 25L32 24L33 24L33 23L32 23L32 24L31 24L31 25L30 25L30 23ZM42 24L42 25L43 25L43 24ZM6 25L6 26L5 26L5 27L4 27L4 28L5 28L5 27L6 27L6 28L9 28L9 30L8 30L8 29L5 29L5 30L7 30L7 31L5 31L5 32L7 32L7 31L9 31L9 32L8 32L8 33L9 33L9 34L8 34L8 35L9 35L9 34L12 34L12 33L10 33L10 30L11 30L11 29L13 29L13 30L14 30L14 29L16 29L16 31L15 31L15 32L16 32L16 33L13 33L13 34L16 34L16 33L18 33L18 32L17 32L17 31L18 31L18 30L19 30L19 31L20 31L20 30L19 30L19 29L23 29L23 30L24 30L24 29L23 29L23 28L21 28L21 27L23 27L23 26L24 26L24 27L25 27L25 26L24 26L24 25L23 25L23 26L21 26L21 27L20 27L20 26L18 26L18 28L19 28L19 29L16 29L16 28L14 28L14 29L13 29L13 25L12 25L12 26L11 26L11 27L10 27L10 26L9 26L9 25ZM0 26L0 28L1 28L1 26ZM6 26L6 27L8 27L8 26ZM11 27L11 28L12 28L12 27ZM30 27L30 28L31 28L31 27ZM41 28L41 29L40 29L40 30L41 30L41 31L42 31L42 30L41 30L41 29L42 29L42 28ZM43 29L43 30L44 30L44 29ZM0 30L0 31L1 31L1 32L0 32L0 34L2 34L2 33L3 33L3 31L1 31L1 30ZM21 30L21 31L22 31L22 33L23 33L23 31L22 31L22 30ZM26 30L26 31L27 31L27 32L26 32L26 33L27 33L27 32L29 32L29 33L28 33L28 35L27 35L27 34L25 34L25 35L26 35L26 36L27 36L27 37L28 37L28 36L30 36L30 38L32 38L32 39L34 39L34 38L33 38L33 37L34 37L34 36L33 36L33 37L32 37L32 36L30 36L30 35L29 35L29 33L30 33L30 34L32 34L32 32L30 32L30 31L27 31L27 30ZM13 31L13 32L14 32L14 31ZM1 32L1 33L2 33L2 32ZM19 32L19 33L21 33L21 32ZM4 34L4 35L1 35L1 36L0 36L0 37L1 37L1 36L3 36L3 37L5 37L5 34ZM40 35L40 36L41 36L41 35ZM8 36L8 37L9 37L9 36ZM43 36L43 37L41 37L41 40L42 40L42 38L43 38L43 37L44 37L44 36ZM21 37L21 40L24 40L24 37ZM37 37L37 40L40 40L40 37ZM10 38L10 39L11 39L11 40L10 40L10 41L9 41L9 42L11 42L11 41L12 41L12 39L11 39L11 38ZM17 38L17 39L18 39L18 38ZM22 38L22 39L23 39L23 38ZM38 38L38 39L39 39L39 38ZM15 41L15 42L16 42L16 41ZM41 41L41 42L40 42L40 43L42 43L42 41ZM44 42L44 43L45 43L45 42ZM9 43L9 44L11 44L11 43ZM21 43L21 44L23 44L23 43ZM29 43L29 44L30 44L30 45L32 45L32 44L31 44L31 43ZM34 44L34 45L35 45L35 44ZM36 44L36 45L37 45L37 44ZM0 0L0 7L7 7L7 0ZM1 1L1 6L6 6L6 1ZM2 2L2 5L5 5L5 2ZM38 0L38 7L45 7L45 0ZM39 1L39 6L44 6L44 1ZM40 2L40 5L43 5L43 2ZM0 38L0 45L7 45L7 38ZM1 39L1 44L6 44L6 39ZM2 40L2 43L5 43L5 40Z\" fill=\"#000000\"/></g></g></svg>\n",
    "as_uri": "otpauth://totp/Laravel%[email protected]?issuer=Laravel&label=john%40aom.com&secret=CREPRUYTMCBSCPEAG2LGKOFYOF25BL4A&algorithm=SHA1&digits=6",
    "as_string": "CREPRUYTMCBSCPEAG2LGKOFYOF25BL4A"
}
 

Request   

GET api/user-meta/2fa

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

Prepare 2fa

To prepares QR code for Two factor authentication, you need to use this request. 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": "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\" width=\"200\" height=\"200\" viewBox=\"0 0 200 200\"><rect x=\"0\" y=\"0\" width=\"200\" height=\"200\" fill=\"#fefefe\"/><g transform=\"scale(4.444)\"><g transform=\"translate(0,0)\"><path fill-rule=\"evenodd\" d=\"M10 0L10 1L8 1L8 2L9 2L9 3L8 3L8 4L10 4L10 5L8 5L8 7L9 7L9 6L10 6L10 8L6 8L6 9L8 9L8 10L5 10L5 8L0 8L0 9L4 9L4 11L7 11L7 12L5 12L5 13L7 13L7 12L8 12L8 11L9 11L9 14L10 14L10 11L9 11L9 10L10 10L10 8L11 8L11 9L12 9L12 8L11 8L11 6L12 6L12 7L13 7L13 8L14 8L14 7L15 7L15 6L14 6L14 7L13 7L13 6L12 6L12 5L13 5L13 4L12 4L12 2L13 2L13 3L14 3L14 2L16 2L16 3L15 3L15 4L14 4L14 5L15 5L15 4L17 4L17 5L16 5L16 8L18 8L18 9L17 9L17 12L16 12L16 11L15 11L15 10L16 10L16 9L15 9L15 10L14 10L14 9L13 9L13 10L11 10L11 13L12 13L12 12L13 12L13 13L14 13L14 14L13 14L13 15L14 15L14 16L8 16L8 17L10 17L10 18L11 18L11 19L12 19L12 21L14 21L14 22L15 22L15 24L16 24L16 22L15 22L15 21L20 21L20 23L19 23L19 24L20 24L20 25L18 25L18 24L17 24L17 25L18 25L18 26L17 26L17 28L16 28L16 27L15 27L15 26L16 26L16 25L15 25L15 26L14 26L14 25L13 25L13 24L14 24L14 23L13 23L13 24L12 24L12 25L11 25L11 22L9 22L9 21L10 21L10 20L8 20L8 18L6 18L6 17L7 17L7 16L6 16L6 15L7 15L7 14L3 14L3 16L1 16L1 14L2 14L2 13L1 13L1 11L2 11L2 12L3 12L3 10L1 10L1 11L0 11L0 13L1 13L1 14L0 14L0 16L1 16L1 17L0 17L0 20L1 20L1 21L0 21L0 22L1 22L1 23L0 23L0 24L1 24L1 25L4 25L4 26L2 26L2 28L3 28L3 29L2 29L2 30L3 30L3 29L4 29L4 32L5 32L5 33L8 33L8 34L6 34L6 35L8 35L8 36L6 36L6 37L8 37L8 39L9 39L9 40L8 40L8 45L12 45L12 43L11 43L11 42L12 42L12 41L13 41L13 43L14 43L14 44L13 44L13 45L14 45L14 44L15 44L15 45L17 45L17 44L16 44L16 43L14 43L14 41L13 41L13 40L14 40L14 39L12 39L12 38L13 38L13 37L11 37L11 35L12 35L12 36L14 36L14 35L16 35L16 37L14 37L14 38L16 38L16 37L20 37L20 38L19 38L19 40L20 40L20 41L18 41L18 40L17 40L17 41L18 41L18 42L17 42L17 43L18 43L18 42L20 42L20 44L18 44L18 45L20 45L20 44L21 44L21 45L23 45L23 44L24 44L24 45L26 45L26 44L28 44L28 42L34 42L34 43L37 43L37 41L39 41L39 44L38 44L38 45L44 45L44 44L43 44L43 41L42 41L42 40L45 40L45 39L44 39L44 38L45 38L45 36L44 36L44 34L45 34L45 33L44 33L44 34L43 34L43 33L41 33L41 34L39 34L39 33L35 33L35 34L34 34L34 32L35 32L35 31L37 31L37 32L39 32L39 31L38 31L38 30L35 30L35 31L34 31L34 30L33 30L33 29L35 29L35 28L36 28L36 29L38 29L38 28L36 28L36 27L38 27L38 25L42 25L42 26L43 26L43 27L41 27L41 28L39 28L39 30L40 30L40 32L43 32L43 31L44 31L44 32L45 32L45 31L44 31L44 30L45 30L45 27L44 27L44 26L45 26L45 25L44 25L44 22L45 22L45 21L44 21L44 20L43 20L43 19L44 19L44 18L45 18L45 17L44 17L44 16L43 16L43 14L45 14L45 13L43 13L43 11L44 11L44 10L45 10L45 9L44 9L44 8L43 8L43 9L44 9L44 10L42 10L42 8L41 8L41 12L42 12L42 14L39 14L39 15L37 15L37 14L38 14L38 13L37 13L37 12L38 12L38 11L39 11L39 10L40 10L40 8L39 8L39 10L38 10L38 8L37 8L37 6L36 6L36 7L35 7L35 6L34 6L34 5L37 5L37 3L36 3L36 1L37 1L37 0L36 0L36 1L35 1L35 4L32 4L32 3L31 3L31 2L33 2L33 3L34 3L34 2L33 2L33 1L34 1L34 0L32 0L32 1L31 1L31 0L28 0L28 1L26 1L26 0L25 0L25 1L24 1L24 0L23 0L23 3L22 3L22 2L21 2L21 1L22 1L22 0L21 0L21 1L19 1L19 2L18 2L18 0L16 0L16 1L13 1L13 0L12 0L12 1L11 1L11 0ZM28 1L28 2L30 2L30 1ZM10 2L10 4L11 4L11 5L12 5L12 4L11 4L11 2ZM17 2L17 4L18 4L18 6L17 6L17 7L18 7L18 6L19 6L19 7L20 7L20 5L19 5L19 4L20 4L20 3L21 3L21 4L22 4L22 3L21 3L21 2L19 2L19 4L18 4L18 2ZM23 3L23 4L24 4L24 3ZM27 3L27 4L26 4L26 5L27 5L27 7L26 7L26 6L25 6L25 8L27 8L27 9L26 9L26 10L29 10L29 12L27 12L27 11L25 11L25 12L24 12L24 11L20 11L20 12L19 12L19 13L15 13L15 12L14 12L14 11L13 11L13 12L14 12L14 13L15 13L15 15L16 15L16 17L11 17L11 18L13 18L13 19L15 19L15 20L14 20L14 21L15 21L15 20L16 20L16 19L15 19L15 18L16 18L16 17L17 17L17 20L19 20L19 18L21 18L21 19L20 19L20 20L23 20L23 18L24 18L24 16L25 16L25 15L26 15L26 18L25 18L25 19L24 19L24 20L26 20L26 22L28 22L28 23L26 23L26 26L27 26L27 27L26 27L26 28L25 28L25 29L26 29L26 30L25 30L25 33L24 33L24 34L17 34L17 36L18 36L18 35L19 35L19 36L20 36L20 35L22 35L22 36L23 36L23 35L25 35L25 37L26 37L26 38L25 38L25 39L26 39L26 38L28 38L28 39L29 39L29 38L30 38L30 40L26 40L26 42L24 42L24 41L20 41L20 42L24 42L24 44L25 44L25 43L27 43L27 42L28 42L28 41L31 41L31 40L32 40L32 41L34 41L34 42L35 42L35 37L36 37L36 36L39 36L39 34L38 34L38 35L36 35L36 34L35 34L35 36L34 36L34 35L33 35L33 32L34 32L34 31L33 31L33 32L32 32L32 31L30 31L30 30L27 30L27 29L31 29L31 28L32 28L32 29L33 29L33 27L32 27L32 25L33 25L33 26L35 26L35 27L34 27L34 28L35 28L35 27L36 27L36 26L35 26L35 24L36 24L36 23L34 23L34 22L36 22L36 21L34 21L34 20L36 20L36 19L32 19L32 21L31 21L31 22L32 22L32 23L30 23L30 22L29 22L29 20L26 20L26 18L27 18L27 19L28 19L28 17L29 17L29 16L30 16L30 15L31 15L31 16L32 16L32 17L33 17L33 18L35 18L35 17L33 17L33 16L36 16L36 17L37 17L37 16L36 16L36 14L35 14L35 13L36 13L36 11L38 11L38 10L35 10L35 9L37 9L37 8L35 8L35 7L34 7L34 6L33 6L33 7L34 7L34 8L32 8L32 6L31 6L31 5L30 5L30 4L31 4L31 3ZM28 4L28 5L29 5L29 6L28 6L28 8L29 8L29 6L30 6L30 9L29 9L29 10L31 10L31 9L32 9L32 8L31 8L31 6L30 6L30 5L29 5L29 4ZM21 5L21 8L24 8L24 5ZM22 6L22 7L23 7L23 6ZM19 8L19 9L18 9L18 11L19 11L19 9L20 9L20 10L24 10L24 9L20 9L20 8ZM32 10L32 11L33 11L33 12L34 12L34 11L35 11L35 10L34 10L34 11L33 11L33 10ZM30 11L30 12L31 12L31 13L30 13L30 14L28 14L28 13L27 13L27 12L26 12L26 13L25 13L25 14L23 14L23 15L25 15L25 14L26 14L26 15L27 15L27 16L29 16L29 15L30 15L30 14L32 14L32 16L33 16L33 15L34 15L34 14L32 14L32 12L31 12L31 11ZM21 12L21 14L20 14L20 13L19 13L19 14L17 14L17 15L19 15L19 16L18 16L18 18L19 18L19 16L20 16L20 17L23 17L23 16L22 16L22 15L21 15L21 14L22 14L22 13L23 13L23 12ZM26 13L26 14L27 14L27 15L28 15L28 14L27 14L27 13ZM19 14L19 15L20 15L20 16L21 16L21 15L20 15L20 14ZM39 15L39 17L38 17L38 18L39 18L39 20L41 20L41 19L40 19L40 17L41 17L41 18L42 18L42 19L43 19L43 18L42 18L42 17L43 17L43 16L42 16L42 17L41 17L41 16L40 16L40 15ZM5 16L5 17L6 17L6 16ZM2 17L2 21L1 21L1 22L2 22L2 23L1 23L1 24L2 24L2 23L3 23L3 21L4 21L4 20L3 20L3 19L5 19L5 20L7 20L7 19L6 19L6 18L3 18L3 17ZM29 18L29 19L31 19L31 18ZM5 21L5 24L8 24L8 21ZM21 21L21 24L24 24L24 21ZM32 21L32 22L34 22L34 21ZM37 21L37 24L40 24L40 21ZM6 22L6 23L7 23L7 22ZM17 22L17 23L18 23L18 22ZM22 22L22 23L23 23L23 22ZM38 22L38 23L39 23L39 22ZM9 23L9 24L10 24L10 23ZM28 23L28 24L27 24L27 25L28 25L28 24L29 24L29 26L28 26L28 27L27 27L27 28L29 28L29 26L31 26L31 25L32 25L32 24L33 24L33 23L32 23L32 24L31 24L31 25L30 25L30 23ZM42 24L42 25L43 25L43 24ZM6 25L6 26L5 26L5 27L4 27L4 28L5 28L5 27L6 27L6 28L9 28L9 30L8 30L8 29L5 29L5 30L7 30L7 31L5 31L5 32L7 32L7 31L9 31L9 32L8 32L8 33L9 33L9 34L8 34L8 35L9 35L9 34L12 34L12 33L10 33L10 30L11 30L11 29L13 29L13 30L14 30L14 29L16 29L16 31L15 31L15 32L16 32L16 33L13 33L13 34L16 34L16 33L18 33L18 32L17 32L17 31L18 31L18 30L19 30L19 31L20 31L20 30L19 30L19 29L23 29L23 30L24 30L24 29L23 29L23 28L21 28L21 27L23 27L23 26L24 26L24 27L25 27L25 26L24 26L24 25L23 25L23 26L21 26L21 27L20 27L20 26L18 26L18 28L19 28L19 29L16 29L16 28L14 28L14 29L13 29L13 25L12 25L12 26L11 26L11 27L10 27L10 26L9 26L9 25ZM0 26L0 28L1 28L1 26ZM6 26L6 27L8 27L8 26ZM11 27L11 28L12 28L12 27ZM30 27L30 28L31 28L31 27ZM41 28L41 29L40 29L40 30L41 30L41 31L42 31L42 30L41 30L41 29L42 29L42 28ZM43 29L43 30L44 30L44 29ZM0 30L0 31L1 31L1 32L0 32L0 34L2 34L2 33L3 33L3 31L1 31L1 30ZM21 30L21 31L22 31L22 33L23 33L23 31L22 31L22 30ZM26 30L26 31L27 31L27 32L26 32L26 33L27 33L27 32L29 32L29 33L28 33L28 35L27 35L27 34L25 34L25 35L26 35L26 36L27 36L27 37L28 37L28 36L30 36L30 38L32 38L32 39L34 39L34 38L33 38L33 37L34 37L34 36L33 36L33 37L32 37L32 36L30 36L30 35L29 35L29 33L30 33L30 34L32 34L32 32L30 32L30 31L27 31L27 30ZM13 31L13 32L14 32L14 31ZM1 32L1 33L2 33L2 32ZM19 32L19 33L21 33L21 32ZM4 34L4 35L1 35L1 36L0 36L0 37L1 37L1 36L3 36L3 37L5 37L5 34ZM40 35L40 36L41 36L41 35ZM8 36L8 37L9 37L9 36ZM43 36L43 37L41 37L41 40L42 40L42 38L43 38L43 37L44 37L44 36ZM21 37L21 40L24 40L24 37ZM37 37L37 40L40 40L40 37ZM10 38L10 39L11 39L11 40L10 40L10 41L9 41L9 42L11 42L11 41L12 41L12 39L11 39L11 38ZM17 38L17 39L18 39L18 38ZM22 38L22 39L23 39L23 38ZM38 38L38 39L39 39L39 38ZM15 41L15 42L16 42L16 41ZM41 41L41 42L40 42L40 43L42 43L42 41ZM44 42L44 43L45 43L45 42ZM9 43L9 44L11 44L11 43ZM21 43L21 44L23 44L23 43ZM29 43L29 44L30 44L30 45L32 45L32 44L31 44L31 43ZM34 44L34 45L35 45L35 44ZM36 44L36 45L37 45L37 44ZM0 0L0 7L7 7L7 0ZM1 1L1 6L6 6L6 1ZM2 2L2 5L5 5L5 2ZM38 0L38 7L45 7L45 0ZM39 1L39 6L44 6L44 1ZM40 2L40 5L43 5L43 2ZM0 38L0 45L7 45L7 38ZM1 39L1 44L6 44L6 39ZM2 40L2 43L5 43L5 40Z\" fill=\"#000000\"/></g></g></svg>\n",
    "as_uri": "otpauth://totp/Laravel%[email protected]?issuer=Laravel&label=john%40aom.com&secret=CREPRUYTMCBSCPEAG2LGKOFYOF25BL4A&algorithm=SHA1&digits=6",
    "as_string": "CREPRUYTMCBSCPEAG2LGKOFYOF25BL4A"
}
 

Request   

POST api/user/prepareTwoFactorAuth

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

user_id   integer   

ID of the user. Example: 4

Confirm 2fa

To confirms relation between your AOM site and your authnticator app for 2fa, you need to use this request. User need to provided secret code from authenticator app. It enables Two factor authentication feature in the system for users. (See parameters)

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\": 250987,
    \"qrCode\": \"<?xml version=\\\\\\\"1.0\\\\\\\" encoding=\\\\\\\"UTF-8\\\\\\\"?>\\\\n<svg xmlns=\\\\\\\"http:\\\\\\/\\\\\\/www.w3.org\\\\\\/2000\\\\\\/svg\\\\\\\" version=\\\\\\\"1.1\\\\\\\" width=\\\\\\\"200\\\\\\\" height=\\\\\\\"200\\\\\\\" viewBox=\\\\\\\"0 0 200 200\\\\\\\"><rect x=\\\\\\\"0\\\\\\\" y=\\\\\\\"0\\\\\\\" width=\\\\\\\"200\\\\\\\" height=\\\\\\\"200\\\\\\\" fill=\\\\\\\"#fefefe\\\\\\\"\\\\\\/><g transform=\\\\\\\"scale(4.444)\\\\\\\"><g transform=\\\\\\\"translate(0,0)\\\\\\\"><path fill-rule=\\\\\\\"evenodd\\\\\\\" d=\\\\\\\"M10 0L10 1L8 1L8 2L9 2L9 3L8 3L8 4L10 4L10 5L8 5L8 7L9 7L9 6L10 6L10 8L6 8L6 9L8 9L8 10L5 10L5 8L0 8L0 9L4 9L4 11L7 11L7 12L5 12L5 13L7 13L7 12L8 12L8 11L9 11L9 14L10 14L10 11L9 11L9 10L10 10L10 8L11 8L11 9L12 9L12 8L11 8L11 6L12 6L12 7L13 7L13 8L14 8L14 7L15 7L15 6L14 6L14 7L13 7L13 6L12 6L12 5L13 5L13 4L12 4L12 2L13 2L13 3L14 3L14 2L16 2L16 3L15 3L15 4L14 4L14 5L15 5L15 4L17 4L17 5L16 5L16 8L18 8L18 9L17 9L17 12L16 12L16 11L15 11L15 10L16 10L16 9L15 9L15 10L14 10L14 9L13 9L13 10L11 10L11 13L12 13L12 12L13 12L13 13L14 13L14 14L13 14L13 15L14 15L14 16L8 16L8 17L10 17L10 18L11 18L11 19L12 19L12 21L14 21L14 22L15 22L15 24L16 24L16 22L15 22L15 21L20 21L20 23L19 23L19 24L20 24L20 25L18 25L18 24L17 24L17 25L18 25L18 26L17 26L17 28L16 28L16 27L15 27L15 26L16 26L16 25L15 25L15 26L14 26L14 25L13 25L13 24L14 24L14 23L13 23L13 24L12 24L12 25L11 25L11 22L9 22L9 21L10 21L10 20L8 20L8 18L6 18L6 17L7 17L7 16L6 16L6 15L7 15L7 14L3 14L3 16L1 16L1 14L2 14L2 13L1 13L1 11L2 11L2 12L3 12L3 10L1 10L1 11L0 11L0 13L1 13L1 14L0 14L0 16L1 16L1 17L0 17L0 20L1 20L1 21L0 21L0 22L1 22L1 23L0 23L0 24L1 24L1 25L4 25L4 26L2 26L2 28L3 28L3 29L2 29L2 30L3 30L3 29L4 29L4 32L5 32L5 33L8 33L8 34L6 34L6 35L8 35L8 36L6 36L6 37L8 37L8 39L9 39L9 40L8 40L8 45L12 45L12 43L11 43L11 42L12 42L12 41L13 41L13 43L14 43L14 44L13 44L13 45L14 45L14 44L15 44L15 45L17 45L17 44L16 44L16 43L14 43L14 41L13 41L13 40L14 40L14 39L12 39L12 38L13 38L13 37L11 37L11 35L12 35L12 36L14 36L14 35L16 35L16 37L14 37L14 38L16 38L16 37L20 37L20 38L19 38L19 40L20 40L20 41L18 41L18 40L17 40L17 41L18 41L18 42L17 42L17 43L18 43L18 42L20 42L20 44L18 44L18 45L20 45L20 44L21 44L21 45L23 45L23 44L24 44L24 45L26 45L26 44L28 44L28 42L34 42L34 43L37 43L37 41L39 41L39 44L38 44L38 45L44 45L44 44L43 44L43 41L42 41L42 40L45 40L45 39L44 39L44 38L45 38L45 36L44 36L44 34L45 34L45 33L44 33L44 34L43 34L43 33L41 33L41 34L39 34L39 33L35 33L35 34L34 34L34 32L35 32L35 31L37 31L37 32L39 32L39 31L38 31L38 30L35 30L35 31L34 31L34 30L33 30L33 29L35 29L35 28L36 28L36 29L38 29L38 28L36 28L36 27L38 27L38 25L42 25L42 26L43 26L43 27L41 27L41 28L39 28L39 30L40 30L40 32L43 32L43 31L44 31L44 32L45 32L45 31L44 31L44 30L45 30L45 27L44 27L44 26L45 26L45 25L44 25L44 22L45 22L45 21L44 21L44 20L43 20L43 19L44 19L44 18L45 18L45 17L44 17L44 16L43 16L43 14L45 14L45 13L43 13L43 11L44 11L44 10L45 10L45 9L44 9L44 8L43 8L43 9L44 9L44 10L42 10L42 8L41 8L41 12L42 12L42 14L39 14L39 15L37 15L37 14L38 14L38 13L37 13L37 12L38 12L38 11L39 11L39 10L40 10L40 8L39 8L39 10L38 10L38 8L37 8L37 6L36 6L36 7L35 7L35 6L34 6L34 5L37 5L37 3L36 3L36 1L37 1L37 0L36 0L36 1L35 1L35 4L32 4L32 3L31 3L31 2L33 2L33 3L34 3L34 2L33 2L33 1L34 1L34 0L32 0L32 1L31 1L31 0L28 0L28 1L26 1L26 0L25 0L25 1L24 1L24 0L23 0L23 3L22 3L22 2L21 2L21 1L22 1L22 0L21 0L21 1L19 1L19 2L18 2L18 0L16 0L16 1L13 1L13 0L12 0L12 1L11 1L11 0ZM28 1L28 2L30 2L30 1ZM10 2L10 4L11 4L11 5L12 5L12 4L11 4L11 2ZM17 2L17 4L18 4L18 6L17 6L17 7L18 7L18 6L19 6L19 7L20 7L20 5L19 5L19 4L20 4L20 3L21 3L21 4L22 4L22 3L21 3L21 2L19 2L19 4L18 4L18 2ZM23 3L23 4L24 4L24 3ZM27 3L27 4L26 4L26 5L27 5L27 7L26 7L26 6L25 6L25 8L27 8L27 9L26 9L26 10L29 10L29 12L27 12L27 11L25 11L25 12L24 12L24 11L20 11L20 12L19 12L19 13L15 13L15 12L14 12L14 11L13 11L13 12L14 12L14 13L15 13L15 15L16 15L16 17L11 17L11 18L13 18L13 19L15 19L15 20L14 20L14 21L15 21L15 20L16 20L16 19L15 19L15 18L16 18L16 17L17 17L17 20L19 20L19 18L21 18L21 19L20 19L20 20L23 20L23 18L24 18L24 16L25 16L25 15L26 15L26 18L25 18L25 19L24 19L24 20L26 20L26 22L28 22L28 23L26 23L26 26L27 26L27 27L26 27L26 28L25 28L25 29L26 29L26 30L25 30L25 33L24 33L24 34L17 34L17 36L18 36L18 35L19 35L19 36L20 36L20 35L22 35L22 36L23 36L23 35L25 35L25 37L26 37L26 38L25 38L25 39L26 39L26 38L28 38L28 39L29 39L29 38L30 38L30 40L26 40L26 42L24 42L24 41L20 41L20 42L24 42L24 44L25 44L25 43L27 43L27 42L28 42L28 41L31 41L31 40L32 40L32 41L34 41L34 42L35 42L35 37L36 37L36 36L39 36L39 34L38 34L38 35L36 35L36 34L35 34L35 36L34 36L34 35L33 35L33 32L34 32L34 31L33 31L33 32L32 32L32 31L30 31L30 30L27 30L27 29L31 29L31 28L32 28L32 29L33 29L33 27L32 27L32 25L33 25L33 26L35 26L35 27L34 27L34 28L35 28L35 27L36 27L36 26L35 26L35 24L36 24L36 23L34 23L34 22L36 22L36 21L34 21L34 20L36 20L36 19L32 19L32 21L31 21L31 22L32 22L32 23L30 23L30 22L29 22L29 20L26 20L26 18L27 18L27 19L28 19L28 17L29 17L29 16L30 16L30 15L31 15L31 16L32 16L32 17L33 17L33 18L35 18L35 17L33 17L33 16L36 16L36 17L37 17L37 16L36 16L36 14L35 14L35 13L36 13L36 11L38 11L38 10L35 10L35 9L37 9L37 8L35 8L35 7L34 7L34 6L33 6L33 7L34 7L34 8L32 8L32 6L31 6L31 5L30 5L30 4L31 4L31 3ZM28 4L28 5L29 5L29 6L28 6L28 8L29 8L29 6L30 6L30 9L29 9L29 10L31 10L31 9L32 9L32 8L31 8L31 6L30 6L30 5L29 5L29 4ZM21 5L21 8L24 8L24 5ZM22 6L22 7L23 7L23 6ZM19 8L19 9L18 9L18 11L19 11L19 9L20 9L20 10L24 10L24 9L20 9L20 8ZM32 10L32 11L33 11L33 12L34 12L34 11L35 11L35 10L34 10L34 11L33 11L33 10ZM30 11L30 12L31 12L31 13L30 13L30 14L28 14L28 13L27 13L27 12L26 12L26 13L25 13L25 14L23 14L23 15L25 15L25 14L26 14L26 15L27 15L27 16L29 16L29 15L30 15L30 14L32 14L32 16L33 16L33 15L34 15L34 14L32 14L32 12L31 12L31 11ZM21 12L21 14L20 14L20 13L19 13L19 14L17 14L17 15L19 15L19 16L18 16L18 18L19 18L19 16L20 16L20 17L23 17L23 16L22 16L22 15L21 15L21 14L22 14L22 13L23 13L23 12ZM26 13L26 14L27 14L27 15L28 15L28 14L27 14L27 13ZM19 14L19 15L20 15L20 16L21 16L21 15L20 15L20 14ZM39 15L39 17L38 17L38 18L39 18L39 20L41 20L41 19L40 19L40 17L41 17L41 18L42 18L42 19L43 19L43 18L42 18L42 17L43 17L43 16L42 16L42 17L41 17L41 16L40 16L40 15ZM5 16L5 17L6 17L6 16ZM2 17L2 21L1 21L1 22L2 22L2 23L1 23L1 24L2 24L2 23L3 23L3 21L4 21L4 20L3 20L3 19L5 19L5 20L7 20L7 19L6 19L6 18L3 18L3 17ZM29 18L29 19L31 19L31 18ZM5 21L5 24L8 24L8 21ZM21 21L21 24L24 24L24 21ZM32 21L32 22L34 22L34 21ZM37 21L37 24L40 24L40 21ZM6 22L6 23L7 23L7 22ZM17 22L17 23L18 23L18 22ZM22 22L22 23L23 23L23 22ZM38 22L38 23L39 23L39 22ZM9 23L9 24L10 24L10 23ZM28 23L28 24L27 24L27 25L28 25L28 24L29 24L29 26L28 26L28 27L27 27L27 28L29 28L29 26L31 26L31 25L32 25L32 24L33 24L33 23L32 23L32 24L31 24L31 25L30 25L30 23ZM42 24L42 25L43 25L43 24ZM6 25L6 26L5 26L5 27L4 27L4 28L5 28L5 27L6 27L6 28L9 28L9 30L8 30L8 29L5 29L5 30L7 30L7 31L5 31L5 32L7 32L7 31L9 31L9 32L8 32L8 33L9 33L9 34L8 34L8 35L9 35L9 34L12 34L12 33L10 33L10 30L11 30L11 29L13 29L13 30L14 30L14 29L16 29L16 31L15 31L15 32L16 32L16 33L13 33L13 34L16 34L16 33L18 33L18 32L17 32L17 31L18 31L18 30L19 30L19 31L20 31L20 30L19 30L19 29L23 29L23 30L24 30L24 29L23 29L23 28L21 28L21 27L23 27L23 26L24 26L24 27L25 27L25 26L24 26L24 25L23 25L23 26L21 26L21 27L20 27L20 26L18 26L18 28L19 28L19 29L16 29L16 28L14 28L14 29L13 29L13 25L12 25L12 26L11 26L11 27L10 27L10 26L9 26L9 25ZM0 26L0 28L1 28L1 26ZM6 26L6 27L8 27L8 26ZM11 27L11 28L12 28L12 27ZM30 27L30 28L31 28L31 27ZM41 28L41 29L40 29L40 30L41 30L41 31L42 31L42 30L41 30L41 29L42 29L42 28ZM43 29L43 30L44 30L44 29ZM0 30L0 31L1 31L1 32L0 32L0 34L2 34L2 33L3 33L3 31L1 31L1 30ZM21 30L21 31L22 31L22 33L23 33L23 31L22 31L22 30ZM26 30L26 31L27 31L27 32L26 32L26 33L27 33L27 32L29 32L29 33L28 33L28 35L27 35L27 34L25 34L25 35L26 35L26 36L27 36L27 37L28 37L28 36L30 36L30 38L32 38L32 39L34 39L34 38L33 38L33 37L34 37L34 36L33 36L33 37L32 37L32 36L30 36L30 35L29 35L29 33L30 33L30 34L32 34L32 32L30 32L30 31L27 31L27 30ZM13 31L13 32L14 32L14 31ZM1 32L1 33L2 33L2 32ZM19 32L19 33L21 33L21 32ZM4 34L4 35L1 35L1 36L0 36L0 37L1 37L1 36L3 36L3 37L5 37L5 34ZM40 35L40 36L41 36L41 35ZM8 36L8 37L9 37L9 36ZM43 36L43 37L41 37L41 40L42 40L42 38L43 38L43 37L44 37L44 36ZM21 37L21 40L24 40L24 37ZM37 37L37 40L40 40L40 37ZM10 38L10 39L11 39L11 40L10 40L10 41L9 41L9 42L11 42L11 41L12 41L12 39L11 39L11 38ZM17 38L17 39L18 39L18 38ZM22 38L22 39L23 39L23 38ZM38 38L38 39L39 39L39 38ZM15 41L15 42L16 42L16 41ZM41 41L41 42L40 42L40 43L42 43L42 41ZM44 42L44 43L45 43L45 42ZM9 43L9 44L11 44L11 43ZM21 43L21 44L23 44L23 43ZM29 43L29 44L30 44L30 45L32 45L32 44L31 44L31 43ZM34 44L34 45L35 45L35 44ZM36 44L36 45L37 45L37 44ZM0 0L0 7L7 7L7 0ZM1 1L1 6L6 6L6 1ZM2 2L2 5L5 5L5 2ZM38 0L38 7L45 7L45 0ZM39 1L39 6L44 6L44 1ZM40 2L40 5L43 5L43 2ZM0 38L0 45L7 45L7 38ZM1 39L1 44L6 44L6 39ZM2 40L2 43L5 43L5 40Z\\\\\\\" fill=\\\\\\\"#000000\\\\\\\"\\\\\\/><\\\\\\/g><\\\\\\/g><\\\\\\/svg>\\\\n\",
    \"stringCode\": \"CREPRUYTMCBSCPEAG2LGKOFYOF25BLR3E\"
}"
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": 250987,
    "qrCode": "<?xml version=\\\"1.0\\\" encoding=\\\"UTF-8\\\"?>\\n<svg xmlns=\\\"http:\\\/\\\/www.w3.org\\\/2000\\\/svg\\\" version=\\\"1.1\\\" width=\\\"200\\\" height=\\\"200\\\" viewBox=\\\"0 0 200 200\\\"><rect x=\\\"0\\\" y=\\\"0\\\" width=\\\"200\\\" height=\\\"200\\\" fill=\\\"#fefefe\\\"\\\/><g transform=\\\"scale(4.444)\\\"><g transform=\\\"translate(0,0)\\\"><path fill-rule=\\\"evenodd\\\" d=\\\"M10 0L10 1L8 1L8 2L9 2L9 3L8 3L8 4L10 4L10 5L8 5L8 7L9 7L9 6L10 6L10 8L6 8L6 9L8 9L8 10L5 10L5 8L0 8L0 9L4 9L4 11L7 11L7 12L5 12L5 13L7 13L7 12L8 12L8 11L9 11L9 14L10 14L10 11L9 11L9 10L10 10L10 8L11 8L11 9L12 9L12 8L11 8L11 6L12 6L12 7L13 7L13 8L14 8L14 7L15 7L15 6L14 6L14 7L13 7L13 6L12 6L12 5L13 5L13 4L12 4L12 2L13 2L13 3L14 3L14 2L16 2L16 3L15 3L15 4L14 4L14 5L15 5L15 4L17 4L17 5L16 5L16 8L18 8L18 9L17 9L17 12L16 12L16 11L15 11L15 10L16 10L16 9L15 9L15 10L14 10L14 9L13 9L13 10L11 10L11 13L12 13L12 12L13 12L13 13L14 13L14 14L13 14L13 15L14 15L14 16L8 16L8 17L10 17L10 18L11 18L11 19L12 19L12 21L14 21L14 22L15 22L15 24L16 24L16 22L15 22L15 21L20 21L20 23L19 23L19 24L20 24L20 25L18 25L18 24L17 24L17 25L18 25L18 26L17 26L17 28L16 28L16 27L15 27L15 26L16 26L16 25L15 25L15 26L14 26L14 25L13 25L13 24L14 24L14 23L13 23L13 24L12 24L12 25L11 25L11 22L9 22L9 21L10 21L10 20L8 20L8 18L6 18L6 17L7 17L7 16L6 16L6 15L7 15L7 14L3 14L3 16L1 16L1 14L2 14L2 13L1 13L1 11L2 11L2 12L3 12L3 10L1 10L1 11L0 11L0 13L1 13L1 14L0 14L0 16L1 16L1 17L0 17L0 20L1 20L1 21L0 21L0 22L1 22L1 23L0 23L0 24L1 24L1 25L4 25L4 26L2 26L2 28L3 28L3 29L2 29L2 30L3 30L3 29L4 29L4 32L5 32L5 33L8 33L8 34L6 34L6 35L8 35L8 36L6 36L6 37L8 37L8 39L9 39L9 40L8 40L8 45L12 45L12 43L11 43L11 42L12 42L12 41L13 41L13 43L14 43L14 44L13 44L13 45L14 45L14 44L15 44L15 45L17 45L17 44L16 44L16 43L14 43L14 41L13 41L13 40L14 40L14 39L12 39L12 38L13 38L13 37L11 37L11 35L12 35L12 36L14 36L14 35L16 35L16 37L14 37L14 38L16 38L16 37L20 37L20 38L19 38L19 40L20 40L20 41L18 41L18 40L17 40L17 41L18 41L18 42L17 42L17 43L18 43L18 42L20 42L20 44L18 44L18 45L20 45L20 44L21 44L21 45L23 45L23 44L24 44L24 45L26 45L26 44L28 44L28 42L34 42L34 43L37 43L37 41L39 41L39 44L38 44L38 45L44 45L44 44L43 44L43 41L42 41L42 40L45 40L45 39L44 39L44 38L45 38L45 36L44 36L44 34L45 34L45 33L44 33L44 34L43 34L43 33L41 33L41 34L39 34L39 33L35 33L35 34L34 34L34 32L35 32L35 31L37 31L37 32L39 32L39 31L38 31L38 30L35 30L35 31L34 31L34 30L33 30L33 29L35 29L35 28L36 28L36 29L38 29L38 28L36 28L36 27L38 27L38 25L42 25L42 26L43 26L43 27L41 27L41 28L39 28L39 30L40 30L40 32L43 32L43 31L44 31L44 32L45 32L45 31L44 31L44 30L45 30L45 27L44 27L44 26L45 26L45 25L44 25L44 22L45 22L45 21L44 21L44 20L43 20L43 19L44 19L44 18L45 18L45 17L44 17L44 16L43 16L43 14L45 14L45 13L43 13L43 11L44 11L44 10L45 10L45 9L44 9L44 8L43 8L43 9L44 9L44 10L42 10L42 8L41 8L41 12L42 12L42 14L39 14L39 15L37 15L37 14L38 14L38 13L37 13L37 12L38 12L38 11L39 11L39 10L40 10L40 8L39 8L39 10L38 10L38 8L37 8L37 6L36 6L36 7L35 7L35 6L34 6L34 5L37 5L37 3L36 3L36 1L37 1L37 0L36 0L36 1L35 1L35 4L32 4L32 3L31 3L31 2L33 2L33 3L34 3L34 2L33 2L33 1L34 1L34 0L32 0L32 1L31 1L31 0L28 0L28 1L26 1L26 0L25 0L25 1L24 1L24 0L23 0L23 3L22 3L22 2L21 2L21 1L22 1L22 0L21 0L21 1L19 1L19 2L18 2L18 0L16 0L16 1L13 1L13 0L12 0L12 1L11 1L11 0ZM28 1L28 2L30 2L30 1ZM10 2L10 4L11 4L11 5L12 5L12 4L11 4L11 2ZM17 2L17 4L18 4L18 6L17 6L17 7L18 7L18 6L19 6L19 7L20 7L20 5L19 5L19 4L20 4L20 3L21 3L21 4L22 4L22 3L21 3L21 2L19 2L19 4L18 4L18 2ZM23 3L23 4L24 4L24 3ZM27 3L27 4L26 4L26 5L27 5L27 7L26 7L26 6L25 6L25 8L27 8L27 9L26 9L26 10L29 10L29 12L27 12L27 11L25 11L25 12L24 12L24 11L20 11L20 12L19 12L19 13L15 13L15 12L14 12L14 11L13 11L13 12L14 12L14 13L15 13L15 15L16 15L16 17L11 17L11 18L13 18L13 19L15 19L15 20L14 20L14 21L15 21L15 20L16 20L16 19L15 19L15 18L16 18L16 17L17 17L17 20L19 20L19 18L21 18L21 19L20 19L20 20L23 20L23 18L24 18L24 16L25 16L25 15L26 15L26 18L25 18L25 19L24 19L24 20L26 20L26 22L28 22L28 23L26 23L26 26L27 26L27 27L26 27L26 28L25 28L25 29L26 29L26 30L25 30L25 33L24 33L24 34L17 34L17 36L18 36L18 35L19 35L19 36L20 36L20 35L22 35L22 36L23 36L23 35L25 35L25 37L26 37L26 38L25 38L25 39L26 39L26 38L28 38L28 39L29 39L29 38L30 38L30 40L26 40L26 42L24 42L24 41L20 41L20 42L24 42L24 44L25 44L25 43L27 43L27 42L28 42L28 41L31 41L31 40L32 40L32 41L34 41L34 42L35 42L35 37L36 37L36 36L39 36L39 34L38 34L38 35L36 35L36 34L35 34L35 36L34 36L34 35L33 35L33 32L34 32L34 31L33 31L33 32L32 32L32 31L30 31L30 30L27 30L27 29L31 29L31 28L32 28L32 29L33 29L33 27L32 27L32 25L33 25L33 26L35 26L35 27L34 27L34 28L35 28L35 27L36 27L36 26L35 26L35 24L36 24L36 23L34 23L34 22L36 22L36 21L34 21L34 20L36 20L36 19L32 19L32 21L31 21L31 22L32 22L32 23L30 23L30 22L29 22L29 20L26 20L26 18L27 18L27 19L28 19L28 17L29 17L29 16L30 16L30 15L31 15L31 16L32 16L32 17L33 17L33 18L35 18L35 17L33 17L33 16L36 16L36 17L37 17L37 16L36 16L36 14L35 14L35 13L36 13L36 11L38 11L38 10L35 10L35 9L37 9L37 8L35 8L35 7L34 7L34 6L33 6L33 7L34 7L34 8L32 8L32 6L31 6L31 5L30 5L30 4L31 4L31 3ZM28 4L28 5L29 5L29 6L28 6L28 8L29 8L29 6L30 6L30 9L29 9L29 10L31 10L31 9L32 9L32 8L31 8L31 6L30 6L30 5L29 5L29 4ZM21 5L21 8L24 8L24 5ZM22 6L22 7L23 7L23 6ZM19 8L19 9L18 9L18 11L19 11L19 9L20 9L20 10L24 10L24 9L20 9L20 8ZM32 10L32 11L33 11L33 12L34 12L34 11L35 11L35 10L34 10L34 11L33 11L33 10ZM30 11L30 12L31 12L31 13L30 13L30 14L28 14L28 13L27 13L27 12L26 12L26 13L25 13L25 14L23 14L23 15L25 15L25 14L26 14L26 15L27 15L27 16L29 16L29 15L30 15L30 14L32 14L32 16L33 16L33 15L34 15L34 14L32 14L32 12L31 12L31 11ZM21 12L21 14L20 14L20 13L19 13L19 14L17 14L17 15L19 15L19 16L18 16L18 18L19 18L19 16L20 16L20 17L23 17L23 16L22 16L22 15L21 15L21 14L22 14L22 13L23 13L23 12ZM26 13L26 14L27 14L27 15L28 15L28 14L27 14L27 13ZM19 14L19 15L20 15L20 16L21 16L21 15L20 15L20 14ZM39 15L39 17L38 17L38 18L39 18L39 20L41 20L41 19L40 19L40 17L41 17L41 18L42 18L42 19L43 19L43 18L42 18L42 17L43 17L43 16L42 16L42 17L41 17L41 16L40 16L40 15ZM5 16L5 17L6 17L6 16ZM2 17L2 21L1 21L1 22L2 22L2 23L1 23L1 24L2 24L2 23L3 23L3 21L4 21L4 20L3 20L3 19L5 19L5 20L7 20L7 19L6 19L6 18L3 18L3 17ZM29 18L29 19L31 19L31 18ZM5 21L5 24L8 24L8 21ZM21 21L21 24L24 24L24 21ZM32 21L32 22L34 22L34 21ZM37 21L37 24L40 24L40 21ZM6 22L6 23L7 23L7 22ZM17 22L17 23L18 23L18 22ZM22 22L22 23L23 23L23 22ZM38 22L38 23L39 23L39 22ZM9 23L9 24L10 24L10 23ZM28 23L28 24L27 24L27 25L28 25L28 24L29 24L29 26L28 26L28 27L27 27L27 28L29 28L29 26L31 26L31 25L32 25L32 24L33 24L33 23L32 23L32 24L31 24L31 25L30 25L30 23ZM42 24L42 25L43 25L43 24ZM6 25L6 26L5 26L5 27L4 27L4 28L5 28L5 27L6 27L6 28L9 28L9 30L8 30L8 29L5 29L5 30L7 30L7 31L5 31L5 32L7 32L7 31L9 31L9 32L8 32L8 33L9 33L9 34L8 34L8 35L9 35L9 34L12 34L12 33L10 33L10 30L11 30L11 29L13 29L13 30L14 30L14 29L16 29L16 31L15 31L15 32L16 32L16 33L13 33L13 34L16 34L16 33L18 33L18 32L17 32L17 31L18 31L18 30L19 30L19 31L20 31L20 30L19 30L19 29L23 29L23 30L24 30L24 29L23 29L23 28L21 28L21 27L23 27L23 26L24 26L24 27L25 27L25 26L24 26L24 25L23 25L23 26L21 26L21 27L20 27L20 26L18 26L18 28L19 28L19 29L16 29L16 28L14 28L14 29L13 29L13 25L12 25L12 26L11 26L11 27L10 27L10 26L9 26L9 25ZM0 26L0 28L1 28L1 26ZM6 26L6 27L8 27L8 26ZM11 27L11 28L12 28L12 27ZM30 27L30 28L31 28L31 27ZM41 28L41 29L40 29L40 30L41 30L41 31L42 31L42 30L41 30L41 29L42 29L42 28ZM43 29L43 30L44 30L44 29ZM0 30L0 31L1 31L1 32L0 32L0 34L2 34L2 33L3 33L3 31L1 31L1 30ZM21 30L21 31L22 31L22 33L23 33L23 31L22 31L22 30ZM26 30L26 31L27 31L27 32L26 32L26 33L27 33L27 32L29 32L29 33L28 33L28 35L27 35L27 34L25 34L25 35L26 35L26 36L27 36L27 37L28 37L28 36L30 36L30 38L32 38L32 39L34 39L34 38L33 38L33 37L34 37L34 36L33 36L33 37L32 37L32 36L30 36L30 35L29 35L29 33L30 33L30 34L32 34L32 32L30 32L30 31L27 31L27 30ZM13 31L13 32L14 32L14 31ZM1 32L1 33L2 33L2 32ZM19 32L19 33L21 33L21 32ZM4 34L4 35L1 35L1 36L0 36L0 37L1 37L1 36L3 36L3 37L5 37L5 34ZM40 35L40 36L41 36L41 35ZM8 36L8 37L9 37L9 36ZM43 36L43 37L41 37L41 40L42 40L42 38L43 38L43 37L44 37L44 36ZM21 37L21 40L24 40L24 37ZM37 37L37 40L40 40L40 37ZM10 38L10 39L11 39L11 40L10 40L10 41L9 41L9 42L11 42L11 41L12 41L12 39L11 39L11 38ZM17 38L17 39L18 39L18 38ZM22 38L22 39L23 39L23 38ZM38 38L38 39L39 39L39 38ZM15 41L15 42L16 42L16 41ZM41 41L41 42L40 42L40 43L42 43L42 41ZM44 42L44 43L45 43L45 42ZM9 43L9 44L11 44L11 43ZM21 43L21 44L23 44L23 43ZM29 43L29 44L30 44L30 45L32 45L32 44L31 44L31 43ZM34 44L34 45L35 45L35 44ZM36 44L36 45L37 45L37 44ZM0 0L0 7L7 7L7 0ZM1 1L1 6L6 6L6 1ZM2 2L2 5L5 5L5 2ZM38 0L38 7L45 7L45 0ZM39 1L39 6L44 6L44 1ZM40 2L40 5L43 5L43 2ZM0 38L0 45L7 45L7 38ZM1 39L1 44L6 44L6 39ZM2 40L2 43L5 43L5 40Z\\\" fill=\\\"#000000\\\"\\\/><\\\/g><\\\/g><\\\/svg>\\n",
    "stringCode": "CREPRUYTMCBSCPEAG2LGKOFYOF25BLR3E"
};

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   

ID of the user. Example: 4

secretCode   number   

secret code from users authenticator app. Example: 250987

qrCode   string    \n<\/g><\/g><\/svg>\n" data-component="body">

QR code generated by prepareTwoFactor method. Example: <?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" version=\"1.1\" width=\"200\" height=\"200\" viewBox=\"0 0 200 200\"><rect x=\"0\" y=\"0\" width=\"200\" height=\"200\" fill=\"#fefefe\"\/><g transform=\"scale(4.444)\"><g transform=\"translate(0,0)\"><path fill-rule=\"evenodd\" d=\"M10 0L10 1L8 1L8 2L9 2L9 3L8 3L8 4L10 4L10 5L8 5L8 7L9 7L9 6L10 6L10 8L6 8L6 9L8 9L8 10L5 10L5 8L0 8L0 9L4 9L4 11L7 11L7 12L5 12L5 13L7 13L7 12L8 12L8 11L9 11L9 14L10 14L10 11L9 11L9 10L10 10L10 8L11 8L11 9L12 9L12 8L11 8L11 6L12 6L12 7L13 7L13 8L14 8L14 7L15 7L15 6L14 6L14 7L13 7L13 6L12 6L12 5L13 5L13 4L12 4L12 2L13 2L13 3L14 3L14 2L16 2L16 3L15 3L15 4L14 4L14 5L15 5L15 4L17 4L17 5L16 5L16 8L18 8L18 9L17 9L17 12L16 12L16 11L15 11L15 10L16 10L16 9L15 9L15 10L14 10L14 9L13 9L13 10L11 10L11 13L12 13L12 12L13 12L13 13L14 13L14 14L13 14L13 15L14 15L14 16L8 16L8 17L10 17L10 18L11 18L11 19L12 19L12 21L14 21L14 22L15 22L15 24L16 24L16 22L15 22L15 21L20 21L20 23L19 23L19 24L20 24L20 25L18 25L18 24L17 24L17 25L18 25L18 26L17 26L17 28L16 28L16 27L15 27L15 26L16 26L16 25L15 25L15 26L14 26L14 25L13 25L13 24L14 24L14 23L13 23L13 24L12 24L12 25L11 25L11 22L9 22L9 21L10 21L10 20L8 20L8 18L6 18L6 17L7 17L7 16L6 16L6 15L7 15L7 14L3 14L3 16L1 16L1 14L2 14L2 13L1 13L1 11L2 11L2 12L3 12L3 10L1 10L1 11L0 11L0 13L1 13L1 14L0 14L0 16L1 16L1 17L0 17L0 20L1 20L1 21L0 21L0 22L1 22L1 23L0 23L0 24L1 24L1 25L4 25L4 26L2 26L2 28L3 28L3 29L2 29L2 30L3 30L3 29L4 29L4 32L5 32L5 33L8 33L8 34L6 34L6 35L8 35L8 36L6 36L6 37L8 37L8 39L9 39L9 40L8 40L8 45L12 45L12 43L11 43L11 42L12 42L12 41L13 41L13 43L14 43L14 44L13 44L13 45L14 45L14 44L15 44L15 45L17 45L17 44L16 44L16 43L14 43L14 41L13 41L13 40L14 40L14 39L12 39L12 38L13 38L13 37L11 37L11 35L12 35L12 36L14 36L14 35L16 35L16 37L14 37L14 38L16 38L16 37L20 37L20 38L19 38L19 40L20 40L20 41L18 41L18 40L17 40L17 41L18 41L18 42L17 42L17 43L18 43L18 42L20 42L20 44L18 44L18 45L20 45L20 44L21 44L21 45L23 45L23 44L24 44L24 45L26 45L26 44L28 44L28 42L34 42L34 43L37 43L37 41L39 41L39 44L38 44L38 45L44 45L44 44L43 44L43 41L42 41L42 40L45 40L45 39L44 39L44 38L45 38L45 36L44 36L44 34L45 34L45 33L44 33L44 34L43 34L43 33L41 33L41 34L39 34L39 33L35 33L35 34L34 34L34 32L35 32L35 31L37 31L37 32L39 32L39 31L38 31L38 30L35 30L35 31L34 31L34 30L33 30L33 29L35 29L35 28L36 28L36 29L38 29L38 28L36 28L36 27L38 27L38 25L42 25L42 26L43 26L43 27L41 27L41 28L39 28L39 30L40 30L40 32L43 32L43 31L44 31L44 32L45 32L45 31L44 31L44 30L45 30L45 27L44 27L44 26L45 26L45 25L44 25L44 22L45 22L45 21L44 21L44 20L43 20L43 19L44 19L44 18L45 18L45 17L44 17L44 16L43 16L43 14L45 14L45 13L43 13L43 11L44 11L44 10L45 10L45 9L44 9L44 8L43 8L43 9L44 9L44 10L42 10L42 8L41 8L41 12L42 12L42 14L39 14L39 15L37 15L37 14L38 14L38 13L37 13L37 12L38 12L38 11L39 11L39 10L40 10L40 8L39 8L39 10L38 10L38 8L37 8L37 6L36 6L36 7L35 7L35 6L34 6L34 5L37 5L37 3L36 3L36 1L37 1L37 0L36 0L36 1L35 1L35 4L32 4L32 3L31 3L31 2L33 2L33 3L34 3L34 2L33 2L33 1L34 1L34 0L32 0L32 1L31 1L31 0L28 0L28 1L26 1L26 0L25 0L25 1L24 1L24 0L23 0L23 3L22 3L22 2L21 2L21 1L22 1L22 0L21 0L21 1L19 1L19 2L18 2L18 0L16 0L16 1L13 1L13 0L12 0L12 1L11 1L11 0ZM28 1L28 2L30 2L30 1ZM10 2L10 4L11 4L11 5L12 5L12 4L11 4L11 2ZM17 2L17 4L18 4L18 6L17 6L17 7L18 7L18 6L19 6L19 7L20 7L20 5L19 5L19 4L20 4L20 3L21 3L21 4L22 4L22 3L21 3L21 2L19 2L19 4L18 4L18 2ZM23 3L23 4L24 4L24 3ZM27 3L27 4L26 4L26 5L27 5L27 7L26 7L26 6L25 6L25 8L27 8L27 9L26 9L26 10L29 10L29 12L27 12L27 11L25 11L25 12L24 12L24 11L20 11L20 12L19 12L19 13L15 13L15 12L14 12L14 11L13 11L13 12L14 12L14 13L15 13L15 15L16 15L16 17L11 17L11 18L13 18L13 19L15 19L15 20L14 20L14 21L15 21L15 20L16 20L16 19L15 19L15 18L16 18L16 17L17 17L17 20L19 20L19 18L21 18L21 19L20 19L20 20L23 20L23 18L24 18L24 16L25 16L25 15L26 15L26 18L25 18L25 19L24 19L24 20L26 20L26 22L28 22L28 23L26 23L26 26L27 26L27 27L26 27L26 28L25 28L25 29L26 29L26 30L25 30L25 33L24 33L24 34L17 34L17 36L18 36L18 35L19 35L19 36L20 36L20 35L22 35L22 36L23 36L23 35L25 35L25 37L26 37L26 38L25 38L25 39L26 39L26 38L28 38L28 39L29 39L29 38L30 38L30 40L26 40L26 42L24 42L24 41L20 41L20 42L24 42L24 44L25 44L25 43L27 43L27 42L28 42L28 41L31 41L31 40L32 40L32 41L34 41L34 42L35 42L35 37L36 37L36 36L39 36L39 34L38 34L38 35L36 35L36 34L35 34L35 36L34 36L34 35L33 35L33 32L34 32L34 31L33 31L33 32L32 32L32 31L30 31L30 30L27 30L27 29L31 29L31 28L32 28L32 29L33 29L33 27L32 27L32 25L33 25L33 26L35 26L35 27L34 27L34 28L35 28L35 27L36 27L36 26L35 26L35 24L36 24L36 23L34 23L34 22L36 22L36 21L34 21L34 20L36 20L36 19L32 19L32 21L31 21L31 22L32 22L32 23L30 23L30 22L29 22L29 20L26 20L26 18L27 18L27 19L28 19L28 17L29 17L29 16L30 16L30 15L31 15L31 16L32 16L32 17L33 17L33 18L35 18L35 17L33 17L33 16L36 16L36 17L37 17L37 16L36 16L36 14L35 14L35 13L36 13L36 11L38 11L38 10L35 10L35 9L37 9L37 8L35 8L35 7L34 7L34 6L33 6L33 7L34 7L34 8L32 8L32 6L31 6L31 5L30 5L30 4L31 4L31 3ZM28 4L28 5L29 5L29 6L28 6L28 8L29 8L29 6L30 6L30 9L29 9L29 10L31 10L31 9L32 9L32 8L31 8L31 6L30 6L30 5L29 5L29 4ZM21 5L21 8L24 8L24 5ZM22 6L22 7L23 7L23 6ZM19 8L19 9L18 9L18 11L19 11L19 9L20 9L20 10L24 10L24 9L20 9L20 8ZM32 10L32 11L33 11L33 12L34 12L34 11L35 11L35 10L34 10L34 11L33 11L33 10ZM30 11L30 12L31 12L31 13L30 13L30 14L28 14L28 13L27 13L27 12L26 12L26 13L25 13L25 14L23 14L23 15L25 15L25 14L26 14L26 15L27 15L27 16L29 16L29 15L30 15L30 14L32 14L32 16L33 16L33 15L34 15L34 14L32 14L32 12L31 12L31 11ZM21 12L21 14L20 14L20 13L19 13L19 14L17 14L17 15L19 15L19 16L18 16L18 18L19 18L19 16L20 16L20 17L23 17L23 16L22 16L22 15L21 15L21 14L22 14L22 13L23 13L23 12ZM26 13L26 14L27 14L27 15L28 15L28 14L27 14L27 13ZM19 14L19 15L20 15L20 16L21 16L21 15L20 15L20 14ZM39 15L39 17L38 17L38 18L39 18L39 20L41 20L41 19L40 19L40 17L41 17L41 18L42 18L42 19L43 19L43 18L42 18L42 17L43 17L43 16L42 16L42 17L41 17L41 16L40 16L40 15ZM5 16L5 17L6 17L6 16ZM2 17L2 21L1 21L1 22L2 22L2 23L1 23L1 24L2 24L2 23L3 23L3 21L4 21L4 20L3 20L3 19L5 19L5 20L7 20L7 19L6 19L6 18L3 18L3 17ZM29 18L29 19L31 19L31 18ZM5 21L5 24L8 24L8 21ZM21 21L21 24L24 24L24 21ZM32 21L32 22L34 22L34 21ZM37 21L37 24L40 24L40 21ZM6 22L6 23L7 23L7 22ZM17 22L17 23L18 23L18 22ZM22 22L22 23L23 23L23 22ZM38 22L38 23L39 23L39 22ZM9 23L9 24L10 24L10 23ZM28 23L28 24L27 24L27 25L28 25L28 24L29 24L29 26L28 26L28 27L27 27L27 28L29 28L29 26L31 26L31 25L32 25L32 24L33 24L33 23L32 23L32 24L31 24L31 25L30 25L30 23ZM42 24L42 25L43 25L43 24ZM6 25L6 26L5 26L5 27L4 27L4 28L5 28L5 27L6 27L6 28L9 28L9 30L8 30L8 29L5 29L5 30L7 30L7 31L5 31L5 32L7 32L7 31L9 31L9 32L8 32L8 33L9 33L9 34L8 34L8 35L9 35L9 34L12 34L12 33L10 33L10 30L11 30L11 29L13 29L13 30L14 30L14 29L16 29L16 31L15 31L15 32L16 32L16 33L13 33L13 34L16 34L16 33L18 33L18 32L17 32L17 31L18 31L18 30L19 30L19 31L20 31L20 30L19 30L19 29L23 29L23 30L24 30L24 29L23 29L23 28L21 28L21 27L23 27L23 26L24 26L24 27L25 27L25 26L24 26L24 25L23 25L23 26L21 26L21 27L20 27L20 26L18 26L18 28L19 28L19 29L16 29L16 28L14 28L14 29L13 29L13 25L12 25L12 26L11 26L11 27L10 27L10 26L9 26L9 25ZM0 26L0 28L1 28L1 26ZM6 26L6 27L8 27L8 26ZM11 27L11 28L12 28L12 27ZM30 27L30 28L31 28L31 27ZM41 28L41 29L40 29L40 30L41 30L41 31L42 31L42 30L41 30L41 29L42 29L42 28ZM43 29L43 30L44 30L44 29ZM0 30L0 31L1 31L1 32L0 32L0 34L2 34L2 33L3 33L3 31L1 31L1 30ZM21 30L21 31L22 31L22 33L23 33L23 31L22 31L22 30ZM26 30L26 31L27 31L27 32L26 32L26 33L27 33L27 32L29 32L29 33L28 33L28 35L27 35L27 34L25 34L25 35L26 35L26 36L27 36L27 37L28 37L28 36L30 36L30 38L32 38L32 39L34 39L34 38L33 38L33 37L34 37L34 36L33 36L33 37L32 37L32 36L30 36L30 35L29 35L29 33L30 33L30 34L32 34L32 32L30 32L30 31L27 31L27 30ZM13 31L13 32L14 32L14 31ZM1 32L1 33L2 33L2 32ZM19 32L19 33L21 33L21 32ZM4 34L4 35L1 35L1 36L0 36L0 37L1 37L1 36L3 36L3 37L5 37L5 34ZM40 35L40 36L41 36L41 35ZM8 36L8 37L9 37L9 36ZM43 36L43 37L41 37L41 40L42 40L42 38L43 38L43 37L44 37L44 36ZM21 37L21 40L24 40L24 37ZM37 37L37 40L40 40L40 37ZM10 38L10 39L11 39L11 40L10 40L10 41L9 41L9 42L11 42L11 41L12 41L12 39L11 39L11 38ZM17 38L17 39L18 39L18 38ZM22 38L22 39L23 39L23 38ZM38 38L38 39L39 39L39 38ZM15 41L15 42L16 42L16 41ZM41 41L41 42L40 42L40 43L42 43L42 41ZM44 42L44 43L45 43L45 42ZM9 43L9 44L11 44L11 43ZM21 43L21 44L23 44L23 43ZM29 43L29 44L30 44L30 45L32 45L32 44L31 44L31 43ZM34 44L34 45L35 45L35 44ZM36 44L36 45L37 45L37 44ZM0 0L0 7L7 7L7 0ZM1 1L1 6L6 6L6 1ZM2 2L2 5L5 5L5 2ZM38 0L38 7L45 7L45 0ZM39 1L39 6L44 6L44 1ZM40 2L40 5L43 5L43 2ZM0 38L0 45L7 45L7 38ZM1 39L1 44L6 44L6 39ZM2 40L2 43L5 43L5 40Z\" fill=\"#000000\"\/><\/g><\/g><\/svg>\n

stringCode   string   

String code generated by prepareTwoFactor method. Example: CREPRUYTMCBSCPEAG2LGKOFYOF25BLR3E

Disable 2fa

To disables Two factor authentication feature in system for specified user, you need to use this request. (See parameters)

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   

ID of the user. Example: 4

Resend New Account Email

Send New Account Created email again.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/email/resendNewAccountEmail" \
    --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/email/resendNewAccountEmail"
);

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


[
    {
        "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}

Body Parameters

user_id   integer   

ID of the user. Example: 4

GET api/user-consents/tabularlist

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/user-consents/tabularlist" \
    --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 headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 300
x-ratelimit-remaining: 261
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

GET api/user-consents/tabularlist

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Accredible

It allows users to receive digital credentials

Validate Accredible Key

Validates whether the given key is correct.

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

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": "Success",
    "status": "success"
}
 

Request   

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

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

key   string   

Key of the accredible needs to be validated. Example: 3cc557a91d67378f7fc29fed973e5c94

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}

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": 2,
    "recordsFiltered": 2,
    "records": [
        {
            "id": 4,
            "name": "assign",
            "slug": "assign",
            "type": "assignment",
            "submissionType": "file",
            "totalPoints": 50,
            "icon": "<i class=\"el-icon-edit-outline\"></i>",
            "author": "Aom Staff",
            "created_at": "Aug 10, 2020 06:43 AM"
        },
        {
            "id": 2,
            "name": "assignment 1",
            "slug": "assignment-1",
            "type": "assignment",
            "submissionType": "text",
            "totalPoints": 100,
            "icon": "<i class=\"el-icon-edit-outline\"></i>",
            "author": "Aom Staff",
            "created_at": "Aug 09, 2020 07:25 AM"
        }
    ]
}
 

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

To create a assignment module, you need to use this request. (See parameters) Created assignment modules can be used in the course as course content/lesson.

Returns : id of the assignment created and successfull message

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\": \"A brief description\",
    \"submission_type\": \"file\",
    \"totalPoints\": 25,
    \"allowed_filetypes\": \"[\\\"image\\\", \\\"pdf\\\"]\"
}"
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": "A brief description",
    "submission_type": "file",
    "totalPoints": 25,
    "allowed_filetypes": "[\"image\", \"pdf\"]"
};

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

Example response (200):


{
    "id": 10,
    "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 modules that students will see. Example: A brief description

submission_type   string   

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

totalPoints   integer  optional  

Student will get this number if they complete the assignment. Example: 25

allowed_filetypes   string  optional  

Allowed file types that will be submitted by the students when the submission_type is file(required). Example: ["image", "pdf"]

Update Assignment Module

Updates the details of 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/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Essay on LMS\",
    \"content\": \"An Updated brief description\",
    \"submission_type\": \"file\",
    \"totalPoints\": 25,
    \"allowed_filetypes\": \"[\\\"image\\\", \\\"pdf\\\"]\"
}"
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 = {
    "name": "Essay on LMS",
    "content": "An Updated brief description",
    "submission_type": "file",
    "totalPoints": 25,
    "allowed_filetypes": "[\"image\", \"pdf\"]"
};

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}

Body Parameters

name   string   

Name of the assignment module. Example: Essay on LMS

content   string   

Content for the assignment modules that students will see. Example: An Updated brief description

submission_type   string   

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

totalPoints   integer  optional  

Student will get this number if they complete the assignment. Example: 25

allowed_filetypes   string  optional  

Allowed file types that will be submitted by the students when the submission_type is file(required). Example: ["image", "pdf"]

Retrieve Assignment Modules

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

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/modules/assignment/2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/assignment/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):


{
    "name": "assignment 1",
    "slug": "assignment-1",
    "content": "Hola",
    "totalPoints": 100,
    "submission_type": "text",
    "allowed_filetypes": [
        ""
    ]
}
 

Request   

GET 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 you want to fetch the details of. Example: 2

Retrieve Detailed Assignment Module Info

Retrieves details of assignment module in depth as well as different modules details that are being used as course content for the same course the current assignment module is attached to. Returns related fields value. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/assignment/details?registrationId=1&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/assignment/details"
);

const params = {
    "registrationId": "1",
    "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": "Essay on LMS",
    "slug": "essay-on-lms",
    "content": "A brief description",
    "courseName": "course 1",
    "courseSlug": "http://localhost:8000/course/course-1",
    "totalPoints": 25,
    "submissionType": "text",
    "maxUploadSize": 5,
    "min_time_spent": 0,
    "allowedFileTypes": ".",
    "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": "my-video-lesson",
    "nextSlug": "",
    "status": "Completed",
    "statusRowId": 5,
    "timeSpent": null,
    "prevSubmission": []
}
 

Request   

GET api/module/assignment/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 assignment module. Example: 9

Retrieve Assignment Submissions

Retrieves the submissions 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=7" \
    --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": "7",
};
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": "Submitted",
    "content": "Desc",
    "totalPoints": 50,
    "submissions": [
        {
            "id": 1,
            "file_path": "https://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",
            "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: 7

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 "{
    \"statusRowId\": \"7\",
    \"submission\": \"This is text based 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 = {
    "statusRowId": "7",
    "submission": "This is text based 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

statusRowId   required  optional  

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

submission   required  optional  

Submission data(file or text). Example: This is text based assignment submission

Upload Assignment File

Helps in upload the assignment file by students. You can use File form to upload a file to the system. (See Parameters) Returns the S3 bucket URL link for the uploaded file.

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\": \"binary\"
}"
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": "binary"
};

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   required  optional  

File to be uploaded for current assignment. Example: binary

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 "{
    \"statusRowId\": \"7\",
    \"evaluation\": \"{instructorMessage : \'Assignment looks 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 = {
    "statusRowId": "7",
    "evaluation": "{instructorMessage : 'Assignment looks 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

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 : 'Assignment looks good', pointsAwarded: '50', isAccepted : true }

Audit Logs

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

Tabular List

Retrieves all the audit log activities in a tabular list format with pagination mode. You can apply filter using search_param via user_id, activityName or dates

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/audit-activities?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%22performed_by%22%3A%22Aom+Staff%22%7D" \
    --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 = {
    "page_size": "10",
    "page_number": "1",
    "order_by": "{"colName":"created_at","direction":"desc"}",
    "search_param": "{"performed_by":"Aom 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: "GET",
    headers,
}).then(response => response.json());

Example response (200):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "records": [
        {
            "performed_by": "Aom Staff",
            "effect_on": "User",
            "subject": "User",
            "action": "Created",
            "created_at": "Aug 06, 2020 07:20 AM",
            "details": []
        }
    ],
    "performedOnList": []
}
 

Request   

GET api/audit-activities

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

page_size   string   

The number of the user 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 performed_by, user and dates. Example: {"performed_by":"Aom Staff"}

Audit Activity Lookup

Retrieves all the activity for the user. Helps 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

Retrieve Badge details

Retrieves the details of badges. (See Parameters)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/badges/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%22title%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/badges/tabularlist"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at","direction":"desc"}",
    "search_param": "{"title":""}",
};
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": "1",
            "badgeIconUrl": "/images/badges/Badge_1.png",
            "points": 1
        }
    ]
}
 

Request   

GET api/badges/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 title. Example: {"title":""}

Create Badge

Create a new badge.

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/badge/create?title=Gold&points=100&badgeIconUrl=https%3A%2F%2Fapi.example.com%2Fabc.jpg&defaultIconUrl=https%3A%2F%2Fapi.example.com%2Fabc.jpg&organizationId=AOM1234" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/badge/create"
);

const params = {
    "title": "Gold",
    "points": "100",
    "badgeIconUrl": "https://api.example.com/abc.jpg",
    "defaultIconUrl": "https://api.example.com/abc.jpg",
    "organizationId": "AOM1234",
};
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": 3,
    "message": "Badge created successfully"
}
 

Request   

POST api/badge/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

title   string   

string The title of the badge. Example: Gold

points   integer  optional  

The points associated with the badge. Example: 100

badgeIconUrl   string   

string The URL to the badge icon image. Example: https://api.example.com/abc.jpg

defaultIconUrl   string  optional  

nullable The URL to the default icon image for the badge. Example: https://api.example.com/abc.jpg

organizationId   string  optional  

nullable string The identifier of the organization to which the badge belongs. Example: AOM1234

Retrieve default Badges details

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"
    },
    {
        "value": "Badge 2",
        "url": "/images/badges/Badge_2.png"
    },
    {
        "value": "Badge 3",
        "url": "/images/badges/Badge_3.png"
    },
    {
        "value": "Badge 4",
        "url": "/images/badges/Badge_4.png"
    }
]
 

Request   

GET api/badges/defaultBadgeLookUp

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieve details of specific badge

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 Badge

Update the existing badge.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/badge/3?title=Gold&points=100&badgeIconUrl=https%3A%2F%2Fapi.example.com%2Fabc.jpg&defaultIconUrl=https%3A%2F%2Fapi.example.com%2Fabc.jpg&organizationId=AOM1234" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/badge/3"
);

const params = {
    "title": "Gold",
    "points": "100",
    "badgeIconUrl": "https://api.example.com/abc.jpg",
    "defaultIconUrl": "https://api.example.com/abc.jpg",
    "organizationId": "AOM1234",
};
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": 3,
    "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: 3

Query Parameters

title   string   

string The title of the badge. Example: Gold

points   integer  optional  

The points associated with the badge. Example: 100

badgeIconUrl   string   

string The URL to the badge icon image. Example: https://api.example.com/abc.jpg

defaultIconUrl   string  optional  

nullable The URL to the default icon image for the badge. Example: https://api.example.com/abc.jpg

organizationId   string  optional  

nullable string The identifier of the organization to which the badge belongs. Example: AOM1234

Delete badge

Delete a badge by ID.

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}"
const url = new URL(
    "https://demo.aomlms.com/api/badge/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 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}

URL Parameters

id   string  optional  

array required The ID of the badge to be deleted. Example: [1, 2, 3]

Categories

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

Product Category Lookup

Retrieves all the categories of the product user has ever created. 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": 4,
        "name": "Question-cat"
    }
]
 

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 the categories of the courses user has ever created. This request helps in showing all course categories in form elements like dropdown, etc. Returns ID and name of the course category.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/categories/course/lookup" \
    --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 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}

Module category Lookup

Retrieves all the categories of the module user has ever created. This request helps in showing all module categories in form elements like dropdown, etc. Returns ID and name of the module 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 question 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 user 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" \
    --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 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": "User-cat"
    }
]
 

Request   

GET api/categories/user/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Learning Path Category Lookup

Retrieves all the categories of the learning paths 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" \
    --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 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": "Learning Path-1"
    }
]
 

Request   

GET api/categories/learning-path/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

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%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 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%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": 2,
    "recordsFiltered": 1,
    "records": [
        {
            "id": 2,
            "name": "module memberships",
            "author": "Aom Staff",
            "count": 1,
            "created_at": "May 10, 2022 03:39 AM"
        }
    ]
}
 

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 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%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": 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/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=9&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": "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": 1,
    "records": [
        {
            "id": 4,
            "name": "Question-cat",
            "author": "Aom Staff",
            "count": 0,
            "created_at": "Aug 10, 2020 01:58 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: 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":""}

Create Category

To create a category, you need to use this request. Provide category name and it will be created. (See parameters) Helps in grouping multiple courses, question and products.

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 course category. Example: category-new

categoryType   string   

Type for the category that is being created. Type options: course, question, product and module. Example: course

Update Category

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

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-updated\"
}"
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-updated"
};

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-updated

Retrieve Category

Retrieves category details for specified category 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 Category

To delete a category, you need to use this request. Returns number of category deleted(if multiple selected)

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 "{
    \"delete_ids\": [
        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 = {
    "delete_ids": [
        1
    ]
};

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

Example response (200):


{
    "message": "1 category(s) deleted "
}
 

Request   

POST api/category/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string[]   

All category IDs which needs to be deleted.

Learning Path Category Tabular List

Returns all the learning path 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/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%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": 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/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 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":""}

Certificate Templates

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

Certificates Lookup

Retrieves all the certificate templates. Helps while showing certificate templates in form elements like dropdown. Returns Id and name of the certificate templates. (See Response)

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=tempora&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=%7B%22templateName%22%3A%22%22%2C%22courseId%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/certificate_templates/tabularlist"
);

const params = {
    "page_size": "50",
    "page_number": "tempora",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"templateName":"","courseId":""}",
};
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",
            "author": "Aom Staff",
            "courses": "course 1, Awesome Course, course 1_copy",
            "created_at": "Aug 03, 2020 09:58 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 items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: tempora

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: {"templateName":"","courseId":""}

Quick Edit

Updates the details in bulk for specified certificate templates. Parameters is provided which needs to be updated. (See Parameters)

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\": [
        3,
        1
    ],
    \"author_id\": 1
}"
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": [
        3,
        1
    ],
    "author_id": 1
};

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   string[]   

All certificate template IDs which needs to be updated.

author_id   integer  optional  

Update the instructor/Author for the selected certificate templates. Example: 1

Certificate Template Fields Lookup

Retrieves all the fields name user can add in the certificate templates. Fields like student name, instructor name, course name, etc. Helps showing options in dropdowns elements while creating certificate template.

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": "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}

Certificate Template Fonts Lookup

Retrieves all the fonts user can add in the certificate templates. Fonts like Arial, Times-Roman, Helvetica, etc. Helps showing options in dropdowns elements while creating certificate template.

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": "Arial",
        "display_value": "Arial",
        "is_selected": "true"
    },
    {
        "db_value": "Courier",
        "display_value": "Courier"
    },
    {
        "db_value": "Times-Roman",
        "display_value": "Times-Roman"
    },
    {
        "db_value": "Helvetica",
        "display_value": "Helvetica"
    },
    {
        "db_value": "Times-Bold",
        "display_value": "Times-Bold"
    },
    {
        "db_value": "Courier-Bold",
        "display_value": "Courier-Bold"
    },
    {
        "db_value": "DejaVuSans-Bold",
        "display_value": "DejaVuSans-Bold"
    },
    {
        "db_value": "DejaVuSansMono-Bold",
        "display_value": "DejaVuSansMono-Bold"
    }
]
 

Request   

GET api/certificate_template/fontFamilyLookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Create Certificate Template

To create a certificate template, you need to use this request. (See parameters) Created certificate template can be used to assign students when they completed the course.

Returns : id of the certificate template created and successfull message

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\",
    \"bg_url\": \"http:\\/\\/aom.com\\/images\\/default-certificate.png\",
    \"height\": 680,
    \"width\": 1075,
    \"fields\": [
        {
            \"key\": \"course_name\",
            \"value\": \"Course Name\",
            \"font_size\": \"20\",
            \"align_center\": false,
            \"font_family\": \"Arial\",
            \"font_color\": \"#222\",
            \"top\": 432,
            \"left\": 469,
            \"width\": 200,
            \"height\": 40,
            \"show_tools\": false
        },
        {
            \"key\": \"student_first_name\",
            \"value\": \"Student First Name\",
            \"font_size\": \"20\",
            \"align_center\": false,
            \"font_family\": \"Arial\",
            \"font_color\": \"#222\",
            \"top\": 332,
            \"left\": 452,
            \"width\": 200,
            \"height\": 40,
            \"show_tools\": false
        }
    ]
}"
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",
    "bg_url": "http:\/\/aom.com\/images\/default-certificate.png",
    "height": 680,
    "width": 1075,
    "fields": [
        {
            "key": "course_name",
            "value": "Course Name",
            "font_size": "20",
            "align_center": false,
            "font_family": "Arial",
            "font_color": "#222",
            "top": 432,
            "left": 469,
            "width": 200,
            "height": 40,
            "show_tools": false
        },
        {
            "key": "student_first_name",
            "value": "Student First Name",
            "font_size": "20",
            "align_center": false,
            "font_family": "Arial",
            "font_color": "#222",
            "top": 332,
            "left": 452,
            "width": 200,
            "height": 40,
            "show_tools": false
        }
    ]
};

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   

Name of the certificate template. Example: Completion-Certificate

bg_url   string  optional  

Background for the certificate template. Example: http://aom.com/images/default-certificate.png

height   integer   

Height size for the certificate template. Example: 680

width   integer   

Width size for the certificate template. Example: 1075

fields   string[]  optional  

All the certificate fields user have added to appear in certificate template(student name, instructor name, course name, etc).

Retrieve Certificate Template

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

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/certificate_template/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/certificate_template/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": "cert 1",
    "bg_url": "https://v3.academyofmine.net/wp-content/uploads/2020/07/default-certificate.png",
    "height": 827,
    "width": 1070,
    "fields": [
        {
            "key": "student_full_name",
            "value": "Student Full Name",
            "font_size": 20,
            "font_family": "Arial",
            "font_color": "#222",
            "top": 401,
            "left": 443,
            "align_center": false,
            "width": 200,
            "height": 60
        }
    ]
}
 

Request   

GET api/certificate_template/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

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

Preview Certificate Template

It let users preview certificate by downloading it with demo data. Changes the completion percentage to 100% and mark completed the text module.

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 download option
 

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   

ID of the Certificate template. Example: 2

Update Certificate Template

Updates the details of a specified certificate template. (See parameters) Certificate template can be used to assign students when they completed the course.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/certificate_template/2" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"Updated-Completion-Certificate\",
    \"bg_url\": \"http:\\/\\/aom.com\\/images\\/default-certificate.png\",
    \"height\": 780,
    \"width\": 1075,
    \"fields\": [
        {
            \"key\": \"course_name\",
            \"value\": \"Course Name\",
            \"font_size\": \"20\",
            \"align_center\": false,
            \"font_family\": \"Arial\",
            \"font_color\": \"#222\",
            \"top\": 432,
            \"left\": 469,
            \"width\": 200,
            \"height\": 40,
            \"show_tools\": false
        },
        {
            \"key\": \"student_first_name\",
            \"value\": \"Student First Name\",
            \"font_size\": \"20\",
            \"align_center\": false,
            \"font_family\": \"Arial\",
            \"font_color\": \"#222\",
            \"top\": 332,
            \"left\": 452,
            \"width\": 200,
            \"height\": 40,
            \"show_tools\": false
        }
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/certificate_template/2"
);

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

let body = {
    "name": "Updated-Completion-Certificate",
    "bg_url": "http:\/\/aom.com\/images\/default-certificate.png",
    "height": 780,
    "width": 1075,
    "fields": [
        {
            "key": "course_name",
            "value": "Course Name",
            "font_size": "20",
            "align_center": false,
            "font_family": "Arial",
            "font_color": "#222",
            "top": 432,
            "left": 469,
            "width": 200,
            "height": 40,
            "show_tools": false
        },
        {
            "key": "student_first_name",
            "value": "Student First Name",
            "font_size": "20",
            "align_center": false,
            "font_family": "Arial",
            "font_color": "#222",
            "top": 332,
            "left": 452,
            "width": 200,
            "height": 40,
            "show_tools": false
        }
    ]
};

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

Example response (200):


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

Request   

PUT api/certificate_template/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

ID of the certificate template Example: 2

Body Parameters

name   string   

Name of the certificate template. Example: Updated-Completion-Certificate

bg_url   string  optional  

Background for the certificate template. Example: http://aom.com/images/default-certificate.png

height   integer   

Height size for the certificate template. Example: 780

width   integer   

Width size for the certificate template. Example: 1075

fields   string[]  optional  

All the certificate fields user have added to appear in certificate template(student name, instructor name, course name, etc).

Delete Certificate Template

To delete a certificate template, you need to use this request. Returns number of certificate template deleted(if multiple selected) and also not deleted. (See Response)

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,
        12,
        15
    ]
}"
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,
        12,
        15
    ]
};

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

Example response (200):


{
    "message": "2 template(s) deleted 1 template(s) not deleted as it is used in course. Please remove the template(s) from the course and try again."
}
 

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[]   

All certificate template IDs which needs to be deleted.

Discount Coupons

A Coupon is used by the students 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 in paginated mode. You can apply filter using 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%7D&search_param=%7B%22code%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/coupons/tabularlist"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"code":""}",
};
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 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: {"code":""}

Coupon Lookup

Retrieves all the coupons. Helps while showing coupons in form elements like dropdown. You can apply filters using search_term(coupons) parameter. (See Parameter)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/coupons/lookup?search_term=aut" \
    --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": "aut",
};
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   

You need to provide coupons or substring of the coupons to search. Example: aut

Coupon Types Lookup

Retrieves all types 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

To create a coupon, you need to use this request. (See parameters) Created coupons can be used by the students to get some discount while purchasing the course.

Returns : id of the coupon created and successfull message

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\",
    \"notes\": \"Discount upto 75%\",
    \"value\": \"1500\",
    \"type\": \"percent_amount\",
    \"usage_limit\": 1200,
    \"expiry\": \"2020-08-26\",
    \"allowed_emails\": \"null\"
}"
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",
    "notes": "Discount upto 75%",
    "value": "1500",
    "type": "percent_amount",
    "usage_limit": 1200,
    "expiry": "2020-08-26",
    "allowed_emails": "null"
};

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

notes   string  optional  

Notes for the coupon. Example: Discount upto 75%

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

usage_limit   integer  optional  

How many times this coupon can be used?. Example: 1200

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

Retrieve Coupon

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

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/coupon/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/coupon/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):


{
    "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}

URL Parameters

id   string   

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

Update Coupon

Updates the details of a specified coupon. (See parameters) Coupons can be used by the students to get some discount while purchasing the course.

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 "{
    \"code\": \"code75\",
    \"notes\": \"Discount upto 75%\",
    \"value\": \"1500\",
    \"type\": \"percent_amount\",
    \"usage_limit\": 2000,
    \"expiry\": \"2020-08-26\",
    \"allowed_emails\": \"null\"
}"
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 = {
    "code": "code75",
    "notes": "Discount upto 75%",
    "value": "1500",
    "type": "percent_amount",
    "usage_limit": 2000,
    "expiry": "2020-08-26",
    "allowed_emails": "null"
};

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

Example response (200):


{
    "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   

ID of the coupon. Example: 1

Body Parameters

code   string   

code for the coupon. Example: code75

notes   string  optional  

Notes for the coupon. Example: Discount upto 75%

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

usage_limit   integer  optional  

How many times this coupon can be used?. Example: 2000

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

Delete Coupon

To delete a coupon, you need to use this request. Returns number of coupons deleted(if multiple selected) and also not deleted. (See Response)

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,
        12,
        15
    ]
}"
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,
        12,
        15
    ]
};

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

Example response (200):


{
    "message": "2 coupon(s) deleted 1 coupon(s) not deleted as they are associated with orders"
}
 

Request   

POST api/coupon/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string[]   

All coupon IDs which needs to be deleted.

Discussions

A Discussion module is used as course content and a platform where students can have discussions. Helps to perform CRUD operation to and for discussion modules.

Discussion modules Tabular List

Returns all the discussion 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/discussion?page_size=50&page_number=tenetur&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/discussion"
);

const params = {
    "page_size": "50",
    "page_number": "tenetur",
    "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": 13,
            "name": "First-discussion",
            "slug": "first-discussion",
            "type": "discussion",
            "totalPoints": 20,
            "icon": "<i class=\"el-icon-chat-line-round\"></i>",
            "author": "Aom Staff",
            "created_at": "Aug 11, 2020 05:25 AM"
        }
    ]
}
 

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 the items you want for a page. Example: 50

page_number   string   

Current page number in pagination. Example: tenetur

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 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\": 3
}"
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": 3
};

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

Example response (200):


{
    "id": 13,
    "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 students 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: 3

Update Discussion Module

Update the details of specified discussion module. (See Response) Discussion modules can be used in the course as course content/lesson.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/modules/discussion/{id}" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"name\": \"First-discussion\",
    \"content\": \"An updatedbrief description\",
    \"should_be_evaluated\": true,
    \"totalPoints\": 20,
    \"minComments\": 5
}"
const url = new URL(
    "https://demo.aomlms.com/api/modules/discussion/{id}"
);

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

let body = {
    "name": "First-discussion",
    "content": "An updatedbrief description",
    "should_be_evaluated": true,
    "totalPoints": 20,
    "minComments": 5
};

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}

Body Parameters

name   string   

Name of the discussion module. Example: First-discussion

content   string   

Content for the discussion modules that students will see. Example: An updatedbrief 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

Retrieve Discussion modules

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

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

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",
    "totalPoints": 20,
    "should_be_evaluated": true,
    "minComments": 3
}
 

Request   

GET 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 you want to fetch the details of. Example: 13

Retrieve Detailed Discussion Module Info

Retrieves details of discussion module in depth as well as different modules details that are being used as course content for the same course the current discussion module is attached to. Returns related fields value. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/discussion/details?registrationId=1&moduleId=13" \
    --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 params = {
    "registrationId": "1",
    "moduleId": "13",
};
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": "First-discussion",
    "slug": "first-discussion",
    "content": "A Brief Description",
    "courseName": "course 1",
    "courseSlug": "http://localhost:8000/course/course-1",
    "url": null,
    "totalPoints": 20,
    "shouldBeEvaluated": true,
    "min_time_spent": 0,
    "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": "11 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": "9 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": "2 hours ago",
            "total_time_spent": {
                "hours": 0,
                "minutes": 0,
                "seconds": 0,
                "totalSeconds": null
            },
            "completion_percentage": 100,
            "no_of_times_accessed": 2
        },
        {
            "module_id": 12,
            "name": "New-Webinar",
            "slug": "new-webinar",
            "type": "webinar",
            "icon": "<i class=\"el-icon-date\"></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": 13,
            "name": "First-discussion",
            "slug": "first-discussion",
            "type": "discussion",
            "icon": "<i class=\"el-icon-chat-line-round\"></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
        }
    ],
    "launchCheck": {
        "canbeLaunched": true,
        "errTitle": "",
        "errDesc": ""
    },
    "prevSlug": "new-webinar",
    "nextSlug": "",
    "currentUserId": 3,
    "currentStudentAvatar": "<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=\"#4CAF50\" /><text x=\"20\" y=\"20\" font-size=\"14\" fill=\"#FFFFFF\" alignment-baseline=\"middle\" text-anchor=\"middle\" dominant-baseline=\"central\">DS</text></svg>",
    "currentUserName": "Demo Student",
    "status": "In Progress",
    "statusRowId": 6,
    "timeSpent": null
}
 

Request   

GET api/module/discussion/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 discussion module. Example: 13

Retrieve Comments

Retrieves the comments posted by students in the disussion. Helps in showing all the comments student have posted in the specified discussion in one place. (See Response) You can apply filters using search_param via nameOrEmail(student email or name) and registrationId(student course registration id)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/discussion/loadComments?page_size=50&page_number=expedita&order_by=%7B%22colName%22%3A%22created_at%22%2C+%22direction%22%3A+%22desc%22%7D%7D&search_param=%7B%22nameOrEmail%22%3A%22%22%2C%22registrationId%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/module/discussion/loadComments"
);

const params = {
    "page_size": "50",
    "page_number": "expedita",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"nameOrEmail":"","registrationId":""}",
};
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: expedita

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: {"nameOrEmail":"","registrationId":""}

Post Comment

Posts a comment in a discussion. Updates the status of discussion to submitted if student has posted minimum numner of posts for the discussion per user.. (See Parameters)

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\": 4,
    \"currentUserId\": 1,
    \"comment\": \"My first comment\",
    \"parentId\": 4
}"
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": 4,
    "currentUserId": 1,
    "comment": "My first comment",
    "parentId": 4
};

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

Example response (200):


{
    "status": "In Progress",
    "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   integer   

ID of the ModuleStatus Row belongs to current discussion module. Example: 4

currentUserId   integer   

ID of the user who commented. Example: 1

comment   string   

Comment posted by the user for current discussion. Example: My first comment

parentId   integer  optional  

Parent ID of the discussion. Example: Example: 4

Retrieve Discussion Submission Details

Retrieves the submission details of the duscussion the student have taken participation. Helps to get discussion and its submission in one place. (See Response)

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/discussion/submissions?statusRowId=7" \
    --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": "7",
};
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": "First-discussion",
    "status": "In Progress",
    "content": "A Brief Description",
    "totalPoints": 20,
    "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",
    "comments": [
        {
            "id": 1,
            "comment": "My first comment",
            "date": "Aug 11, 2020 05:56 AM"
        }
    ],
    "replies": []
}
 

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

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 "{
    \"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 = {
    "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

statusRowId   required  optional  

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

evaluation   required  optional  

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

GET api/module/discussion/comments

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/module/discussion/comments" \
    --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 headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 300
x-ratelimit-remaining: 277
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

GET api/module/discussion/comments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

POST api/module/discussion/deleteComments

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}"
const url = new URL(
    "https://demo.aomlms.com/api/module/discussion/deleteComments"
);

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

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

Request   

POST api/module/discussion/deleteComments

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

ECommerce

Endpoints for managing ecommerce settings. Getting and setting items status and values for the platform and the products.

Retrieve Ecommerce Global Product Settings

Retrieves the details of Ecommerce Global Product Settings. (See parameters)

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}" \
    --data "{
    \"freeProductCta\": \"Enroll Now\",
    \"simpleProductCta\": \"Add to Cart\",
    \"subscriptionProductCta\": \"Subscribe\"
}"
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"
};

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

Example response (200):


{
    "message": "Settings Updated"
}
 

Request   

GET api/settings/ecommerce/global

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

freeProductCta   string  optional  

The call to action name for free product. Example: Enroll Now

simpleProductCta   string  optional  

The call to action name for simple product. Example: Add to Cart

subscriptionProductCta   string  optional  

The call to action name for subscription product. Example: Subscribe

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",
    "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",
    "PW": "Belau",
    "BZ": "Belize",
    "BJ": "Benin",
    "BM": "Bermuda",
    "BT": "Bhutan",
    "BO": "Bolivia",
    "BQ": "Bonaire, Saint Eustatius and Saba",
    "BA": "Bosnia and Herzegovina",
    "BW": "Botswana",
    "BV": "Bouvet Island",
    "BR": "Brazil",
    "IO": "British Indian Ocean Territory",
    "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 (Brazzaville)",
    "CD": "Congo (Kinshasa)",
    "CK": "Cook Islands",
    "CR": "Costa Rica",
    "HR": "Croatia",
    "CU": "Cuba",
    "CW": "Cura&ccedil;ao",
    "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",
    "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",
    "HN": "Honduras",
    "HK": "Hong Kong",
    "HU": "Hungary",
    "IS": "Iceland",
    "IN": "India",
    "ID": "Indonesia",
    "IR": "Iran",
    "IQ": "Iraq",
    "IE": "Ireland",
    "IM": "Isle of Man",
    "IL": "Israel",
    "IT": "Italy",
    "CI": "Ivory Coast",
    "JM": "Jamaica",
    "JP": "Japan",
    "JE": "Jersey",
    "JO": "Jordan",
    "KZ": "Kazakhstan",
    "KE": "Kenya",
    "KI": "Kiribati",
    "KW": "Kuwait",
    "KG": "Kyrgyzstan",
    "LA": "Laos",
    "LV": "Latvia",
    "LB": "Lebanon",
    "LS": "Lesotho",
    "LR": "Liberia",
    "LY": "Libya",
    "LI": "Liechtenstein",
    "LT": "Lithuania",
    "LU": "Luxembourg",
    "MO": "Macao",
    "MK": "North Macedonia",
    "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",
    "MD": "Moldova",
    "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",
    "KP": "North Korea",
    "NO": "Norway",
    "OM": "Oman",
    "PK": "Pakistan",
    "PS": "Palestinian Territory",
    "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": "Russia",
    "RW": "Rwanda",
    "BL": "Saint Barth&eacute;lemy",
    "SH": "Saint Helena",
    "KN": "Saint Kitts and Nevis",
    "LC": "Saint Lucia",
    "MF": "Saint Martin (French part)",
    "SX": "Saint Martin (Dutch part)",
    "PM": "Saint Pierre and Miquelon",
    "VC": "Saint Vincent and the Grenadines",
    "SM": "San Marino",
    "ST": "S&atilde;o Tom&eacute; and Pr&iacute;ncipe",
    "SA": "Saudi Arabia",
    "SN": "Senegal",
    "RS": "Serbia",
    "SC": "Seychelles",
    "SL": "Sierra Leone",
    "SG": "Singapore",
    "SK": "Slovakia",
    "SI": "Slovenia",
    "SB": "Solomon Islands",
    "SO": "Somalia",
    "ZA": "South Africa",
    "GS": "South Georgia/Sandwich Islands",
    "KR": "South Korea",
    "SS": "South Sudan",
    "ES": "Spain",
    "LK": "Sri Lanka",
    "SD": "Sudan",
    "SR": "Suriname",
    "SJ": "Svalbard and Jan Mayen",
    "SZ": "Swaziland",
    "SE": "Sweden",
    "CH": "Switzerland",
    "SY": "Syria",
    "TW": "Taiwan",
    "TJ": "Tajikistan",
    "TZ": "Tanzania",
    "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 (US) Minor Outlying Islands",
    "UY": "Uruguay",
    "UZ": "Uzbekistan",
    "VU": "Vanuatu",
    "VA": "Vatican",
    "VE": "Venezuela",
    "VN": "Vietnam",
    "VG": "Virgin Islands (British)",
    "VI": "Virgin Islands (US)",
    "WF": "Wallis and Futuna",
    "EH": "Western Sahara",
    "WS": "Samoa",
    "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 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):


{
    "AP": "Andhra Pradesh",
    "AR": "Arunachal Pradesh",
    "AS": "Assam",
    "BR": "Bihar",
    "CT": "Chhattisgarh",
    "GA": "Goa",
    "GJ": "Gujarat",
    "HR": "Haryana",
    "HP": "Himachal Pradesh",
    "JK": "Jammu and Kashmir",
    "JH": "Jharkhand",
    "KA": "Karnataka",
    "KL": "Kerala",
    "MP": "Madhya Pradesh",
    "MH": "Maharashtra",
    "MN": "Manipur",
    "ML": "Meghalaya",
    "MZ": "Mizoram",
    "NL": "Nagaland",
    "OR": "Orissa",
    "PB": "Punjab",
    "RJ": "Rajasthan",
    "SK": "Sikkim",
    "TN": "Tamil Nadu",
    "TS": "Telangana",
    "TR": "Tripura",
    "UK": "Uttarakhand",
    "UP": "Uttar Pradesh",
    "WB": "West Bengal",
    "AN": "Andaman and Nicobar Islands",
    "CH": "Chandigarh",
    "DN": "Dadra and Nagar Haveli",
    "DD": "Daman and Diu",
    "DL": "Delhi",
    "LD": "Lakshadeep",
    "PY": "Pondicherry (Puducherry)"
}
 

Request   

GET api/states/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

countryCode   string   

Country code of which you need state details(like IN, US, etc). Example: IN

Currency Lookup

Retrieves all the currencies in list format. Helps while showing states in form elements like dropdown.

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


{
    "AED": {
        "display_name": "United Arab Emirates dirham",
        "symbol": "&#x62f;.&#x625;"
    },
    "AFN": {
        "display_name": "Afghan afghani",
        "symbol": "&#x60b;"
    },
    "ALL": {
        "display_name": "Albanian lek",
        "symbol": "L"
    },
    "AMD": {
        "display_name": "Armenian dram",
        "symbol": "AMD"
    },
    "ANG": {
        "display_name": "Netherlands Antillean guilder",
        "symbol": "&fnof;"
    },
    "AOA": {
        "display_name": "Angolan kwanza",
        "symbol": "Kz"
    },
    "ARS": {
        "display_name": "Argentine peso",
        "symbol": "&#36;"
    },
    "AUD": {
        "display_name": "Australian dollar",
        "symbol": "&#36;"
    },
    "AWG": {
        "display_name": "Aruban florin",
        "symbol": "Afl."
    },
    "AZN": {
        "display_name": "Azerbaijani manat",
        "symbol": "AZN"
    },
    "BAM": {
        "display_name": "Bosnia and Herzegovina convertible mark",
        "symbol": "KM"
    },
    "BBD": {
        "display_name": "Barbadian dollar",
        "symbol": "&#36;"
    },
    "BDT": {
        "display_name": "Bangladeshi taka",
        "symbol": "&#2547;&nbsp;"
    },
    "BGN": {
        "display_name": "Bulgarian lev",
        "symbol": "&#1083;&#1074;."
    },
    "BHD": {
        "display_name": "Bahraini dinar",
        "symbol": ".&#x62f;.&#x628;"
    },
    "BIF": {
        "display_name": "Burundian franc",
        "symbol": "Fr"
    },
    "BMD": {
        "display_name": "Bermudian dollar",
        "symbol": "&#36;"
    },
    "BND": {
        "display_name": "Brunei dollar",
        "symbol": "&#36;"
    },
    "BOB": {
        "display_name": "Bolivian boliviano",
        "symbol": "Bs."
    },
    "BRL": {
        "display_name": "Brazilian real",
        "symbol": "&#82;&#36;"
    },
    "BSD": {
        "display_name": "Bahamian dollar",
        "symbol": "&#36;"
    },
    "BTC": {
        "display_name": "Bitcoin",
        "symbol": "&#3647;"
    },
    "BTN": {
        "display_name": "Bhutanese ngultrum",
        "symbol": "Nu."
    },
    "BWP": {
        "display_name": "Botswana pula",
        "symbol": "P"
    },
    "BYR": {
        "display_name": "Belarusian ruble (old)",
        "symbol": "Br"
    },
    "BYN": {
        "display_name": "Belarusian ruble",
        "symbol": "Br"
    },
    "BZD": {
        "display_name": "Belize dollar",
        "symbol": "&#36;"
    },
    "CAD": {
        "display_name": "Canadian dollar",
        "symbol": "&#36;"
    },
    "CDF": {
        "display_name": "Congolese franc",
        "symbol": "Fr"
    },
    "CHF": {
        "display_name": "Swiss franc",
        "symbol": "&#67;&#72;&#70;"
    },
    "CLP": {
        "display_name": "Chilean peso",
        "symbol": "&#36;"
    },
    "CNY": {
        "display_name": "Chinese yuan",
        "symbol": "&yen;"
    },
    "COP": {
        "display_name": "Colombian peso",
        "symbol": "&#36;"
    },
    "CRC": {
        "display_name": "Costa Rican col&oacute;n",
        "symbol": "&#x20a1;"
    },
    "CUC": {
        "display_name": "Cuban convertible peso",
        "symbol": "&#36;"
    },
    "CUP": {
        "display_name": "Cuban peso",
        "symbol": "&#36;"
    },
    "CVE": {
        "display_name": "Cape Verdean escudo",
        "symbol": "&#36;"
    },
    "CZK": {
        "display_name": "Czech koruna",
        "symbol": "&#75;&#269;"
    },
    "DJF": {
        "display_name": "Djiboutian franc",
        "symbol": "Fr"
    },
    "DKK": {
        "display_name": "Danish krone",
        "symbol": "DKK"
    },
    "DOP": {
        "display_name": "Dominican peso",
        "symbol": "RD&#36;"
    },
    "DZD": {
        "display_name": "Algerian dinar",
        "symbol": "&#x62f;.&#x62c;"
    },
    "EGP": {
        "display_name": "Egyptian pound",
        "symbol": "EGP"
    },
    "ERN": {
        "display_name": "Eritrean nakfa",
        "symbol": "Nfk"
    },
    "ETB": {
        "display_name": "Ethiopian birr",
        "symbol": "Br"
    },
    "EUR": {
        "display_name": "Euro",
        "symbol": "&euro;"
    },
    "FJD": {
        "display_name": "Fijian dollar",
        "symbol": "&#36;"
    },
    "FKP": {
        "display_name": "Falkland Islands pound",
        "symbol": "&pound;"
    },
    "GBP": {
        "display_name": "Pound sterling",
        "symbol": "&pound;"
    },
    "GEL": {
        "display_name": "Georgian lari",
        "symbol": "&#x20be;"
    },
    "GGP": {
        "display_name": "Guernsey pound",
        "symbol": "&pound;"
    },
    "GHS": {
        "display_name": "Ghana cedi",
        "symbol": "&#x20b5;"
    },
    "GIP": {
        "display_name": "Gibraltar pound",
        "symbol": "&pound;"
    },
    "GMD": {
        "display_name": "Gambian dalasi",
        "symbol": "D"
    },
    "GNF": {
        "display_name": "Guinean franc",
        "symbol": "Fr"
    },
    "GTQ": {
        "display_name": "Guatemalan quetzal",
        "symbol": "Q"
    },
    "GYD": {
        "display_name": "Guyanese dollar",
        "symbol": "&#36;"
    },
    "HKD": {
        "display_name": "Hong Kong dollar",
        "symbol": "&#36;"
    },
    "HNL": {
        "display_name": "Honduran lempira",
        "symbol": "L"
    },
    "HRK": {
        "display_name": "Croatian kuna",
        "symbol": "kn"
    },
    "HTG": {
        "display_name": "Haitian gourde",
        "symbol": "G"
    },
    "HUF": {
        "display_name": "Hungarian forint",
        "symbol": "&#70;&#116;"
    },
    "IDR": {
        "display_name": "Indonesian rupiah",
        "symbol": "Rp"
    },
    "ILS": {
        "display_name": "Israeli new shekel",
        "symbol": "&#8362;"
    },
    "IMP": {
        "display_name": "Manx pound",
        "symbol": "&pound;"
    },
    "INR": {
        "display_name": "Indian rupee",
        "symbol": "&#8377;"
    },
    "IQD": {
        "display_name": "Iraqi dinar",
        "symbol": "&#x639;.&#x62f;"
    },
    "IRR": {
        "display_name": "Iranian rial",
        "symbol": "&#xfdfc;"
    },
    "IRT": {
        "display_name": "Iranian toman",
        "symbol": "&#x062A;&#x0648;&#x0645;&#x0627;&#x0646;"
    },
    "ISK": {
        "display_name": "Icelandic kr&oacute;na",
        "symbol": "kr."
    },
    "JEP": {
        "display_name": "Jersey pound",
        "symbol": "&pound;"
    },
    "JMD": {
        "display_name": "Jamaican dollar",
        "symbol": "&#36;"
    },
    "JOD": {
        "display_name": "Jordanian dinar",
        "symbol": "&#x62f;.&#x627;"
    },
    "JPY": {
        "display_name": "Japanese yen",
        "symbol": "&yen;"
    },
    "KES": {
        "display_name": "Kenyan shilling",
        "symbol": "KSh"
    },
    "KGS": {
        "display_name": "Kyrgyzstani som",
        "symbol": "&#x441;&#x43e;&#x43c;"
    },
    "KHR": {
        "display_name": "Cambodian riel",
        "symbol": "&#x17db;"
    },
    "KMF": {
        "display_name": "Comorian franc",
        "symbol": "Fr"
    },
    "KPW": {
        "display_name": "North Korean won",
        "symbol": "&#x20a9;"
    },
    "KRW": {
        "display_name": "South Korean won",
        "symbol": "&#8361;"
    },
    "KWD": {
        "display_name": "Kuwaiti dinar",
        "symbol": "&#x62f;.&#x643;"
    },
    "KYD": {
        "display_name": "Cayman Islands dollar",
        "symbol": "&#36;"
    },
    "KZT": {
        "display_name": "Kazakhstani tenge",
        "symbol": "KZT"
    },
    "LAK": {
        "display_name": "Lao kip",
        "symbol": "&#8365;"
    },
    "LBP": {
        "display_name": "Lebanese pound",
        "symbol": "&#x644;.&#x644;"
    },
    "LKR": {
        "display_name": "Sri Lankan rupee",
        "symbol": "&#xdbb;&#xdd4;"
    },
    "LRD": {
        "display_name": "Liberian dollar",
        "symbol": "&#36;"
    },
    "LSL": {
        "display_name": "Lesotho loti",
        "symbol": "L"
    },
    "LYD": {
        "display_name": "Libyan dinar",
        "symbol": "&#x644;.&#x62f;"
    },
    "MAD": {
        "display_name": "Moroccan dirham",
        "symbol": "&#x62f;.&#x645;."
    },
    "MDL": {
        "display_name": "Moldovan leu",
        "symbol": "MDL"
    },
    "MGA": {
        "display_name": "Malagasy ariary",
        "symbol": "Ar"
    },
    "MKD": {
        "display_name": "Macedonian denar",
        "symbol": "&#x434;&#x435;&#x43d;"
    },
    "MMK": {
        "display_name": "Burmese kyat",
        "symbol": "Ks"
    },
    "MNT": {
        "display_name": "Mongolian t&ouml;gr&ouml;g",
        "symbol": "&#x20ae;"
    },
    "MOP": {
        "display_name": "Macanese pataca",
        "symbol": "P"
    },
    "MRU": {
        "display_name": "Mauritanian ouguiya",
        "symbol": "UM"
    },
    "MUR": {
        "display_name": "Mauritian rupee",
        "symbol": "&#x20a8;"
    },
    "MVR": {
        "display_name": "Maldivian rufiyaa",
        "symbol": ".&#x783;"
    },
    "MWK": {
        "display_name": "Malawian kwacha",
        "symbol": "MK"
    },
    "MXN": {
        "display_name": "Mexican peso",
        "symbol": "&#36;"
    },
    "MYR": {
        "display_name": "Malaysian ringgit",
        "symbol": "&#82;&#77;"
    },
    "MZN": {
        "display_name": "Mozambican metical",
        "symbol": "MT"
    },
    "NAD": {
        "display_name": "Namibian dollar",
        "symbol": "N&#36;"
    },
    "NGN": {
        "display_name": "Nigerian naira",
        "symbol": "&#8358;"
    },
    "NIO": {
        "display_name": "Nicaraguan c&oacute;rdoba",
        "symbol": "C&#36;"
    },
    "NOK": {
        "display_name": "Norwegian krone",
        "symbol": "&#107;&#114;"
    },
    "NPR": {
        "display_name": "Nepalese rupee",
        "symbol": "&#8360;"
    },
    "NZD": {
        "display_name": "New Zealand dollar",
        "symbol": "&#36;"
    },
    "OMR": {
        "display_name": "Omani rial",
        "symbol": "&#x631;.&#x639;."
    },
    "PAB": {
        "display_name": "Panamanian balboa",
        "symbol": "B/."
    },
    "PEN": {
        "display_name": "Sol",
        "symbol": "S/"
    },
    "PGK": {
        "display_name": "Papua New Guinean kina",
        "symbol": "K"
    },
    "PHP": {
        "display_name": "Philippine peso",
        "symbol": "&#8369;"
    },
    "PKR": {
        "display_name": "Pakistani rupee",
        "symbol": "&#8360;"
    },
    "PLN": {
        "display_name": "Polish z&#x142;oty",
        "symbol": "&#122;&#322;"
    },
    "PRB": {
        "display_name": "Transnistrian ruble",
        "symbol": "&#x440;."
    },
    "PYG": {
        "display_name": "Paraguayan guaran&iacute;",
        "symbol": "&#8370;"
    },
    "QAR": {
        "display_name": "Qatari riyal",
        "symbol": "&#x631;.&#x642;"
    },
    "RON": {
        "display_name": "Romanian leu",
        "symbol": "lei"
    },
    "RSD": {
        "display_name": "Serbian dinar",
        "symbol": "&#x434;&#x438;&#x43d;."
    },
    "RUB": {
        "display_name": "Russian ruble",
        "symbol": "&#8381;"
    },
    "RWF": {
        "display_name": "Rwandan franc",
        "symbol": "Fr"
    },
    "SAR": {
        "display_name": "Saudi riyal",
        "symbol": "&#x631;.&#x633;"
    },
    "SBD": {
        "display_name": "Solomon Islands dollar",
        "symbol": "&#36;"
    },
    "SCR": {
        "display_name": "Seychellois rupee",
        "symbol": "&#x20a8;"
    },
    "SDG": {
        "display_name": "Sudanese pound",
        "symbol": "&#x62c;.&#x633;."
    },
    "SEK": {
        "display_name": "Swedish krona",
        "symbol": "&#107;&#114;"
    },
    "SGD": {
        "display_name": "Singapore dollar",
        "symbol": "&#36;"
    },
    "SHP": {
        "display_name": "Saint Helena pound",
        "symbol": "&pound;"
    },
    "SLL": {
        "display_name": "Sierra Leonean leone",
        "symbol": "Le"
    },
    "SOS": {
        "display_name": "Somali shilling",
        "symbol": "Sh"
    },
    "SRD": {
        "display_name": "Surinamese dollar",
        "symbol": "&#36;"
    },
    "SSP": {
        "display_name": "South Sudanese pound",
        "symbol": "&pound;"
    },
    "STN": {
        "display_name": "S&atilde;o Tom&eacute; and Pr&iacute;ncipe dobra",
        "symbol": "Db"
    },
    "SYP": {
        "display_name": "Syrian pound",
        "symbol": "&#x644;.&#x633;"
    },
    "SZL": {
        "display_name": "Swazi lilangeni",
        "symbol": "L"
    },
    "THB": {
        "display_name": "Thai baht",
        "symbol": "&#3647;"
    },
    "TJS": {
        "display_name": "Tajikistani somoni",
        "symbol": "&#x405;&#x41c;"
    },
    "TMT": {
        "display_name": "Turkmenistan manat",
        "symbol": "m"
    },
    "TND": {
        "display_name": "Tunisian dinar",
        "symbol": "&#x62f;.&#x62a;"
    },
    "TOP": {
        "display_name": "Tongan pa&#x2bb;anga",
        "symbol": "T&#36;"
    },
    "TRY": {
        "display_name": "Turkish lira",
        "symbol": "&#8378;"
    },
    "TTD": {
        "display_name": "Trinidad and Tobago dollar",
        "symbol": "&#36;"
    },
    "TWD": {
        "display_name": "New Taiwan dollar",
        "symbol": "&#78;&#84;&#36;"
    },
    "TZS": {
        "display_name": "Tanzanian shilling",
        "symbol": "Sh"
    },
    "UAH": {
        "display_name": "Ukrainian hryvnia",
        "symbol": "&#8372;"
    },
    "UGX": {
        "display_name": "Ugandan shilling",
        "symbol": "UGX"
    },
    "USD": {
        "display_name": "United States (US) dollar",
        "symbol": "&#36;"
    },
    "UYU": {
        "display_name": "Uruguayan peso",
        "symbol": "&#36;"
    },
    "UZS": {
        "display_name": "Uzbekistani som",
        "symbol": "UZS"
    },
    "VEF": {
        "display_name": "Venezuelan bol&iacute;var",
        "symbol": "Bs F"
    },
    "VES": {
        "display_name": "Bol&iacute;var soberano",
        "symbol": "Bs.S"
    },
    "VND": {
        "display_name": "Vietnamese &#x111;&#x1ed3;ng",
        "symbol": "&#8363;"
    },
    "VUV": {
        "display_name": "Vanuatu vatu",
        "symbol": "Vt"
    },
    "WST": {
        "display_name": "Samoan t&#x101;l&#x101;",
        "symbol": "T"
    },
    "XAF": {
        "display_name": "Central African CFA franc",
        "symbol": "CFA"
    },
    "XCD": {
        "display_name": "East Caribbean dollar",
        "symbol": "&#36;"
    },
    "XOF": {
        "display_name": "West African CFA franc",
        "symbol": "CFA"
    },
    "XPF": {
        "display_name": "CFP franc",
        "symbol": "Fr"
    },
    "YER": {
        "display_name": "Yemeni rial",
        "symbol": "&#xfdfc;"
    },
    "ZAR": {
        "display_name": "South African rand",
        "symbol": "&#82;"
    },
    "ZMW": {
        "display_name": "Zambian kwacha",
        "symbol": "ZK"
    }
}
 

Request   

GET api/currency/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieve General Ecommerce Settings

Retrieves the details of 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": "",
    "country": "US",
    "state": "",
    "city": "New Jersey",
    "zipcode": "08053",
    "selling_location": "all_countries",
    "some_countries_excluded": "",
    "some_countries": "",
    "enableTaxes": "no",
    "enableCoupons": "no",
    "currency": "USD"
}
 

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\": \"aut\",
    \"city\": \"New Jersey\",
    \"state\": \"aut\",
    \"country\": \"country\",
    \"currency\": \"USD\",
    \"enableCoupons\": \"no\",
    \"enableTaxes\": \"no\",
    \"zipcode\": \"08053\",
    \"selling_location\": \"all_countries\"
}"
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": "aut",
    "city": "New Jersey",
    "state": "aut",
    "country": "country",
    "currency": "USD",
    "enableCoupons": "no",
    "enableTaxes": "no",
    "zipcode": "08053",
    "selling_location": "all_countries"
};

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 line1 of user. Example: 1234 Lorem Ipsum Drive

addressLine2   string  optional  

Address line2 of user. Example: Example: aut

city   string   

City of the user. Example: New Jersey

state   string   

State of the user. Example: Example: aut

country   string   

Country of the user. Example: country

currency   string   

Currency of the user's country. Example: USD

enableCoupons   string   

If yes, coupons gets enabled for users. Example: no

enableTaxes   string   

If yes, taxes gets enabled for users. Example: no

zipcode   string   

Zipcode of the location of users. Example: 08053

selling_location   string  optional  

Selling location. Example: all_countries

GET api/settings/ecommerce/isProductionModeEnabled

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

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

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 300
x-ratelimit-remaining: 268
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

GET api/settings/ecommerce/isProductionModeEnabled

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

GET api/settings/ecommerce/invoice

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 (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 300
x-ratelimit-remaining: 267
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

GET api/settings/ecommerce/invoice

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

PUT api/settings/ecommerce/invoice

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}"
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: "PUT",
    headers,
}).then(response => response.json());

Request   

PUT api/settings/ecommerce/invoice

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Updates General Ecommerce Global Product Settings

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][linkUrl]\": \"\\\"https:\\/\\/example.com\\\"\",
    \"productPriceColor[content][linkOpen]\": \"\\\"_blank\\\"\",
    \"productPriceColor[content][backgroundColor]\": \"\\\"#469F13\\\"\"
}"
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][linkUrl]": "\"https:\/\/example.com\"",
    "productPriceColor[content][linkOpen]": "\"_blank\"",
    "productPriceColor[content][backgroundColor]": "\"#469F13\""
};

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  optional  

The call to action name for free product. Example: Enroll Now

simpleProductCta   string  optional  

The call to action name for simple product. Example: Add to Cart

subscriptionProductCta   string  optional  

The call to action name for subscription product. Example: Subscribe

productPriceColor[content][linkUrl]   string  optional  

The URL associated with the product price link. Example: "https://example.com"

productPriceColor[content][linkOpen]   string  optional  

The target attribute for the product price link. Example: "_blank"

productPriceColor[content][backgroundColor]   string  optional  

The background color for the product price. Example: "#469F13"

Retrieves Shop Base Currency

Retrieves the 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):


{
    "display_name": "United States (US) dollar",
    "symbol": "&#36;"
}
 

Request   

GET api/get-shop-base-currency

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

ECommerce Orders

An ECommerce Order is made by the students when they purchase a product hence course. It helps in managing orders and performing CRUD operation on orders.

Order Tabular List

Returns all the orders in a tabular list format in paginated mode. You can apply filter using search_param via user(purchased by) and status(status of the order).

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/orders/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%22user%22%3A%5B%5D%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/orders/tabularlist"
);

const params = {
    "page_size": "50",
    "page_number": "1",
    "order_by": "{"colName":"created_at", "direction": "desc"}}",
    "search_param": "{"user":[],"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):


{
    "recordsTotal": 1,
    "recordsFiltered": 1,
    "currencySymbol": "&#36;",
    "records": [
        {
            "id": 1,
            "status": "PENDING_PAYMENT",
            "total": "3001.00",
            "isTestOrder": false,
            "customer": "Demo Student",
            "created_at": "Aug 25, 2020 12:00 AM"
        }
    ]
}
 

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 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: {"user":[],"status":[]}

Retrieve/Download Order Invoice

Retrieves the details of a specified order and returns as downloaded pdf file.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/download?orderId=1" \
    --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": "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):


"pdf file"
 

Request   

GET api/order/download

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

orderId   string   

Order Id for which you need Invoice. Example: 1

Export Order

Retrieves all the orders made till date and exports it to excel format for letting users download it as excel file. You can use the response for plotting graphs

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/export?filters=%7B%22dateRange%22%3A%5B%222020-07-31T18%3A30%3A00.000Z%22%2C%222020-08-30T18%3A30%3A00.000Z%22%5D%2C%22users%22%3A%5B3%5D%2C%22coupons%22%3A%5B%5D%2C%22products%22%3A%5B1%5D%2C%22status%22%3A%5B%22PENDING_PAYMENT%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/order/export"
);

const params = {
    "filters": "{"dateRange":["2020-07-31T18:30:00.000Z","2020-08-30T18:30:00.000Z"],"users":[3],"coupons":[],"products":[1],"status":["PENDING_PAYMENT"]}",
};
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):


"orders-text.xlsx"
 

Request   

GET api/order/export

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

filters   string   

All the filters after which you need order details in a excel file (filters like date-range, product, customer name, payment status, coupon used, etc). Example: {"dateRange":["2020-07-31T18:30:00.000Z","2020-08-30T18:30:00.000Z"],"users":[3],"coupons":[],"products":[1],"status":["PENDING_PAYMENT"]}

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=2019" \
    --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": "2019",
};
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: 2019

Retrieve Monthly Sales

Retrieves the details of monthly based order sales for this year 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=8-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": "8-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": [
        "Aug-01",
        "Aug-02",
        "Aug-03",
        "Aug-04",
        "Aug-05",
        "Aug-06",
        "Aug-07",
        "Aug-08",
        "Aug-09",
        "Aug-10",
        "Aug-11",
        "Aug-12",
        "Aug-13",
        "Aug-14",
        "Aug-15",
        "Aug-16",
        "Aug-17",
        "Aug-18",
        "Aug-19",
        "Aug-20",
        "Aug-21",
        "Aug-22",
        "Aug-23",
        "Aug-24",
        "Aug-25",
        "Aug-26",
        "Aug-27",
        "Aug-28",
        "Aug-29",
        "Aug-30",
        "Aug-31"
    ],
    "totalIncome": [
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        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,
        0,
        0,
        0,
        0,
        0,
        0,
        0,
        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: 8-2020

Retrieve Product Breakdown Sales

Retrieves the details of product break-down based order sales for this year 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=2022-08-21" \
    --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": "2022-08-21",
};
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"
    ],
    "totalIncome": [
        0
    ],
    "totalOrders": [
        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(year-month-date). Example: 2022-08-21

Order Status Lookup

Retrieves all the statuses of the order the platform offers completed, cancelled, failed, etc. Helps 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"
    }
]
 

Request   

GET api/order/status/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Delete Order

To delete a order, you need to use this request. Returns number of orders deleted. (See Response)

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,
        5
    ]
}"
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,
        5
    ]
};

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

Example response (200):


{
    "message": "2 order(s) deleted"
}
 

Request   

POST api/order/delete

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

delete_ids   string[]   

All order IDs which needs to be deleted.

Create Order

To create a order, you need to use this request. (See parameters) Created order can be used as purchasing product by students.

Returns : id of the order created and successfull message

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\": \"PENDING_PAYMENT\",
    \"customerId\": 3,
    \"billingAddressId\": 3500,
    \"orderItems\": [
        \"amet\"
    ],
    \"orderNotes\": [
        \"dicta\"
    ],
    \"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": "PENDING_PAYMENT",
    "customerId": 3,
    "billingAddressId": 3500,
    "orderItems": [
        "amet"
    ],
    "orderNotes": [
        "dicta"
    ],
    "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: PENDING_PAYMENT

customerId   integer   

Ordered by this user Id. Example: 3

billingAddressId   integer  optional  

Billing 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

Retrieve Order

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

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/order/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/order/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):


{
    "orderDate": "Aug 25, 2020 12:00 AM",
    "status": "PENDING_PAYMENT",
    "customerId": 3,
    "billingAddressId": null,
    "taxAmount": "0.00",
    "otherFee": "0.00",
    "isTestOrder": false,
    "total": "3001.00",
    "sub_total": "3001.00",
    "currency": {
        "display_name": "United States (US) dollar",
        "symbol": "&#36;"
    },
    "shopAddress": {
        "shop_address_1": "1234 Lorem Ipsum Drive",
        "shop_address_2": "",
        "shop_city": "New Jersey",
        "shop_country": "US",
        "shop_state": "",
        "shop_zipcode": "08053",
        "shop_name": "Academy of mine",
        "shop_logo": "http://localhost:8000/images/aom-logo.svg"
    },
    "billingAddress": {
        "id": -1,
        "isDefault": false,
        "fullName": "",
        "addressLine1": "",
        "addressLine2": "",
        "zipcode": "",
        "city": "",
        "state": "",
        "country": ""
    },
    "orderNotes": [
        {
            "id": 1,
            "data": "note-1",
            "type": "PRIVATE",
            "created_on": "Aug 11, 2020 05:36 PM"
        }
    ],
    "orderItems": [
        {
            "product_id": 1,
            "product_title": "Product-1",
            "price": "3001.00",
            "quantity": 1,
            "total": "3001.00"
        }
    ]
}
 

Request   

GET api/order/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

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

Update Order

Updates the details of a specified order. (See parameters) Orders can be used as purchasing products by students.

Example request:
curl --request PUT \
    "https://demo.aomlms.com/api/order/1" \
    --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,
    \"orderItems\": [
        \"minus\"
    ],
    \"orderNotes\": [
        \"et\"
    ],
    \"taxAmount\": \"null\",
    \"otherFee\": \"null\"
}"
const url = new URL(
    "https://demo.aomlms.com/api/order/1"
);

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,
    "orderItems": [
        "minus"
    ],
    "orderNotes": [
        "et"
    ],
    "taxAmount": "null",
    "otherFee": "null"
};

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}

URL Parameters

id   string   

ID of the order. Example: 1

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

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

Update Status of Order

Updates the status of a specified order. (See parameters) Orders can be used as purchasing products by students.

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

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

let body = {
    "status": "COMPLETED"
};

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   

ID of the order. Example: 1

Body Parameters

status   string   

Different status for the orders like pending, completed, failed, etc. Status options: PENDING_PAYMENT, COMPLETED, CANCELLED, REFUNDED or FAILED. Example: COMPLETED

Create Order Notes

To create a order note, you need to use this request. (See parameters) Created order notes can be used as remebering assets for Instructor while creating/editing order.

Returns : id, type and data of the order notes 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\": \"This order is just for testing purpose\",
    \"orderId\": 1,
    \"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": "This order is just for testing purpose",
    "orderId": 1,
    "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"
    },
    {
        "id": 2,
        "data": "New notes",
        "type": "PRIVATE",
        "created_on": "Aug 11, 2020 06:04 PM"
    }
]
 

Request   

POST api/order-note/create

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

data   string   

Actual content of the note. Example: This order is just for testing purpose

orderId   integer   

ID of the order in which this note is being created. Example: 1

type   string   

Type of the note. Type options: Public or Private. Example: PRIVATE

Delete Order Note

To delete a order note, you need to use this request. Returns all order notes left after this note gets deleted. (See Response)

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   

Order Note ID which needs to be deleted. Example: 2

GET api/order/refund/lookup

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 (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 300
x-ratelimit-remaining: 266
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

GET api/order/refund/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

GET api/order/note/type/lookup

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 (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 300
x-ratelimit-remaining: 265
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

GET api/order/note/type/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

GET api/order/refund/type/lookup

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 (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 300
x-ratelimit-remaining: 264
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

GET api/order/refund/type/lookup

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

POST api/order/refund

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}"
const url = new URL(
    "https://demo.aomlms.com/api/order/refund"
);

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

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

Request   

POST api/order/refund

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

GET api/order/refund/{id}

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

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

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

Example response (401):

Show headers
cache-control: no-cache, private
content-type: application/json
x-ratelimit-limit: 300
x-ratelimit-remaining: 263
vary: Origin
 

{
    "message": "Unauthenticated."
}
 

Request   

GET api/order/refund/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

ECommerce Payments

Endpoints for managing ecommerce Payment Gateways. Payment gateways will be used when your users are purchasing products.

Retrieve Payment gateways

Retrieves all payment gateways details supported by the platform. (See Parameters)

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": "/images/stripe-logo.svg",
            "is_enabled": true,
            "support_recurring_payments": false
        },
        {
            "id": 2,
            "name": "Authorize .NET CIM",
            "logo_url": "/images/anet-logo.svg",
            "is_enabled": false,
            "support_recurring_payments": false
        }
    ]
}
 

Request   

GET api/settings/payment-gateway

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update Gateway Status

Updates the payment gateway status(enabled or disabled) to receive payment from students/users.

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\": false
}"
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": false
};

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   

ID of the Payement Gateway. Example: 1

status   boolean   

Whether this payment gateway is enabled or not. Example: false

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\",
    \"livePublishableKey\": \"animi\",
    \"liveSecretKey\": \"reiciendis\"
}"
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",
    "livePublishableKey": "animi",
    "liveSecretKey": "reiciendis"
};

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

livePublishableKey   string  optional  

Live publishable key value. Example: Example: animi

liveSecretKey   string  optional  

Live secret key value. Example: Example: reiciendis

Retrieve Stripe Settings

Retrieves all the settings for Stripe payment gateway. Helps in mainting 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",
    "livePublishableKey": "",
    "liveSecretKey": ""
}
 

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\",
    \"transactionKey\": \"no\",
    \"loginId\": \"in\",
    \"clientId\": \"aut\"
}"
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",
    "transactionKey": "no",
    "loginId": "in",
    "clientId": "aut"
};

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

transactionKey   string  optional  

Transaction key value. Example: no

loginId   string  optional  

Login Id from AuthorizeNet. Example: Example: in

clientId   string  optional  

Client Id from AuthorizeNet. Example: Example: aut

Retrieve AuthorizeNet Settings

Retrieves all the settings for AuthorizeNet payment gateway. Helps in maintaining 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": "",
    "transactionKey": "no",
    "clientId": ""
}
 

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. Setting needs to be updated is mentioned in parameter. (See Parameter)

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\": \"alias\",
    \"publicKey\": \"reprehenderit\",
    \"privateKey\": \"vel\"
}"
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": "alias",
    "publicKey": "reprehenderit",
    "privateKey": "vel"
};

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 stripe 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: alias

publicKey   string  optional  

Public Key value. Example: Example: reprehenderit

privateKey   string  optional  

Private key value. Example: Example: vel

Retrieve Braintree Settings

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": ""
}
 

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": "Pay by PayPal",
    "notificationUrl": "https://staging.aomlms.com/api/webhook/paypal",
    "clientId": "",
    "secretKey": ""
}
 

Request   

GET api/settings/paypal

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Update Paypal

Updates the settings for Paypal payment gateway. Setting needs to be updated is mentioned in parameter. (See Parameter)

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 "{
    \"clientId\": \"abc1234\",
    \"gatewayEnabled\": false,
    \"notificationUrl\": \"https:\\/\\/staging.aomlms.com\\/api\\/webhook\\/paypal\",
    \"paymentTitle\": \"3500\",
    \"secretKey\": \"abc123\"
}"
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 = {
    "clientId": "abc1234",
    "gatewayEnabled": false,
    "notificationUrl": "https:\/\/staging.aomlms.com\/api\/webhook\/paypal",
    "paymentTitle": "3500",
    "secretKey": "abc123"
};

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

clientId   string   

The Client ID of the paypal. Example: abc1234

gatewayEnabled   boolean   

. Example: false

notificationUrl   string  optional  

Notification Url. Example: https://staging.aomlms.com/api/webhook/paypal

paymentTitle   string   

The title of the payment gateway. This controls the title which user sees during checkout. Example: 3500

secretKey   string   

API key. Get your API key using your Paypal account. Example: abc123

Update Invoice Settings

Updates the settings for Invoice payment gateway.

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\",
    \"paymentInstuctions\": \"We will invoice you.\",
    \"paymentRestrictToGroups\": true
}"
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",
    "paymentInstuctions": "We will invoice you.",
    "paymentRestrictToGroups": true
};

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

paymentInstuctions   string  optional  

Payment instructions for the payments. Accepts HTML. Example: We will invoice you.

paymentRestrictToGroups   boolean  optional  

Allow all users to use payment method or restrict to groups only. Example: true

Retrieve Invoice Settings

Retrieves all the settings for Invoice payment gateway. Helps in maintaining the data and enable status of the invoice settings.

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": "We will send an invoice.",
    "paymentRestrictToGroups": true
}
 

Request   

GET api/settings/invoice

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

ECommerce Products

A Product will be reached to your students. Course has to be attached to products so that students 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. (See Parameters) You can apply filter using search_param via title(product title) and categories.

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%7D&search_param=%7B%22title%22%3A%22%22%2C%22categories%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":"","categories":[]}",
};
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": null,
            "displayPrice": "<del>$3500 </del><span>$3001</span>",
            "status": "IN-STOCK",
            "label": "SALE",
            "canBePurchased": true,
            "seo_description": null
        }
    ]
}
 

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 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: {"title":"","categories":[]}

Product Calender

Retrieve classes with specified search parameters.

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/products/calendar-catalog" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}" \
    --data "{
    \"startDate\": \"\\\"2023-12-31T18:30:00.000Z\\\"\",
    \"endDate\": \"\\\"2024-01-30T18:30:00.000Z\\\"\",
    \"search_param\": \"dolor\",
    \"search_param[title]\": \"\\\"Professional Development\\\"\",
    \"search_param[ids]\": \"aut\",
    \"search_param[selectedPrice]\": [
        \"unde\"
    ],
    \"search_param[productCategories]\": [
        \"officiis\"
    ],
    \"search_param[selectedProductCategories]\": \"\\\"include\\\"\",
    \"search_param[layout]\": \"\\\"card\\\"\",
    \"search_param[sort_order]\": \"\\\"created_at\\\"\",
    \"search_param[sort_direction]\": \"\\\"desc\\\"\",
    \"search_param[categoriesName]\": \"\\\"Category Name\\\"\",
    \"search_param[location]\": \"\\\"Cherry Hill\\\"\",
    \"search_param[date]\": \"\\\"2024-01-15\\\"\",
    \"search_param[position]\": \"\\\"top\\\"\",
    \"search_param[selectedProducts]\": \"\\\"include\\\"\",
    \"search_param[showFilter]\": \"\\\"yes\\\"\",
    \"search_param[showFilterType]\": [
        \"Price\",
        \"Name\",
        \"Category\"
    ]
}"
const url = new URL(
    "https://demo.aomlms.com/api/products/calendar-catalog"
);

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

let body = {
    "startDate": "\"2023-12-31T18:30:00.000Z\"",
    "endDate": "\"2024-01-30T18:30:00.000Z\"",
    "search_param": "dolor",
    "search_param[title]": "\"Professional Development\"",
    "search_param[ids]": "aut",
    "search_param[selectedPrice]": [
        "unde"
    ],
    "search_param[productCategories]": [
        "officiis"
    ],
    "search_param[selectedProductCategories]": "\"include\"",
    "search_param[layout]": "\"card\"",
    "search_param[sort_order]": "\"created_at\"",
    "search_param[sort_direction]": "\"desc\"",
    "search_param[categoriesName]": "\"Category Name\"",
    "search_param[location]": "\"Cherry Hill\"",
    "search_param[date]": "\"2024-01-15\"",
    "search_param[position]": "\"top\"",
    "search_param[selectedProducts]": "\"include\"",
    "search_param[showFilter]": "\"yes\"",
    "search_param[showFilterType]": [
        "Price",
        "Name",
        "Category"
    ]
};

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

Example response (200):


{
    "records": [
        {
            "id": 11,
            "courseId": 9,
            "classId": 3,
            "courseName": "Test ILT course",
            "location": "Cherry Hill",
            "locationId": 2,
            "start": "2024-01-03 08:00:14",
            "end": "2024-01-03 10:00:19",
            "instructor": "Test Staff",
            "class": "blue",
            "price": 12,
            "displayPrice": "&#36;12",
            "canBePurchased": true,
            "status": "IN-STOCK",
            "subscription_price": null,
            "price_frequency": "MONTHLY",
            "label": "",
            "display_label": "",
            "title": "Test LTI Course"
        }
    ]
}
 

Request   

GET api/products/calendar-catalog

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Body Parameters

startDate   string  optional  

The start date of the class. Example: "2023-12-31T18:30:00.000Z"

endDate   string  optional  

The end date of the class. Example: "2024-01-30T18:30:00.000Z"

search_param   string  optional  

JSON-encoded string containing various search parameters. Example: dolor

search_param[title]   string  optional  

The title of the classes to search for. Example: "Professional Development"

search_param[ids]   array|null  optional  

An array of event IDs to filter by. Example: aut

search_param[selectedPrice]   string[]  optional  

An array of selected price options.

search_param[productCategories]   string[]  optional  

An array of product categories to filter classes by.

search_param[selectedProductCategories]   string  optional  

The strategy for including/excluding product categories. Example: "include"

search_param[layout]   string  optional  

The layout type for displaying classes. Example: "card"

search_param[sort_order]   string  optional  

The sort order for classes. Example: "created_at"

search_param[sort_direction]   string  optional  

The sort direction for classes. Example: "desc"

search_param[categoriesName]   string  optional  

The name of categories to filter classes by. Example: "Category Name"

search_param[location]   string  optional  

The location to filter classes by. Example: "Cherry Hill"

search_param[date]   string  optional  

The date to filter classes by. Example: "2024-01-15"

search_param[position]   string  optional  

The position for displaying classes. Example: "top"

search_param[selectedProducts]   string  optional  

The strategy for including/excluding selected products. Example: "include"

search_param[showFilter]   string  optional  

Whether to show filters. Example: "yes"

search_param[showFilterType]   string[]  optional  

An array of filter types to show.

Retrieve Product

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

Example request:
curl --request GET \
    --get "https://demo.aomlms.com/api/product/1" \
    --header "Content-Type: application/json" \
    --header "Accept: application/json" \
    --header "Authorization: Bearer {token}"
const url = new URL(
    "https://demo.aomlms.com/api/product/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):


{
    "title": "Product-1",
    "slug": "product-1",
    "description": "Course 1 product",
    "featuredImageUrl": null,
    "regular_price": 3500,
    "type": "SIMPLE",
    "sale_price": 3001,
    "saleStartDate": null,
    "saleEndDate": null,
    "status": "IN-STOCK",
    "expiry": "2020-10-29",
    "taxIncluded": false,
    "taxBasedOn": "CUSTOMER-BILLING-ADDR",
    "seo_title": null,
    "seo_description": null,
    "displayPrice": "<del>$3500 </del><span>$3001</span>",
    "canBePurchased": true,
    "label": "SALE",
    "categories": [],
    "courses": [
        {
            "value": 1,
            "label": "course 1"
        }
    ],
    "courseCategories": []
}
 

Request   

GET api/product/{id}

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

URL Parameters

id   string   

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

Retrieve Class Dates

Retrieves the details of a specified product. Helps in fetching a dates using its loaction ID and product ID. (See Parameters)

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

const params = {
    "location_id": "1",
    "product_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):


{
    "dates": [
        {
            "id": 57,
            "courseId": 34,
            "locationName": "Cherry Hill",
            "locationId": 2,
            "startDate": "2024-01-12T04:00:00.000000Z",
            "startDateTime": "2024-01-12T04:00:00.000000Z",
            "enddDateTime": "2024-01-31T11:00:00.000000Z",
            "dates": "11-Jan-2024 - 31-Jan-2024 (09:00 PM - 04:00 AM)"
        },
        {
            "id": 58,
            "courseId": 34,
            "locationName": "Cherry Hill",
            "locationId": 2,
            "startDate": "2024-01-31T09:00:00.000000Z",
            "startDateTime": "2024-01-31T09:00:00.000000Z",
            "enddDateTime": "2024-02-07T18:09:00.000000Z",
            "dates": "31-Jan-2024 - 07-Feb-2024 (02:00 AM - 11:09 AM)"
        }
    ]
}
 

Request   

GET api/products/get-class-dates

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Query Parameters

location_id   integer  optional  

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

product_id   string  optional  

The ID of the product. Example: 1

POST api/get-search-product

Example request:
curl --request POST \
    "https://demo.aomlms.com/api/get-search-product" \
    --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 headers = {
    "Content-Type": "application/json",
    "Accept": "application/json",
    "Authorization": "Bearer {token}",
};

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

Request   

POST api/get-search-product

Headers

Content-Type      

Example: application/json

Accept      

Example: application/json

Authorization      

Example: Bearer {token}

Retrieve Products

Retrieves the details of all products. Helps in fetching entire products in the account. (See Response)

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

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}

Product Types Lookup

Retrieves all the types 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/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. Example - old-awesome-product to new-awesome-product

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

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

let body = {
    "slug": "new-product-1"
};

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

Example response (200):


"new-product-1"
 

Request   

PUT api/products/update-slug/{id}

Headers

Content-Type      

Example: application/json

Accept