Categories (Lära)

TABLE OF CONTENTS
Category/get
Category/getlist
Category/create
Category/edit
Category/delete
Category error code descriptions

Categories

« Categories » are used to divide the training offering of your environment's catalogues into subjects, and are named « category » in the API.

Category/get

Retrieves information about a category in your environment.
API call address : https://.../lmsapi/category/get

Request

Example of request call content for information on a category:

{
"id": "I2Oa5s9JDCGvE7BtvUfxrg%3d%3d"
}

Field descriptions

Name

Required

Comments/description

idX

Unique identifier of the category.
(String type)

Response

Example of the response call content for an information request on a category:

{
    "id": "lp4DfdbpK095czV%2fCsyi1w%3d%3d",
    "name": {
        "texts": [
            {
                "text": "* Programmes de formation",
                "languageId": 1
            }
        ],
        "ErrorID": 0
    },
    "color": "C41230",
    "creationDate": "2019-07-09T13:33:11.51",
    "createdByUserID": "hyKnH0JSL7De3ohq7FSvPg%3d%3d"
}

Field descriptions

Name 

Required

Comments/description

id

Unique identifier of the category.
(String type)


name
- texts
- text
- languageId

Text: Title of the category.
(String type)

languageId: The title can be multilingual: 

  • 1 = French (Canada) 
  • 2 = English
  • 3 = Spanish

(Number type)

color
Hexadecimal code (without #) representing the colour of the category displayed in the catalogue.
creationDate

Date and time the category was created.

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

createdByUserID

Unique identifier of the user who created the category.
(String type)

Category/getlist

Retrieves information about a list of categories in your environment.
API call address : https://.../lmsapi/category/getlist

Request

Example of request call content for information on a list of categories:

{
  "filterDate": “YYYY-MM-DDTHH:MM:SSZ”
}

Field descriptions

Name

Required

Comments/description

filterDate

Creation date of the category. The call will return all categories created after that point in time.
(String YYYY-MM-DDTHH:MM:SSZ)

Response

Example of the response call content for an information request on a list of categories:

[
    {
        "id": "ruZdIJb9quVdLecBHCr3XQ%3d%3d",
        "name": {
            "texts": [
                {
                    "text": "Typographie",
                    "languageId": 1
                },
                {
                    "languageId": 2
                },
                {
                    "languageId": 3
                },
                {
                    "languageId": 4
                }
            ],
            "ErrorID": 0
        },
        "color": "005D63",
        "creationDate": "2019-07-09T13:33:43.427",
        "createdByUserID": "hyKnH0JSL7De3ohq7FSvPg%3d%3d"
    },
    {
        "id": "zPX7k7Km0Do8l2VO6H0fHQ%3d%3d",
        "name": {
            "texts": [
                {
                    "text": "Linguistique",
                    "languageId": 1
                },
                {
                    "languageId": 2
                },
                {
                    "languageId": 3
                },
                {
                    "languageId": 4
                }
            ],
            "ErrorID": 0
        },
        "color": "E0E622",
        "creationDate": "2019-07-09T13:34:12.333",
        "createdByUserID": "hyKnH0JSL7De3ohq7FSvPg%3d%3d"
    }
]

Field descriptions

Name 

Required

Comments/description

id

Unique identifier of the category.
(String type)


name
- texts
- text
- languageId

Text: Title of the category.
(String type)

languageId: The title can be multilingual: 

  • 1 = French (Canada) 
  • 2 = English
  • 3 = Spanish

(Number type)

color
Hexadecimal code (without #) representing the colour of the category displayed in the catalogue.
creationDate

Date and time the category was created.

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

createdByUserID

Unique identifier of the user who created the category.
(String type)

Category/create

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

Request

Example of request call content to create a category:

{
    "id": "lp4DfdbpK095czV%2fCsyi1w%3d%3d",
    "name": {
        "texts": [
            {
                "text": "Linguistique",
                "languageId": 1
            }
        ],
    },
    "color": "C41230",
}

Field descriptions

Name 

Required

Comments/description

idX

Unique identifier of the category.
(String type)

name
- texts
- text
- languageId
XText: Title of the category.
(String type)

languageId: The title can be multilingual: 

  • 1 = French (Canada) 
  • 2 = English
  • 3 = Spanish

(Number type)

colorXHexadecimal code (without #) representing the colour of the category displayed in the catalogue.

Response

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

{
    "id": "XWjS%2bHvCeZXlK7Tt7Lfoxg%3d%3d"
}

Field descriptions

Name 

Required

Comments/description

id

Unique identifier of the category.
(String type)

Category/edit

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

Request

Example of request call content to modify a category:

{
    "id": "lp4DfdbpK095czV%2fCsyi1w%3d%3d",
    "name": {
        "texts": [
            {
                "text": "Linguistique",
                "languageId": 1
            }
        ],
    },
    "color": "C41230",
}

Field descriptions

Name 

Required

Comments/description

idX

Unique identifier of the category.
(String type)

name
- texts
- text
- languageId
XText: Title of the category.
(String type)

languageId: The title can be multilingual: 

  • 1 = French (Canada) 
  • 2 = English
  • 3 = Spanish

(Number type)

color
Hexadecimal code (without #) representing the colour of the category displayed in the catalogue.

Response

Example of the response call content for a request to modify a category  :

{
    "id": "XWjS%2bHvCeZXlK7Tt7Lfoxg%3d%3d"
}

Field descriptions

Name 

Required

Comments/description

id

Unique identifier of the category.
(String type)

Category/delete

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

Request

Example of request call content to delete a category:

{
    "id": "lp4DfdbpK095czV%2fCsyi1w%3d%3d"
}

Field descriptions

Name 

Required

Comments/description

idX

Unique identifier of the category.
(String type)

Response

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

{
    "id": "lp4DfdbpK095czV%2fCsyi1w%3d%3d"
}

Field descriptions

Name 

Required

Comments/description

id

Unique identifier of the category.
(String type)

Category error code descriptions

Number

Message

Comments/description

800

Required id

You must provide an identifier for the category.

801

Invalid id

The identifier provided for the category is invalid.

802

Required color

You must provide a colour for the category.

803

Required name

You must provide a name for the category.

804

Invalid name length

The name provided must contain between 3 and 150 characters inclusively.

Did you find it helpful? Yes No

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