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, ‘2’ for supervisors, ‘3’ for managers. 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, ‘2’ for supervisors, ‘3’ for managers.)
– description
– custom_fields (optional, JSON format: {“Department”:”Sales”,”Location”:”New York”})
– id is required if you want to change the user’s email

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)

Recent Completions

ACTION:
– see the completed courses in the last 24 hours

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

ARGUMENTS:
– api_token (Required)

Export Activity

ACTION:
– Export activity for all users (Response will either contain a temporary URL to an export file, or process your request to generate a report in the background which will be sent to you via email).

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

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

Activity

ACTION:
– see completion status of 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)

Regenerate Activity

ACTION:
– schedules a fresh activity report. (works only if previous report is at least 5 hours old)

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

ARGUMENTS:
– api_token (Required)

Export Certificate

ACTION:
– Export certificate for a user assigned to a course (Response will contain a temporary URL to a 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)

Custom Fields

ACTION:
– returns the name of the custom fields, if the company has any.

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

ARGUMENTS:
– api_token (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 a 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 a 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)

Learning Paths (previously Training Paths)

List

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

URL:
– https://[company].2leap.com/api/learning_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 Learning Path

URL:
– https://[company].2leap.com/api/learning_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 Learning Path.

URL:
– https://[company].2leap.com/api/learning_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 Learning Path.

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

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

Find

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

URL:
– https://[company].2leap.com/api/learning_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 Learning Path will be available in the successful response

URL:
– https://[company].2leap.com/api/learning_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 Learning Path

URL:
– https://[company].2leap.com/api/learning_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 Learning Path

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

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

AssignUser

ACTION:
– assigns a user to an existing Learning Path

URL:
– https://[company].2leap.com/api/learning_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 Learning Path

URL:
– https://[company].2leap.com/api/learning_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 Learning Path

URL:
– https://[company].2leap.com/api/learning_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 Learning Path

URL:
– https://[company].2leap.com/api/learning_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 Learning Path

URL:
– https://[company].2leap.com/api/learning_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 Learning Path

URL:
– https://[company].2leap.com/api/learning_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’)

Course Object values in Courses list:
– id (Course id)
– name (Course Name)
– description (Course Description)
– active (Course status = “yes”/”no”)
– created (Created Date)
– deadline (Deadline type = “date”/”relative”)
– deadline_date (Deadline date if deadline type = “date”)
– deadline_relative (Deadline relative to period if deadline type = “relative”)
– deadline_relative_unit (Deadline relative period Unit = “days”/”months”)

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

API requests limits

API requests are put in a queue and solved as they are requested. There’s an hourly limit of 2500 requests. If you hit the hourly limit, you will receive a 429 “too many connections” status alert.

Message examples

Success message after add/edit/remove:

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

Courses list:


{
"response":{
"status":"success",
"code":"200",
"message":"OK"
},
"courses":{
"id":"1",
"name":"Course Name",
"description":"Course Description",
"active":"yes",
"created":"2023-08-21 10:45:08",
"deadline":"date",
"deadline_date":"2024-01-01",
"deadline_relative":"0",
"deadline_relative_unit":""
}
}

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