Commitments (Lära)

TABLE OF CONTENTS
Commitment/create
Commitment/get
Commitment/edit
Commitment/getlist
Commitment/delete
Error code descriptions for commitment methods 

Commitments

A "commitment" is a training item or a training program assigned to a user who is subject to the requirements of a regulatory period. They are named "commitment" in the API.

Commitment/create

Creates a commitment
API call address : https://.../lmsapi/commitment/create

Request

Example of request call content to create a commitment:

{
  "userId": "ydsIWAnJo8WP4ZyJkQEkZA%3d%3d",
  "refId": "uprlbtvuqNuwmncYPu1ljg%3d%3d",
  "type": 0,
  "status": 0,
  "endDate": "2020-11-19T00:00:00.00",
  "billingId": "%2bcSfyhuuFvha809UcfbkJw%3d%3d",
  "adminCode": "0123456",
  "lastSubscriptionDate": "2020-11-19T00:00:00.00",
  "subscribableItemStartDate": "2020-11-19T00:00:00.00",
  "completionDate": "2020-11-19T00:00:00.00"
}

Field descriptions

Name 

Required

Comments/description

userId

X

Identifier of the user associated with the training commitment.
(String type)

refId

X

Identifier of the training item or training program associated with the commitment.
(String type)

type

X

Type of commitment.

  • 0 = Training item
  • 1 = Training program

(Number type)

status

 

Status of the commitment.

  • 0 = To do
  • 1 = Enrolled
  • 2 = Completed
  • 3 = Failed
  • 4 = Expired
  • 5 = Cancelled
  • 6 = Completed past deadline

(Number type)

endDate

 

Completion deadline of the commitment. Optional; no date limit if omitted.

If the time specified is midnight, it is automatically converted to 23:59:59.

(String YYYY-MM-DDTHH:MM:SSZ)

billingId

 

Billing identifier of the enrolment in the training item or program associated with the commitment, if any. If the enrolment has not yet taken place, the link with the commitment will be made automatically upon enrolment.
(String type)

adminCode

 

Optional administrative code that can be added to the commitment, if needed.
(String type)

lastSubscriptionDate

 

Enrolment date in the training item or training program linked to the commitment.
(String YYYY-MM-DDTHH:MM:SSZ)

subscribableItemStartDate

 

Start date of the training session or of the cohort of the training program linked to the commitment.
(String YYYY-MM-DDTHH:MM:SSZ)

completionDate

 

Date on which the user completed the training item or training program linked to the commitment.
(String YYYY-MM-DDTHH:MM:SSZ)


Response

Example of the response call content for a request to create a commitment :

{
  "id": "7Zi3zYvuHTZ7YLK7TQjdlQ%3d%3d"
}

Field descriptions

Name 

Required

Comments/description

id
Unique identifier of the commitment.
(String type)

Commitment/get

Retrieves information about a commitment.
API call address : https://.../lmsapi/commitment/get

Request

Example of request call content for information about a commitment:

{
  "id": "7Zi3zYvuHTZ7YLK7TQjdlQ%3d%3d"
}

Field descriptions

Name 

Required

Comments/description

idXUnique identifier of the commitment.
(String type)

Response

Example of the response call content for a request for information about a commitment :

{
    "id": "7Zi3zYvuHTZ7YLK7TQjdlQ%3d%3d",
    "userId": "qVu6jdhV0YxmT%2fqd3Wxx7w%3d%3d",
    "refId": "9prKhciDYOdZLT4JQTZfXg%3d%3d",
    "type": 0,
    "status": 0,
    "creationDate": "2022-09-29T08:48:43.927",
    "adminCode": "2024-01",
    "endDate": "2023-12-31T23:59:59",
    "billingId": "JK63ARb9yPZ5tpmS%2bq7jmw%3d%3d",
    "lastSubscriptionDate": "0001-01-01T00:00:00",
    "subscribableItemStartDate": "0001-01-01T00:00:00",
    "lastModificationDate": "2024-04-08T16:02:36.14",
    "completionDate": "0001-01-01T00:00:00"
}

Field descriptions

Name 

Required

Comments/description

id


Unique identifier of the commitment.

(String type)

userId

  

Unique identifier of the user associated with the commitment.
(String type)

refId

 

Identifier of the training item or training program associated with the commitment.
(String type)

type

 

Type of commitment:

  • 0 = Training item
  • 1 = Training program

(Number type)

status

 

Status of the commitment.

  • 0 = To do
  • 1 = Enrolled
  • 2 = Completed
  • 3 = Failed
  • 4 = Expired
  • 5 = Cancelled
  • 6 = Completed past deadline

(Number type)

creationDate


Date on which the user completed the training item or training program linked to the commitment.
(String YYYY-MM-DDTHH:MM:SSZ)
adminCode

Optional administrative code that can be added to the commitment, if needed.
(String type)

endDate

 

Completion deadline of the commitment. Optional; no date limit if omitted.

If the time specified is midnight, it is automatically converted to 23:59:59.

(String YYYY-MM-DDTHH:MM:SSZ)

billingId

 

Unique identifier of the enrolment in the training item or program associated with the commitment. 

If the commitment was created without a "billingId" initially, the ID JK63ARb9yPZ5tpmS%2bq7jmw%3d%3d will be returned in this field

(String type)

lastSubscriptionDate

 

Enrolment date in the training item or training program linked to the commitment.

(String YYYY-MM-DDTHH:MM:SSZ)

subscribableItemStartDate

 

Start date of the training session or of the cohort of the training program linked to the commitment.

(String YYYY-MM-DDTHH:MM:SSZ)

lastModificationDate

 

Date of the last modification of the commitment.

Cannot be modified. Available in /get and /getlist.

completionDate

Date on which the user completed the training item or training program linked to the commitment.
(String YYYY-MM-DDTHH:MM:SSZ)

Commitment/edit

Modifies a commitment
API call address : https://.../lmsapi/commitment/edit

Request

Example of request call content to modify a commitment:

{
    "id": "vrj0IrWe0HF%2bK9OKGpDF5A%3d%3d",
    "userId": "qVu6jdhV0YxmT%2fqd3Wxx7w%3d%3d",
    "refId": "9prKhciDYOdZLT4JQTZfXg%3d%3d",
    "type": 0,
    "status": 0,
    "creationDate": "2022-09-29T08:48:43.927",
    "adminCode": "",
    "endDate": "2023-12-31T23:59:59",
    "lastSubscriptionDate": "0001-01-01T00:00:00",
    "subscribableItemStartDate": "0001-01-01T00:00:00",
    "lastModificationDate": "2024-04-08T16:02:36.14",
    "completionDate": "0001-01-01T00:00:00"
}

Field descriptions

Name 

Required

Comments/description

id

X

Unique identifier of the commitment.

(String type)

userId

  

Unique identifier of the user associated with the commitment.
(String type)

refId

 

Identifier of the training item or training program associated with the commitment.
(String type)

type

 

Type of commitment:

  • 0 = Training item
  • 1 = Training program

(Number type)

status

 

Status of the commitment.

  • 0 = To do
  • 1 = Enrolled
  • 2 = Completed
  • 3 = Failed
  • 4 = Expired
  • 5 = Cancelled
  • 6 = Completed past deadline

(Number type)

creationDate


Date on which the user completed the training item or training program linked to the commitment.
(String YYYY-MM-DDTHH:MM:SSZ)
adminCode

Optional administrative code that can be added to the commitment, if needed.
(String type)

endDate

 

Completion deadline of the commitment. Optional; no date limit if omitted.

If the time specified is midnight, it is automatically converted to 23:59:59.

(String YYYY-MM-DDTHH:MM:SSZ)

billingId

 

Unique identifier of the enrolment in the training item or program associated with the commitment. 

If the commitment was created without a "billingId" initially, the ID JK63ARb9yPZ5tpmS%2bq7jmw%3d%3d will be returned in this field

(String type)

lastSubscriptionDate

 

Enrolment date in the training item or training program linked to the commitment.

(String YYYY-MM-DDTHH:MM:SSZ)

subscribableItemStartDate

 

Start date of the training session or of the cohort of the training program linked to the commitment.

(String YYYY-MM-DDTHH:MM:SSZ)

lastModificationDate

 

Date of the last modification of the commitment.

Cannot be modified. Available in /get and /getlist.

completionDate

Date on which the user completed the training item or training program linked to the commitment.
(String YYYY-MM-DDTHH:MM:SSZ)

Response

Example of the response call content for a request to create a commitment :

{
   "id": "vrj0IrWe0HF%2bK9OKGpDF5A%3d%3d"
}

Field descriptions

Name 

Required

Comments/description

id
Unique identifier of the commitment.
(String type)

Commitment/getlist

Retrieves information about a list of commitments.
API call address : https://.../lmsapi/commitment/getlist

Request

Example of request call content for information about a list of commitments:

{
  "id": "7Zi3zYvuHTZ7YLK7TQjdlQ%3d%3d",
  "filterDate": “YYYY-MM-DDTHH:MM:SSZ”,
  "filterEditDate": “YYYY-MM-DDTHH:MM:SSZ” 
}

Field descriptions

Name 

Required

Comments/description

id
Unique identifier of a user. Returns only the list of commitments associated with that user.
(String type)
filterDate

Filter by creation date. Returns the list of commitments created since a specific date.
(String YYYY-MM-DDTHH:MM:SSZ)

filterEditDate

Filter by modification date. Returns the list of commitments modified since a specific date.
(String YYYY-MM-DDTHH:MM:SSZ)

Response

Example of the response call content for a request for information about a list of commitments :

[
  {
    "id": "O%2f9dsKKECyJSUWkOK37D8g%3d%3d",
    "userId": "WvBFs9k%2f2p4hmaknUWkVVw%3d%3d",
    "refId": "cJWXAHaVdVaGt3eXQiEGEg%3d%3d",
    "type": 0,
    "adminCode": "imcgmwuovboh",
    "status": 1,
    "endDate": "2020-11-19T00:00:00.00",
    "billingId": "JK63ARb9yPZ5tpmS%2bq7jmw%3d%3d",
    "creationDate": "2020-03-17T16:52:31.12",
    "lastSubscriptionDate": "2020-11-19T00:00:00.00",
    "subscribableItemStartDate": "2020-11-19T00:00:00.00",
    "completionDate": "2020-11-19T00:00:00.00",
    "lastModificationDate": "2020-11-19T00:00:00.00"

  },
  {
    "id": "jt9UU9fr%2fppeVdmulnSbPQ%3d%3d",
    "userId": "F6%2bqPOvBhdlId44nKxIzmA%3d%3d",
    "refId": "EBwrsZvF4YW4IW0FgftpzQ%3d%3d",
    "type": 0,
    "adminCode": "gtgmbojfzwoa",
    "status": 1,
    "endDate": "2020-11-19T00:00:00.00",
    "billingId": "JK63ARb9yPZ5tpmS%2bq7jmw%3d%3d",
    "creationDate": "2020-03-17T16:52:32.653",
    "lastSubscriptionDate": "2020-11-19T00:00:00.00",
    "subscribableItemStartDate": "2020-11-19T00:00:00.00",
    "completionDate": "2020-11-19T00:00:00.00",
    "lastModificationDate": "2020-11-19T00:00:00.00"
  },
  {
    "id": "gnE3CSJVXko2bvXkiumEgw%3d%3d",
    "userId": "6d7yavtJwLemtOAO2HF5BQ%3d%3d",
    "refId": "0Yr7aeSRuUdZN6H7YzHhdw%3d%3d",
    "type": 0,
    "adminCode": "gadzjedecdxt",
    "status": 1,
    "endDate": "2020-11-19T00:00:00.00",
    "billingId": "JK63ARb9yPZ5tpmS%2bq7jmw%3d%3d",
    "creationDate": "2020-03-17T16:55:19.843",
    "lastSubscriptionDate": "2020-11-19T00:00:00.00",
    "subscribableItemStartDate": "2020-11-19T00:00:00.00",
    "completionDate": "2020-11-19T00:00:00.00",
    "lastModificationDate": "2020-11-19T00:00:00.00"
  }
]

Field descriptions

Name 

Required

Comments/description

id


Unique identifier of the commitment.

(String type)

userId

  

Unique identifier of the user associated with the commitment.
(String type)

refId

 

Identifier of the training item or training program associated with the commitment.
(String type)

type

 

Type of commitment:

  • 0 = Training item
  • 1 = Training program

(Number type)

adminCode

Optional administrative code that can be added to the commitment, if needed.
(String type)

status

 

Status of the commitment.

  • 0 = To do
  • 1 = Enrolled
  • 2 = Completed
  • 3 = Failed
  • 4 = Expired
  • 5 = Cancelled
  • 6 = Completed past deadline

(Number type)

endDate

Completion deadline of the commitment. Optional; no date limit if omitted.

If the time specified is midnight, it is automatically converted to 23:59:59.
(String YYYY-MM-DDTHH:MM:SSZ)

billingId


Unique identifier of the enrolment in the training item or program associated with the commitment. 

If the commitment was created without a "billingId" initially, the ID JK63ARb9yPZ5tpmS%2bq7jmw%3d%3d will be returned in this field.
(String type)

creationDate


Date on which the user completed the training item or training program linked to the commitment.
(String YYYY-MM-DDTHH:MM:SSZ)

lastSubscriptionDate

 

Enrolment date in the training item or training program linked to the commitment.

(String YYYY-MM-DDTHH:MM:SSZ)

subscribableItemStartDate

 

Start date of the training session or of the cohort of the training program linked to the commitment.

(String YYYY-MM-DDTHH:MM:SSZ)

lastModificationDate

 

Date of the last modification of the commitment.

Cannot be modified. Available in /get and /getlist.

completionDate

Date on which the user completed the training item or training program linked to the commitment.
(String YYYY-MM-DDTHH:MM:SSZ)

Commitment/delete

Deletes a commitment.
API call address : https://.../lmsapi/commitment/delete

Request

Example of request call content to delete a commitment:

{
   "id": "O%2f9dsKKECyJSUWkOK37D8g%3d%3d"
}

Field descriptions

Name 

Required

Comments/description

id
Unique identifier of the commitment.
(String type)

Response

Example of the response call content for a request to delete a commitment :

{
   "id": "O%2f9dsKKECyJSUWkOK37D8g%3d%3d"
}

Field descriptions

NameRequiredComment/description
id

Unique identifier of the commitment.
(String type)

Error code descriptions for commitment methods 

Number

Message

Comments/description

1600

RequiredId

You must provide an identifier for the commitment.

1601

InvalidId

The identifier provided for the commitment is invalid.

1602

RequiredUserId

At least one of the two search parameters must be sent.

1603

InvalidUserId

The identifier provided for the user is invalid.

1604

RequiredRefId

You must provide an identifier for the training item or the training program.

1605

InvalidRefId

The identifier provided for the training item or the training program is invalid.

1606

RequiredType

You must provide a type of commitment.

1607

InvalidType

The type of commitment provided is invalid.

1608

InvalidStatus

The status provided is invalid.

1609

InvalidBillingId

The billing identifier of the enrolment is invalid.

Did you find it helpful? Yes No

Send feedback
Sorry we couldn't be helpful. Help us improve this article with your feedback.