Show / Hide Table of Contents

    Training

    This article documents how to perform actions via the API relating to training. Ensure that the appropriate authentication headers are configured when sending these requests.

    Service location

    The endpoint you need to use is based on which environment is hosting your PACE system. You can find this out by checking your normal login link. Make your selection below and all examples will be tailored to your environment.

    Schema

    Training records will be returned in the following format

    {
        "UserId": string,
        "FullName": string,
        "UserGuid": Guid,
        "IsLocked": boolean,
        "UserStatus": string,               // Active | Archived | Suspended | Long term absent
        "ParentOrganisation": string,
        "Organisation": string,
        "Programme": string,
        "CreatedDate": DateTime,
        "CompletedDate": nullable DateTime,
        "Progress": string,                 // Started | Finished
        "TestScore": nullable decimal
    }
    

    Retrieve all training

    get api/training

    This action will return all assessment instances within your PACE Administration system. This action also supports the Pagination of records functionality.

    Example request

    Send a GET request to https://online.cardinus.com/api/Training. This will produce a result object containing a summary of the data and a collection of user instances from the database.

    Example response

    {
        "PageNumber": 1,
        "PageSize": 100,
        "FirstPage": "https://online.cardinus.com/api/Training?pageNumber=1&pageSize=100",
        "LastPage": "https://online.cardinus.com/api/Training?pageNumber=43&pageSize=100",
        "TotalPages": 43,
        "TotalRecords": 4266,
        "NextPage": "https://online.cardinus.com/api/Training?pageNumber=2&pageSize=100",
        "PreviousPage": null,
        "ItemsCount": 100,
        "Items": [
            {
                "UserId": "Brian McGee",
                "FullName": "Cardinus Admin",
                "UserGuid": "a8c2db28-46dc-4fdf-8d45-fd555f1dfd98",
                "IsLocked": false,
                "UserStatus": "Active",
                "ParentOrganisation": "Scotland",
                "Organisation": "Scottish Services",
                "Programme": "Healthy Working Plus",
                "CreatedDate": "2022-03-24T09:15:44.183",
                "CompletedDate": "2022-03-24T09:18:31.713",
                "Progress": "Finished",
                "TestScore": "100"
            },
            {
                "UserId": "swinfield",
                "FullName": "Sylvia Winfield",
                "UserGuid": "7f723d3c-4399-4944-bd78-4674e82389ea",
                "IsLocked": false,
                "UserStatus": "Active",
                "ParentOrganisation": "UK",
                "Organisation": "Head Office",
                "Programme": "Healthy Working Plus",
                "CreatedDate": "2022-03-24T09:31:13.077",
                "CompletedDate": "2022-03-24T09:32:05.923",
                "Progress": "Finished",
                "TestScore": "100"
            },
            etc...
        ],
        "Succeeded": true,
        "Errors": null,
        "Message": null
    }
    

    Retrieve training by user

    get api/training/{userid}

    This action will return training created for a specific user via the parameter passed in on the request. The parameter is the user's unique identifier in a GUID format.

    Parameter Description Location
    userid User ID in a GUID format URL

    Example request

    Send a GET request to https://online.cardinus.com/api/Training/{userid}. The resulting data will be a collection of training restricted to the given user.

    https://online.cardinus.com/api/Training/73434f42-a85d-ec11-811a-005056b147ee
    

    Example response

    {
        "Count": 1,
        "Items": [
            {
                "UserId": "bstorch",
                "FullName": "Brad Storch",
                "UserGuid": "73434f42-a85d-ec11-811a-005056b147ee",
                "IsLocked": false,
                "UserStatus": "Active",
                "ParentOrganisation": "N/A",
                "Organisation": "Unison",
                "Programme": "Healthy Working Plus",
                "CreatedDate": "2022-05-24T14:46:27.597",
                "CompletedDate": "2022-05-24T14:47:23.933",
                "Progress": "Finished",
                "TestScore": "100"
            }
        ]
    }
    

    Filter training

    post api/training/filter

    This action will retrieve all training depending on the parameters passed in the body. The body is in JSON format and providing no parameters will default to all training.

    Parameter Description Location
    assessment details The filtering query options to restrict the result set Request body
    Important

    The content-type header must be included and set to application/json.

    Example request

    Send a POST request to https://online.cardinus.com/api/Training/Filter with search criteria in the body as specified below. The response will contain filtered results. Each property is applied using the AND logical operator.

    The JSON schema including all the properties that can be used to filter data:

    {
        "UserId": string,    
        "Islocked": boolean,
        "UserStatus": string,
        "AssessmentName": string,
        "AssessmentStatus": string,
        "TrainingCompletedYesterday": boolean,
        "OnOrBeforeDate": DateTime,  // yyyy-MM-dd e.g. "2024-01-01"
        "OnOrAfterDate": DateTime,  // yyyy-MM-dd e.g. "2024-01-01"
        "ParentOrganisation": string,
        "Organisation": string,
        "ProgrammeName": string
    }
    

    For example, to retrieve only training associated with archived users you can use this filter:

    {
      "UserStatus": "archived"
    }
    

    Example response

    {
        "PageNumber": 1,
        "PageSize": 100,
        "FirstPage": "https://online.cardinus.com/api/Training/Filter?pageNumber=1&pageSize=100",
        "LastPage": "https://online.cardinus.com/api/Training/Filter?pageNumber=5&pageSize=100",
        "TotalPages": 5,
        "TotalRecords": 461,
        "NextPage": "https://online.cardinus.com/api/Training/Filter?pageNumber=2&pageSize=100",
        "PreviousPage": null,
        "ItemsCount": 100,
        "Items": [
            {
                "UserId": "bstorch",
                "FullName": "Brad Storch",
                "UserGuid": "73434f42-a85d-ec11-811a-005056b147ee",
                "IsLocked": false,
                "UserStatus": "Archived",
                "ParentOrganisation": "Scotland",
                "Organisation": "Scottish services",
                "Programme": "Manual Handling",
                "CreatedDate": "2022-03-31T10:27:42.39",
                "CompletedDate": "2022-03-31T10:52:26.117",
                "Progress": "Finished",
                "TestScore": "80"
            },
            {
                "UserId": "bstorch",
                "FullName": "Brad Storch",
                "UserGuid": "73434f42-a85d-ec11-811a-005056b147ee",
                "IsLocked": false,
                "UserStatus": "Archived",
                "ParentOrganisation": "Scotland",
                "Organisation": "Scottish services",
                "Programme": "Mental Health Awareness",
                "CreatedDate": "2022-01-27T11:48:37.057",
                "CompletedDate": null,
                "Progress": "Started",
                "TestScore": "N/A"
            },
            etc...
        ],
        "Succeeded": true,
        "Errors": null,
        "Message": null
    }
    

    Retrieve an overview of all training

    get api/training/overview

    This action will give an overview of relevant data for all training in the PACE Administration system.

    Example request

    Send a GET request to https://online.cardinus.com/api/training/overview with no parameters to get the overview of training data in your PACE system.

    Example response

    {  
        "Count": 2920
    }
    
    Theme Back to top