# SafetyCulture Training

> Run mobile training in SafetyCulture Training (formerly EdApp): assign courses, reset progress, and follow enrollments, lesson attempts, scores and leaderboards.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/safetyculture-training

## Actions

### Assign a course

Assign a course to users, groups or sites, keeping its other assignments.

**Inputs**

- Course (`course_id`, text, required): The course.
- Users (`person_ids`, list): Users.
- Groups (`group_ids`, list): Groups.
- Site IDs (`site_ids`, list): Site IDs.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "groupsUpdated": 1,
    "sitesUpdated": 1,
    "usersUpdated": 1
  }
}
```

### Get a lesson

Read one lesson's details.

**Inputs**

- Lesson ID (`lesson_id`, text, required): The lesson's ID.
- Language (`locale`, text): The language to return it in, such as `en`.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "createdDatetime": "example",
    "description": "example",
    "externalId": "example",
    "id": "example",
    "modifiedDatetime": "example",
    "title": "example"
  }
}
```

### Get a user's lesson progress

Read one user's progress in each lesson: opened, completed and score.

**Inputs**

- User (`person_id`, text, required): The user.
- Course (`course_id`, text): Only lessons in this course.
- Changed after (`changed_after`, date and time): Only progress changed from this time on.
- Changed before (`changed_before`, date and time): Only progress changed up to this time.
- Page size (`page_size`, number): How many lessons per page, up to 1,000. 25 if left empty. From 1 to 1000.
- Page token (`page_token`, text): To read the next page, the next_page_token a previous step returned.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "course_id": "example",
        "lesson_completed": true,
        "lesson_completed_at": "example",
        "lesson_id": "example",
        "lesson_opened": true,
        "lesson_opened_at": "example",
        "lesson_score": 1,
        "user_id": "example"
      }
    ],
    "next_page_token": "example"
  }
}
```

### Get course statistics

How many people have each course, and how many opened and completed it.

**Inputs**

- Course (`course_id`, text): Only this course.
- Page size (`page_size`, number): How many courses per page, up to 1,000. 25 if left empty. From 1 to 1000.
- Page token (`page_token`, text): To read the next page, the next_page_token a previous step returned.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "completed_count": 1,
        "course_id": "example",
        "opened_count": 1,
        "total_users": 1
      }
    ],
    "next_page_token": "example"
  }
}
```

### Get leaderboard rankings

Read the rankings of an individual leaderboard.

**Inputs**

- Leaderboard (`leaderboard_id`, text, required): The leaderboard.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "leaderboardEndDate": "example",
    "leaderboardId": "example",
    "leaderboardName": "example",
    "leaderboardStartDate": "example",
    "rankings": [
      {
        "isNotAttempted": true,
        "participantId": "example",
        "participantName": "example",
        "rank": 1,
        "totalScore": 1
      }
    ]
  }
}
```

### Get lesson statistics

How many people opened and completed each lesson.

**Inputs**

- Course (`course_id`, text): Only this course's lessons.
- Page size (`page_size`, number): How many lessons per page, up to 1,000. 25 if left empty. From 1 to 1000.
- Page token (`page_token`, text): To read the next page, the next_page_token a previous step returned.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "completed_count": 1,
        "course_id": "example",
        "lesson_id": "example",
        "opened_count": 1
      }
    ],
    "next_page_token": "example"
  }
}
```

### List a collection's courses

List the courses in a collection.

**Inputs**

- Collection (`collection_id`, text, required): The collection.
- Include drafts (`include_draft`, true/false): Whether to include draft courses.
- Page (`page`, number): Which page of courses to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many courses per page, up to 1,000. 25 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "createdDatetime": "example",
        "description": "example",
        "dueBy": "example",
        "duration": 1,
        "externalId": "example",
        "id": "example",
        "isMandatory": true,
        "isPublished": true,
        "isRecurring": true,
        "lessonCount": 1,
        "locale": "example",
        "modifiedDatetime": "example",
        "publishedDatetime": "example",
        "publishedVersionNumber": 1,
        "status": "example",
        "thumbnailUrl": "example",
        "title": "example"
      }
    ],
    "page": 1,
    "total_count": 1
  }
}
```

### List a course's lessons

List the lessons in a course.

**Inputs**

- Course (`course_id`, text, required): The course.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "lessons": [
      {
        "description": "example",
        "externalId": "example",
        "id": "example",
        "minimumScore": 1,
        "status": "example",
        "title": "example"
      }
    ]
  }
}
```

### List collections

List the organization's course collections.

**Inputs**

- Changed since (`modified_since`, date and time): Only collections changed since this time.
- Page (`page`, number): Which page of collections to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many collections per page, up to 1,000. 25 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "createdDatetime": "example",
        "description": "example",
        "externalId": "example",
        "id": "example",
        "modifiedDatetime": "example",
        "numberOfCourses": 1,
        "status": "example",
        "thumbnailUrl": "example",
        "title": "example"
      }
    ],
    "page": 1,
    "total_count": 1
  }
}
```

### List course enrollments

List who is enrolled in which courses, with start, due and completion expiry dates.

**Inputs**

- User (`person_id`, text): Only this user's enrollments.
- Course (`course_id`, text): Only this course's enrollments.
- Page size (`page_size`, number): How many enrollments per page, up to 1,000. 25 if left empty. From 1 to 1000.
- Page token (`page_token`, text): To read the next page, the next_page_token a previous step returned.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "completion_expiry_at": "example",
        "course_id": "example",
        "due_at": "example",
        "start_at": "example",
        "user_id": "example"
      }
    ],
    "next_page_token": "example"
  }
}
```

### List courses

List the organization's training courses, or find them by words, user, group or change date.

**Inputs**

- Search (`search`, text): Only courses matching these words.
- User (`person_id`, text): Only courses this user is enrolled in.
- Groups (`group_ids`, list): Only courses assigned to these groups, directly or through a path.
- Changed since (`modified_since`, date and time): Only courses changed since this time.
- Published only (`published_only`, true/false): Yes for only published courses.
- Language (`locale`, text): The language to return courses in, such as `en`.
- Page (`page`, number): Which page of courses to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many courses per page, up to 1,000. 25 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "createdDatetime": "example",
        "description": "example",
        "dueBy": "example",
        "duration": 1,
        "externalId": "example",
        "id": "example",
        "isMandatory": true,
        "isPublished": true,
        "isRecurring": true,
        "lessonCount": 1,
        "locale": "example",
        "modifiedDatetime": "example",
        "publishedDatetime": "example",
        "publishedVersionNumber": 1,
        "status": "example",
        "thumbnailUrl": "example",
        "title": "example"
      }
    ],
    "page": 1,
    "total_count": 1
  }
}
```

### List groups

List the organization's groups.

**Inputs**: None.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "groups": [
      {
        "id": "example",
        "name": "example"
      }
    ]
  }
}
```

### List leaderboards

List the organization's individual leaderboards.

**Inputs**

- Page (`page`, number): Which page of leaderboards to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many leaderboards per page, up to 1,000. 25 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "endDate": "example",
        "id": "example",
        "learnerAccess": true,
        "name": "example",
        "participantGroupId": "example",
        "startDate": "example"
      }
    ],
    "page": 1,
    "total_count": 1
  }
}
```

### List learning paths

List the organization's learning paths.

**Inputs**

- Page (`page`, number): Which page of paths to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many paths per page, up to 1,000. 25 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "id": "example",
        "isPublished": true,
        "title": "example"
      }
    ],
    "page": 1,
    "total_count": 1
  }
}
```

### List lesson attempts

List people's attempts at lessons, with scores and whether they passed.

**Inputs**

- User (`person_id`, text): Only this user's attempts.
- Course (`course_id`, text): Only attempts in this course.
- Lesson ID (`lesson_id`, text): Only attempts at this lesson.
- Started after (`started_after`, date and time): Only attempts started from this time on.
- Finished before (`completed_before`, date and time): Only attempts finished up to this time.
- Page size (`page_size`, number): How many attempts per page, up to 1,000. 25 if left empty. From 1 to 1000.
- Page token (`page_token`, text): To read the next page, the next_page_token a previous step returned.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "attempt_id": "example",
        "completed_datetime": "example",
        "course_id": "example",
        "lesson_id": "example",
        "score": 1,
        "started_datetime": "example",
        "success": true,
        "user_id": "example"
      }
    ],
    "next_page_token": "example"
  }
}
```

### List lesson progress events

List lesson events across the organization, such as lessons opened and completed.

**Inputs**

- Course (`course_id`, text): Only events in this course.
- After (`after`, date and time): Only events from this time on.
- Before (`before`, date and time): Only events up to this time. Now if left empty.
- Page size (`page_size`, number): How many events per page, up to 1,000. 25 if left empty. From 1 to 1000.
- Page token (`page_token`, text): To read the next page, the next_page_token a previous step returned.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "course_id": "example",
        "event_date_time": "example",
        "event_name": "example",
        "lesson_id": "example",
        "lesson_score": 1,
        "user_id": "example"
      }
    ],
    "next_page_token": "example"
  }
}
```

### List Rapid Refreshes

List the organization's Rapid Refresh quizzes.

**Inputs**

- Title (`title`, text): Only Rapid Refreshes with this title.
- Status (`status`, text): Only Rapid Refreshes in this state. One of: `all`, `draft`, `scheduled`, `in-progress` (In progress), `ended`.
- Page (`page`, number): Which page of Rapid Refreshes to read, starting at 1. At least 1.
- Page size (`page_size`, number): How many Rapid Refreshes per page, up to 1,000. 25 if left empty. From 1 to 1000.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "count": 1,
    "has_next_page": true,
    "items": [
      {
        "description": "example",
        "endDate": "example",
        "id": "example",
        "schedule": "example",
        "startDate": "example",
        "status": "example",
        "title": "example"
      }
    ],
    "page": 1,
    "total_count": 1
  }
}
```

### List users

List the organization's active users.

**Inputs**

- Page size (`page_size`, number): How many users per page, up to 200. 50 if left empty. From 1 to 200.
- Page token (`page_token`, text): To read the next page, the next_page_token a previous step returned.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "count": 1,
    "items": [
      {
        "created_at": "example",
        "email": "example",
        "first_name": "example",
        "last_name": "example",
        "locale": "example",
        "status": "example",
        "timezone": "example",
        "user_id": "example",
        "username": "example"
      }
    ],
    "next_page_token": "example"
  }
}
```

### Reset course progress

Clear users' progress in a course so they start it again.

**Inputs**

- Course (`course_id`, text, required): The course.
- Users (`person_ids`, list, required): The users whose progress to reset.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {}
}
```

### Unassign a course

Take a course away from users, groups or sites, keeping its other assignments.

**Inputs**

- Course (`course_id`, text, required): The course.
- Users (`person_ids`, list): Users.
- Groups (`group_ids`, list): Groups.
- Site IDs (`site_ids`, list): Site IDs.

**Outputs**

- `data` (object): The response from SafetyCulture Training.

**Example output**

```json
{
  "data": {
    "groupsUpdated": 1,
    "sitesUpdated": 1,
    "usersUpdated": 1
  }
}
```
