Rightwork OG Image
Browse API documentation
API docsLegacy API

Retrieve LMS statistics

Get the number of learning tracks assigned to and completed by each employee in a company.

Request

GET https://getrightwork.dev/api/store_info/get_lms_stats

Send your legacy access token in the Authorization: Token <your-access-token> header.

Query parameters

ParameterTypeDescription
company_nameStringName of the company (required)

Python example

Python
import requests

# Use the access_token returned by the legacy login request.
def call_lms_stats_api(company_name, access_token):
    url = "https://getrightwork.dev/api/store_info/get_lms_stats"
    headers = {
        "Authorization": f"Token {access_token}",
        "Content-Type": "application/json"
    }
    params = {
        "company_name": company_name
    }
    response = requests.get(url, headers=headers, params=params)
    if response.status_code == 200:
        print("Successfully retrieved LMS stats")
        return response.json()
    else:
        raise Exception(f"Failed to retrieve LMS stats: {response.status_code} - {response.text}")

# Example usage:
company_name = "AcmeCorp"
lms_stats = call_lms_stats_api(company_name, access_token)
print(lms_stats)

Response

A successful response will return a JSON object with the following fields for each employee:

FieldTypeDescription
store_idIntegerID of the store
store_nameStringName of the store
employee_idIntegerID of the employee
first_nameStringFirst name of the employee
last_nameStringLast name of the employee
tracks_assignedIntegerNumber of learning tracks assigned to the user
tracks_completedIntegerNumber of learning tracks completed by the user