Authorize
Login
Use this API to generate JWT token and refresh token.
POST /authorize/login
Request body parameters
Field | Type | Description |
---|---|---|
email required | string | Email Address |
password required | string | Password |
domain | string | Custom Domain of your account. e.g.: lms.example.com |
- Response
- Schema
- Error Codes
{
"success": true,
"data": {
"response": {
"acknowledgement": "Success",
"data": {
"user": {
"id": 8,
"firstName": "Pooja",
"lastName": "G",
"email": "pooja.g@example.com",
"mobile": "+919876543210",
"uniqueId": "10105",
"role": "Trainee",
"language": "en-US",
"timezone": "Asia/Kolkata",
"sessionToken": "********",
"companyId": 101,
"companyName": "Horizzon Information Tech. Pvt Ltd"
},
"token": "***********",
"refresh-token": "********"
},
"error": {
"code": "",
"internal_message": "",
"moreInfo": []
}
}
}
}
Field | Type | Description |
---|---|---|
id | number | ID of the user. |
firstName | string | First name of the user. |
lastName | string | Last name of the user. |
string | Email of the user. | |
mobile | string | Mobile number of the user. |
uniqueId | string | Unique ID of the user. |
role | string | Role of the user. |
language | string | Language preference of the user. |
timezone | string | Timezone of the user. |
sessionToken | string | Session token of the user. |
companyId | number | ID of the company. |
companyName | string | Name of the company. |
token | string | Authentication token for the user. |
refresh-token | string | Refresh token for the user. |
Code | Description |
---|---|
1001 | "Missing email" |
1002 | "Invalid email" |
1003 | "Missing password" |
1004 | "Invalid password" |
1005 | "Missing domain" |
1006 | "Invalid domain" |
For general error details, click here.
Generate Token
Use this API to generate JWT token using refresh token.
POST /authorize/refresh-token
Request body parameters
Field | Type | Description |
---|---|---|
refreshToken required | string | Refresh Token |
- Response
- Schema
- Error Codes
{
"success": true,
"data": {
"response": {
"acknowledgement": "Success",
"data": {
"status": "ok",
"token": "**********"
},
"error": {
"code": "",
"internal_message": "",
"moreInfo": []
}
}
}
}
Field | Type | Description |
---|---|---|
token | string | Authentication token for the user |
status | string | Status of the response |
Code | Description |
---|---|
1016 | "Missing refreshToken" |
1017 | "Invalid refreshToken" |
For general error details, click here.
Login via SSO
Use this API to login into LMS using SSO.
POST /authorize/third-party
Request body parameters
Field | Type | Description |
---|---|---|
provider required | integer | 1 - Google |
thirdPartyData required | jsonArray | this jsonArray has "token" as key and value is token returned by google after verification. |
- thirdPartyData
{
"token":"**************"
}
- Response
- Schema
- Error Codes
{
"success": true,
"data": {
"response": {
"acknowledgement": "Success",
"data": {
"user": {
"id": 8,
"firstName": "Pooja",
"lastName": "G",
"email": "pooja.g@example.com",
"mobile": "+919876543210",
"uniqueId": "10105",
"role": "Trainee",
"language": "en-US",
"timezone": "Asia/Kolkata",
"sessionToken": "********",
"companyId": 1,
"companyName": "Horizzon Information Tech. Pvt Ltd"
},
"token": "***********",
"refresh-token": "********"
},
"error": {
"code": "",
"internal_message": "",
"moreInfo": []
}
}
}
}
Field | Type | Description |
---|---|---|
id | number | ID of the user. |
firstName | string | First name of the user. |
lastName | string | Last name of the user. |
string | Email of the user. | |
mobile | string | Mobile number of the user. |
uniqueId | string | Unique ID of the user. |
role | string | Role of the user. |
language | string | Language preference of the user. |
timezone | string | Timezone of the user. |
sessionToken | string | Session token of the user. |
companyId | number | ID of the company. |
companyName | string | Name of the company. |
token | string | Authentication token for the user. |
refresh-token | string | Refresh token for the user. |
Code | Description |
---|---|
1028 | "Missing provider" |
1029 | "Invalid provider" |
1030 | "Missing thirdPartyData" |
1031 | "Invalid thirdPartyData" |
For general error details, click here.
Redirect to Course from your custom websites/frontend
Use this end point to redirect Trainees from your custom websites/frontend to a Course inside the LMS.
POST https://{your.lms.custom.domain}/site/login-by-jwt-token
Request body parameters
Field | Type | Description |
---|---|---|
token required | string | Token |
type required | integer | If you are passing token of Admin/Manager then type = 1 If you are passing token of Trainee then type = 2 |
inputData required | jsonArray | If type = 1 than inputData = { "enrollmentId": 12555 } If type = 2 than inputData = { "enrollmentId": 12555 } |
- Sample
<form action="https://{your.lms.custom.domain}/site/login-by-jwt-token" id="logintoalms0" method="post">
<input type="hidden" id="token" name="token" value="******">
<input type="hidden" id="inputData" name="inputData" value={ "enrollmentId" : 12555 }>
<input type="hidden" id="type" name="type" value="2">
<a href="#" class="btn" onclick="submitForm(0)">View</a>
</form>
Forgot Password
Use this API to send a password reset link via email.
POST /authorize/forgot-password
Request body parameters
Field | Type | Description |
---|---|---|
email required | string | Email Address |
domain | string | Custom Domain of your account. e.g.: lms.example.com |
sendEmailNotification | boolean | 1 = Yes, 2 = No (Default) |
- Response
- Schema
- Error Codes
{
"success": true,
"data": {
"response": {
"acknowledgement": "Success",
"data": {
"token": "********************"
},
"error": {
"code": "",
"internal_message": "",
"moreInfo": []
}
}
}
}
Field | Type | Description |
---|---|---|
token | string | Authentication token for the user. |
Code | Description |
---|---|
1001 | "Missing email" |
1002 | "Invalid email" |
For general error details, click here.