eLeaP LMS API Documentation If you want to automate interactions with the LMS

Overview

The eLeaP API consists of a set of callable methods. To perform an action using the API, send a request to an API endpoint and a response will then be sent back to you. If you don’t have an API account, contact eLeaP to register and activate your API account.

The request can either be GET or POST. We recommend you use POST requests.

The response you’ll get will be a JSON encoded object.

Authentication

All requests to the API must contain the parameter api_token. You can get this key from your eLeaP account, if you are an administrator. You’ll find the api_token in COMPANY PROFILE > API.

If you think the key has been compromised, you must reset it from COMPANY PROFILE > API > Reset API Key.

Methods

Users

List

ACTION:

– returns the list of users (trainees and instructors) from the company.

URL:

– https://[company].2leap.com/api/users/          (replace [company] with your 2leap subdomain)

ARGUMENTS:

– api_token (Required)
– order (Optional, ‘asc’ or ‘desc’)
– custom_fields (optional, JSON format: {“Department”:”Sales”,”Location”:”New York”})

Get

ACTION:

– returns the details for a user from the company (trainee or instructor).

URL:

– https://[company].2leap.com/api/users/get          (replace [company] with your 2leap subdomain)

ARGUMENTS:

– api_token (Required)
– email (Required)

Find

ACTION:

– returns the details for a user from the company (trainee or instructor) using the eleap internal id. The id can be found in the user list or with the “get” method.

URL:

– https://[company].2leap.com/api/users/find          (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)

Add

ACTION:
– inserts a new user

URL:

– https://[company].2leap.com/api/users/add          (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– first_name (Required)
– middle_name
– last_name (Required)
– email (Required)
– access_level (1 for instructors, 0 for trainees, if missing 0 is assumed)
– description
– silent (optional, if set to 1 no activation email will be sent to user)
– custom_fields (optional, JSON format: {“Department”:”Sales”,”Location”:”New York”})

Edit

ACTION:
– updates information for an existing user (trainee or instructor)

URL:
– https://[company].2leap.com/api/users/edit          (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– first_name (Required)
– middle_name
– last_name (Required)
– email (Required)
– access_level (1 for instructors, 0 for trainees, if missing 0 is assumed)
– description
– custom_fields (optional, JSON format: {“Department”:”Sales”,”Location”:”New York”})

Reset Password

ACTION:
– resets the password for a user and sends him/her an email with the new password.

URL:
– https://[company].2leap.com/api/users/reset_password          (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– email (Required)
– password (optional) – if not present a system generated password is set. For GET requests use alphanumeric strings.
– silent (optional, if set to 1 no assignment email will be sent to user)

Remove

ACTION:
– removes an existing user (trainee or instructor)

URL:
– https://[company].2leap.com/api/users/remove          (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– email (Required)

Activate

ACTION:
– activate an existing user (trainee or instructor)

URL:
– https://[company].2leap.com/api/users/activate          (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– email (Required)

Deactivate

ACTION:
– deactivate an existing user (trainee or instructor)

URL:
– https://[company].2leap.com/api/users/deactivate          (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– email (Required)

Export Activity

ACTION:
– Export activity for all users (Response will contain a temporary URL to an export file)

URL:
– https://[company].2leap.com/api/users/export_activity (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)

Activity

ACTION:
– see completion status an existing user (trainee or instructor)

URL:
– https://[company].2leap.com/api/users/activity          (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)
– id_course (Required)

Export Certificate

ACTION:
– Export certificate for a user assigned to a course (Response will contain a temporary URL to an certificate file)

URL:
– https://[company].2leap.com/api/users/export_certificate (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)
– id_course (Required)

User Groups

List

ACTION:
– returns the list of user groups from the company.

URL:
– https://[company].2leap.com/api/usergroups/ (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– order (Optional, ‘asc’ or ‘desc’)

Find

ACTION:
– returns the details for an user group from the company using the eleap internal id. The id can be found with the user group list method.

URL:
– https://[company].2leap.com/api/usergroups/find (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)

AssignedUsers

ACTION:
– returns the list of users assigned to a usergroup.

URL:
– https://[company].2leap.com/api/usergroups/assigned_users (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)

Add

ACTION:
– inserts a new user group
– the ID of the new group will be available in the successful response

URL:
– https://[company].2leap.com/api/usergroups/add (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– name (Required)
– description
– active(1 for yes, 0 for no, if missing 0 is assumed)

Edit

ACTION:
– updates information for an existing user group

URL:
– https://[company].2leap.com/api/usergroups/edit (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)
– name (Required)
– description
– active (1 for yes, 0 for no, if missing remains unchanged)

Remove

ACTION:
– removes an existing user group

URL:
– https://[company].2leap.com/api/usergroups/remove (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)

AssignUser

ACTION:
– assigns an user to an existing user group

URL:
– https://[company].2leap.com/api/usergroups/assign_user (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required – the id of the group)
– id_user (Required)

UnassignUser

ACTION:
– unassigns a user from an existing user group

URL:
– https://[company].2leap.com/api/usergroups/unassign_user (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required
– the id of the group)
– id_user (Required)

Training Paths (previously Career Paths)

List

ACTION:
– returns the list of Training Paths in the company.

URL:
– https://[company].2leap.com/api/career_paths/ (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– order (Optional, ‘asc’ or ‘desc’)

AssignedUsers

ACTION:
– returns the list of users assigned to a Training Path

URL:
– https://[company].2leap.com/api/career_paths/assigned_users (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)

AssignedUserGroups

ACTION:
– returns the list of user groups assigned to a Training Path.

URL:
– https://[company].2leap.com/api/career_paths/assigned_user_groups (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)

AssignedCourses

ACTION:
– returns the list of courses assigned to a Training Path.

URL:
– https://[company].2leap.com/api/career_paths/assigned_courses (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)

Find

ACTION:
– returns the details for an career path from the company using the eleap internal id. The id can be found with the Training Path list method.

URL:
– https://[company].2leap.com/api/career_paths/find (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)

Add

ACTION:
– inserts a new Training Path
– the ID of the new Training Path will be available in the successful response

URL:
– https://[company].2leap.com/api/career_paths/add (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– name (Required)
– description
– active(1 for yes, 0 for no, if missing 0 is assumed)
– order_preset(1 for yes, 0 for no, if missing 0 is assumed)
– self_enrollment(1 for yes, 0 for no, if missing 0 is assumed)

Edit

ACTION:
– updates information for an existing Training Path

URL:
– https://[company].2leap.com/api/career_paths/edit (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)
– name (Required)
– description
– active(1 for yes, 0 for no, if missing 0 is assumed)
– order_preset(1 for yes, 0 for no, if missing 0 is assumed)
– self_enrollment(1 for yes, 0 for no, if missing 0 is assumed)

Remove

ACTION:
– removes an existing Training Path

URL:
– https://[company].2leap.com/api/career_paths/remove (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)

AssignUser

ACTION:
– assigns an user to an existing Training Path

URL:
– https://[company].2leap.com/api/career_paths/assign_user (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required – the id of the group)
– id_user (Required)
– silent (optional, if set to 1 no assignment email will be sent to user)

UnassignUser

ACTION:
– unassigns a user from an existing Training Path

URL:
– https://[company].2leap.com/api/career_paths/unassign_user (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required – the id of the group)
– id_user (Required)

AssignUserGroup

ACTION:
– assigns a user group to an existing Training Path

URL:
– https://[company].2leap.com/api/career_paths/assign_user_group (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required – the id of the group)
– id_usergroup (Required)
– silent (optional, if set to 1 no assignment email will be sent to user)

UnassignUserGroup

ACTION:
– unassigns a user group from an existing Training Path

URL:
– https://[company].2leap.com/api/career_paths/unassign_user_group (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required – the id of the group)
– id_usergroup (Required)

AssignCourse

ACTION:
– assigns a course to an existing Training Path

URL:
– https://[company].2leap.com/api/career_paths/assign_course (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required – the id of the group)
– id_course (Required)
– silent (optional, if set to 1 no assignment email will be sent to user)

UnassignCourse

ACTION:
– unassigns a course from an existing Training Path

URL:
– https://[company].2leap.com/api/career_paths/unassign_course (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required – the id of the group)
– id_course (Required)
– silent (optional, if set to 1 no assignment email will be sent to user)

Courses

List

ACTION:
– returns the list of courses from the company.

URL:
– https://[company].2leap.com/api/courses/ (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– order (Optional, ‘asc’ or ‘desc’)

AssignedUsers

ACTION:
– returns the list of users assigned to a course.

URL:
– https://[company].2leap.com/api/courses/assigned_users (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)

AssignedUserGroups

ACTION:
– returns the list of user groups assigned to a course.

URL:
– https://[company].2leap.com/api/courses/assigned_user_groups (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)

Find

ACTION:
– returns the details for a course from the company using the eleap internal id. The id can be found with the course list method.

URL:
– https://[company].2leap.com/api/courses/find (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required)

AssignUser

ACTION:
– assigns an user to an existing course

URL:
– https://[company].2leap.com/api/courses/assign_user (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required – the id of the course)
– id_user (Required)
– silent (optional, if set to 1 no assignment email will be sent to user)

UnassignUser

ACTION:
– unassigns an user from an existing course

URL:
– https://[company].2leap.com/api/courses/unassign_user (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required – the id of the course)
– id_user (Required)

AssignUserGroup

ACTION:
– assigns an user group to an existing course

URL:
– https://[company].2leap.com/api/courses/assign_user_group (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required – the id of the group)
– id_usergroup (Required)
– silent (optional, if set to 1 no assignment email will be sent to user)

UnassignUserGroup

ACTION:
– unassigns an user group from an existing course

URL:
– https://[company].2leap.com/api/courses/unassign_user_group (replace [company] with your 2leap subdomain)

ARGUMENTS:
– api_token (Required)
– id (Required – the id of the group)
– id_usergroup (Required)

Error codes

401: Request missing api token
‘api_token’ argument is missing or is empty

4011: Invalid API Key
‘api_token’ argument exists but is incorrect

403: You don't have permission for this resource
The resource you’re requesting is not accessible through API. Same error is triggered if the subdomain and the api_token don’t match.

404: Invalid API call
The URL is incorrect

4040: Custom message
Usually used when sent data fails validation. This typically gives custom errors returned by the eLeaP system.

4041: Requested item(s) not found
There is no data to return (response is empty).

Message examples

Success message after add/edit/remove:

{"response":{"status":"success","code":"200","message":"OK"}}

User list:

{"response":{"status":"success","code":"200","message":"OK"},"users":[{"access_level":0,
"first_name":"John","middle_name":"","last_name":"Doe","email":"jojn.doe@example.com",
"description":"Lorem ipsum dolor sit amet","created":"2011-01-31 09:41:30"},{"access_level":1,
"first_name":"Lorem","middle_name":"Ipsum","last_name":"Dolor","email":"lorem@example.com",
"description":"test","created":"2010-11-11 00:00:00"}]}

Single user:

{"response":{"status":"success","code":"200","message":"OK"},"user":[{"access_level":1,
"first_name":"Lorem","middle_name":"Ipsum","last_name":"Dolor","email":"victoras@gmail.com",
"description":"TEST","created":"2010-11-11 00:00:00"}]}

API token is wrong:

{"response":{"status":"fail","message":"Invalid API Key","code":4011}}

Custom error message:

{"response":{"status":"fail","message":"Cannot add users. Account limits reached","code":4040}}
[Top]