Skip to content
English
  • There are no suggestions because the search field is empty.

HR Learn: API v2 - User API

The User API performs actions related to users in the HR Learn LMS.

The User API performs actions related to users in the HR Learn LMS. The following methods are available via this API:

Create user

HTTP Action

POST

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/user/v2/create

Request Parameters

Parameter Data Type Description
FirstName (required) string

 

MiddleName (optional) string  
LastName (required) string  
Email (optional) string  
Username (required) string  
Password (required) string  
MustChangePassword (required) boolean Require the user to change their password on next sign-in?
DisableLoginFromLoginForm (optional) boolean Disallow user from logging in directly via the LMS login form? Used when you would like the user to exclusively sign-in via SSO.
ExcludeFromLeaderboards (optional) boolean Exclude the user from appearing in leaderboards?
Timezone (required) string The time zone for the user. This should be a standard time zone name, a list of acceptable values can be found here.
Language (optional) string The language for the user. This should be a standard language code, a list of acceptable values can be found here.
DtExpires (optional) datetime The expiration date of the user's LMS account. NULL means no expiration.
IsActive (required) boolean Is the user's LMS account active?
Company (optional) string  
Address (optional) string  
City (optional) string  
Province (optional) string  
PostalCode (optional) string  
Country (optional) string  
PhonePrimary (optional) string  
PhoneHome (optional) string  
PhoneWork (optional) string  
Fax (optional) string  
PhoneMobile (optional) string  
Pager (optional) string  
PhoneOther (optional) string  
EmployeeId (optional) string  
JobTitle (optional) string  
JobClass (optional) string  
Division (optional) string  
Region (optional) string  
Department (optional) string  
DtHire (optional) datetime  
DtTerm (optional) datetime  
Gender (optional) string "M" or "F"
Race (optional) string  
DtDOB (optional) datetime  
Field00 (optional) string  
Field01 (optional) string  
Field02 (optional) string  
Field03 (optional) string  
Field04 (optional) string  
Field05 (optional) string  
Field06 (optional) string  
Field07 (optional) string  
Field08 (optional) string  
Field09 (optional) string  
Field10 (optional) string  
Field11 (optional) string  
Field12 (optional) string  
Field13 (optional) string  
Field14 (optional) string  
Field15 (optional) string  
Field16 (optional) string  
Field17 (optional) string  
Field18 (optional) string  
Field19 (optional) string  

Note that required fields and formatting depend on settings you have configured in System > User Field Configuration.

Example:

Example using minimum system required parameters.

{   "FirstName": "API",   "LastName": "User",   "Username": "apiuser",   "Password": "@p1UserPassword",   "MustChangePassword" : "true",   "Timezone": "Eastern Standard Time",   "IsActive": true } 

Response

The id of the user that was created.

Example:

123

Import user batch

HTTP Action

POST

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/user/v2/batch/{createUsersOnly} (true/false)

  • /batch/true will only create users where they do not already exist.
  • /batch/false will update user records where matched by username.

Request Parameters

Parameter Data Type Description
{TXT FILE} file

A tab-delimited text file formatted per specifications in the Users > User Batch section of the LMS admin area.

 

Response

NONE (200 - OK)

Search users

HTTP Action

POST

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/user/v2/search

Request Parameters

Parameter Data Type Description
Type (required) string

The type of search to perform, can be one of the following values:

  • "fts" - performs a full text search across user profile fields
  • "username" - performs a search by username
  • "email" - performs a search by email address
SearchParam (required) string The term you are searching for.

Example:

{   "Type": "username",    "SearchParam": "apiuser" } 

Response

An array of user objects matching the search criteria.

Example:

[ 	{ 		"Id": 123, 		"FirstName": "API", 		"MiddleName": null, 		"LastName": "User", 		"DisplayName": "User, API", 		"Avatar": null, 		"Email": "apiuser@mydomain.com", 		"Username": "apiuser", 		"IdSite": 2, 		"IdTimezone": 15, 		"ObjectGUID": null, 		"ActivationGUID": null, 		"DistinguishedName": null, 		"IsActive": true, 		"MustChangePassword": false, 		"DtCreated": "2021-05-03T15:37:00.53Z", 		"DtExpires": null, 		"LanguageString": "en-US", 		"DtModified": "2021-05-03T16:45:16.81Z", 		"DtLastLogin": null, 		"EmployeeId": null, 		"Company": null, 		"Address": null, 		"City": null, 		"Province": null, 		"PostalCode": null, 		"Country": null, 		"PhonePrimary": null, 		"PhoneWork": null, 		"PhoneFax": null, 		"PhoneHome": null, 		"PhoneMobile": null, 		"PhonePager": null, 		"PhoneOther": null, 		"Department": null, 		"Division": null, 		"Region": null, 		"JobTitle": null, 		"JobClass": null, 		"Gender": null, 		"Race": null, 		"DtDOB": null, 		"DtHire": null, 		"DtTerm": null, 		"Field00": null, 		"Field01": null, 		"Field02": null, 		"Field03": null, 		"Field04": null, 		"Field05": null, 		"Field06": null, 		"Field07": null, 		"Field08": null, 		"Field09": null, 		"Field10": null, 		"Field11": null, 		"Field12": null, 		"Field13": null, 		"Field14": null, 		"Field15": null, 		"Field16": null, 		"Field17": null, 		"Field18": null, 		"Field19": null, 		"IsUserACourseExpert": false, 		"IsUserASupervisor": false, 		"IsUserAWallModerator": false, 		"IsUserAnILTInstructor": false, 		"GroupMemberships": null 	} ]

Get user details

HTTP Action

GET

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/user/v2/{id}

Request Parameters

NONE

Response

A user object matching the {id} of the user.

Example:

{ 	"Id": 123, 	"FirstName": "API", 	"MiddleName": null, 	"LastName": "User", 	"DisplayName": "User, API", 	"Avatar": null, 	"Email": "apiuser@mydomain.com", 	"Username": "apiuser", 	"IdSite": 2, 	"IdTimezone": 15, 	"ObjectGUID": null, 	"ActivationGUID": null, 	"DistinguishedName": null, 	"IsActive": true, 	"MustChangePassword": false, 	"DtCreated": "2021-05-03T15:37:00.53Z", 	"DtExpires": null, 	"LanguageString": "en-US", 	"DtModified": "2021-05-03T16:45:16.81Z", 	"DtLastLogin": null, 	"EmployeeId": null, 	"Company": null, 	"Address": null, 	"City": null, 	"Province": null, 	"PostalCode": null, 	"Country": null, 	"PhonePrimary": null, 	"PhoneWork": null, 	"PhoneFax": null, 	"PhoneHome": null, 	"PhoneMobile": null, 	"PhonePager": null, 	"PhoneOther": null, 	"Department": null, 	"Division": null, 	"Region": null, 	"JobTitle": null, 	"JobClass": null, 	"Gender": null, 	"Race": null, 	"DtDOB": null, 	"DtHire": null, 	"DtTerm": null, 	"Field00": null, 	"Field01": null, 	"Field02": null, 	"Field03": null, 	"Field04": null, 	"Field05": null, 	"Field06": null, 	"Field07": null, 	"Field08": null, 	"Field09": null, 	"Field10": null, 	"Field11": null, 	"Field12": null, 	"Field13": null, 	"Field14": null, 	"Field15": null, 	"Field16": null, 	"Field17": null, 	"Field18": null, 	"Field19": null, 	"IsUserACourseExpert": false, 	"IsUserASupervisor": false, 	"IsUserAWallModerator": false, 	"IsUserAnILTInstructor": false, 	"GroupMemberships": null }

Update user

HTTP Action

PUT

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/user/v2/{id}

Request Parameters

Parameter Data Type Description
FirstName (required) string

 

MiddleName (optional) string  
LastName (required) string  
Email (optional) string  
Username (required) string  
Password (required) string  
MustChangePassword (required) boolean Require the user to change their password on next sign-in?
DisableLoginFromLoginForm (optional) boolean Disallow user from logging in directly via the LMS login form? Used when you would like the user to exclusively sign-in via SSO.
ExcludeFromLeaderboards (optional) boolean Exclude the user from appearing in leaderboards?
Timezone (required) string The time zone for the user. This should be a standard time zone name, a list of acceptable values can be found here.
Language (optional) string The language for the user. This should be a standard language code, a list of acceptable values can be found here.
DtExpires (optional) datetime The expiration date of the user's LMS account. NULL means no expiration.
IsActive (required) boolean Is the user's LMS account active?
Company (optional) string  
Address (optional) string  
City (optional) string  
Province (optional) string  
PostalCode (optional) string  
Country (optional) string  
PhonePrimary (optional) string  
PhoneHome (optional) string  
PhoneWork (optional) string  
Fax (optional) string  
PhoneMobile (optional) string  
Pager (optional) string  
PhoneOther (optional) string  
EmployeeId (optional) string  
JobTitle (optional) string  
JobClass (optional) string  
Division (optional) string  
Region (optional) string  
Department (optional) string  
DtHire (optional) datetime  
DtTerm (optional) datetime  
Gender (optional) string "M" or "F"
Race (optional) string  
DtDOB (optional) datetime  
Field00 (optional) string  
Field01 (optional) string  
Field02 (optional) string  
Field03 (optional) string  
Field04 (optional) string  
Field05 (optional) string  
Field06 (optional) string  
Field07 (optional) string  
Field08 (optional) string  
Field09 (optional) string  
Field10 (optional) string  
Field11 (optional) string  
Field12 (optional) string  
Field13 (optional) string  
Field14 (optional) string  
Field15 (optional) string  
Field16 (optional) string  
Field17 (optional) string  
Field18 (optional) string  
Field19 (optional) string  

Note that required fields and formatting depend on settings you have configured in System > User Field Configuration.

Example:

Example using minimum system required parameters.

{   "FirstName": "API",   "LastName": "User (Modified)",   "Username": "apiuser",   "Password": "@p1UserPassword",   "MustChangePassword" : "true",   "Timezone": "Eastern Standard Time",   "IsActive": true } 

Response

The id of the user that was updated.

Example:

123

Delete user

HTTP Action

DELETE

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/user/v2/{id}

Request Parameters

NONE

Response

NONE (200 - OK)

Sign user in (SSO)

HTTP Action

POST

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/user/v2/{id}/sso

Request Parameters

Parameter Data Type Description
RedirectUrl (optional) string

Relative in-system URL the user will be redirected to after sign-in.

As an example, you can redirect the user directly to an enrollment by using the relative path of a course enrollment URL from the listing of the user's course enrollments in Get course enrollments for user.

Response

A tokenized sign-in URL that will sign the user into the system and redirect the user to the redirectUrl if specified. If a redirectUrl is not specified, the user will be redirected to the default landing page that is configured in the LMS.



Get group memberships for user

HTTP Action

GET

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/user/v2/{id}/groups

Request Parameters

NONE

Response

An array of group objects where the user specified by {id} is a member.

Example:

[ 	{ 		  "Id": 3, 		  "Name": "My Group", 		  "ShortDescription": null, 		  "Avatar": null, 		  "LanguageSpecificProperties": [] 	} ]

Attach user to group(s)

HTTP Action

POST

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/user/v2/{id}/attachgroups

Request Parameters

Parameter Data Type Description
GroupIds array<integer>

An array of group ids to attach the user to.

Example:

{		       "GroupIds": [ 123 ] } 

Response

NONE (200 - OK)

Remove user from group(s)

HTTP Action

POST

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/user/v2/{id}/removegroups

Request Parameters

Parameter Data Type Description
GroupIds array<integer>

An array of group ids to remove the user from.

Example:

{		     "GroupIds": [ 123 ] } 

Response

NONE (200 - OK)

Get course enrollments for user

HTTP Action

GET

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/user/v2/{id}/courseenrollments

Request Parameters

NONE

Response

An array of course enrollment objects for the user specified by {id}.

Example:

[     {         "Id": 16,         "Name": "My Course",         "ShortDescription": "This is my course.",         "Credits": 0,         "Avatar": null,         "StartDate": "2021-04-12T11:45:20.737Z",         "DueDate": null,         "ExpirationDate": null,         "Status": "In Progress",         "EnrollmentLink": "/dashboard/v2/Enrollment.aspx?idEnrollment=16"     } ]

Get learning path enrollments for user

HTTP Action

GET

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/user/v2/{id}/learningpathenrollments

Request Parameters

NONE

Response

An array of learning path enrollment objects for the user specified by {id}.

Example:

[     {         "Id": 7,         "Name": "My Learning Path",         "ShortDescription": "This is my learning path.",         "Avatar": null,         "StartDate": "2021-04-30T18:18:52.307Z",         "DueDate": null,         "ExpirationDate": null,         "Status": "In Progress",         "LearningPathEnrollmentLink": "/dashboard/v2/LearningPathEnrollment.aspx?id=7"     } ]

Get transcript for user

HTTP Action

GET

Base URL

https://[Your HR Learn LMS Portal URL]

Endpoint URL

/api/user/v2/{id}/transcript

Request Parameters

NONE

Response

An array of course, learning path, and ILT objects that have been completed by the user specified by {id}.

Example:

{     "Courses": [         {             "EnrollmentId": 72134,             "Name": "Storyline 2004 no quiz com-inc",             "Code": "",             "Credits": null,             "Modules": [                 {                     "Name": "Storyline 2004 no quiz com-inc",                     "CompletionDate": "2021-06-22T18:54:26.937Z",                     "Score": ""                 }             ],             "StartDate": "2021-04-15T02:55:02.04Z",             "CompletionDate": "2021-06-22T18:54:26.937Z",             "IsExternalTrainingImport": false,             "IsActivityDataImport": false         }     ],     "LearningPaths": [         {             "EnrollmentId": 12345,             "Name": "My Learning Path",                      "StartDate": "2021-04-15T02:55:02.04Z",             "CompletionDate": "2021-06-22T18:54:26.937Z"         }     ],     "Ilts": [         {             "Name": "My ILT",             "SessionName": "Saturday Session",                      "SessionDate": "2021-06-22T18:54:26.937Z",             "CompletionDate": "2021-06-22T18:54:26.937Z",             "Score": "100"         }     ] }