> ## Documentation Index
> Fetch the complete documentation index at: https://docs.exode.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Список курсов

> Получение списка курсов школы с фильтрацией и пагинацией

## Заголовки запроса

<ParamField header="Authorization" type="string" required>
  API токен сервисного пользователя в формате Bearer. Получите токен в панели администратора школы. Формат: `Bearer YOUR_TOKEN`.
</ParamField>

<ParamField header="Seller-Id" type="string" required>
  Уникальный идентификатор продавца в системе. Используется для разграничения доступа между разными продавцами.
</ParamField>

<ParamField header="School-Id" type="string" required>
  Уникальный идентификатор школы в системе. Определяет контекст выполнения операции.
</ParamField>

```
GET /saas/v2/course/list/raw
```

<Info>
  Все параметры фильтрации необязательны. Параметры-массивы передаются повторением параметра в строке запроса:
  `courseIds=1&courseIds=2`.
</Info>

## Параметры запроса

### Пагинация

<ParamField query="skip" type="integer" required={false}>
  Количество записей, которые нужно пропустить. По умолчанию `0`.
</ParamField>

<ParamField query="page" type="integer" required={false}>
  Номер страницы (альтернатива `skip`). Начинается с `1`.
</ParamField>

<ParamField query="take" type="integer" required={false}>
  Количество записей на странице. От `1` до `1000`. По умолчанию `100`.
</ParamField>

### Фильтрация

<ParamField query="courseIds" type="integer[]" required={false}>
  Фильтр по ID курсов.
</ParamField>

<ParamField query="aliases" type="string[]" required={false}>
  Фильтр по символьным алиасам курсов.
</ParamField>

<ParamField query="types" type="enum[]" required={false}>
  Фильтр по типам курсов. Возможные значения: `Bundle`, `Webinar`, `TextCourse`, `Assessment`, `VideoCourse`,
  `PersonalLesson`.
</ParamField>

<ParamField query="tags" type="string[]" required={false}>
  Фильтр по тегам курса. До 50 символов на тег.
</ParamField>

<ParamField query="search" type="string" required={false}>
  Поиск по названию курса. Максимум 50 символов.
</ParamField>

<ParamField query="subjectCategoryIds" type="integer[]" required={false}>
  Фильтр по ID предметных категорий.
</ParamField>

<ParamField query="contentCategoryIds" type="integer[]" required={false}>
  Фильтр по ID контентных категорий.
</ParamField>

<ParamField query="archived" type="boolean" required={false}>
  Включить архивные курсы.
</ParamField>

<ParamField query="participation" type="enum" required={false}>
  Тип участия (относительно текущего сервисного пользователя): `All`, `Active`, `Completed`,
  `NotParticipant`.
</ParamField>

<ParamField query="manage" type="boolean" required={false}>
  Только курсы, доступные на управление.
</ParamField>

<ParamField query="administrate" type="boolean" required={false}>
  Только курсы, доступные на администрирование.
</ParamField>

<ParamField query="access" type="object" required={false}>
  Вложенный фильтр по доступам к продукту курса. Полный набор полей совпадает с фильтром метода
  [«Список доступов к продуктам»](/ru/exode-api/school/product-access/list) (например, `active`, `userIds`,
  `billingStatuses`, `expireAtDateRange`).
</ParamField>

<ParamField query="product" type="object" required={false}>
  Вложенный фильтр по продукту.

  <Expandable title="Свойства product">
    <ParamField query="productIds" type="integer[]">ID продуктов.</ParamField>
    <ParamField query="statuses" type="enum[]">Статусы: `Draft`, `OnCheck`, `Declined`, `ReadyToPublish`, `Published`.</ParamField>
    <ParamField query="currencies" type="enum[]">Валюты: `Free`, `Exes`, `Rub`, `Uzs`, `Kzt`, `Usd`, `Eur`.</ParamField>
    <ParamField query="showInCatalog" type="boolean">Показывается ли в каталоге.</ParamField>
    <ParamField query="isOnSale" type="boolean">В продаже ли продукт.</ParamField>
    <ParamField query="archived" type="boolean">Включать архивные.</ParamField>
    <ParamField query="search" type="string">Поиск по продукту (до 50 символов).</ParamField>
  </Expandable>
</ParamField>

## Поля ответа

<ResponseField name="payload" type="object">
  Постраничный список курсов (компактная проекция). Полная структура — в справочнике
  [`course`](/ru/exode-api/objects/entities/course).

  <Expandable title="Свойства payload">
    <ResponseField name="items" type="object[]">
      Массив курсов.

      <Expandable title="Свойства элемента">
        <ResponseField name="courseId" type="integer">ID курса.</ResponseField>

        <ResponseField name="productId" type="integer">
          ID продукта курса. Используется для связи с методами
          [доступов](/ru/exode-api/school/product-access/list) и [счетов](/ru/exode-api/school/invoice/list).
        </ResponseField>

        <ResponseField name="name" type="string">Название курса.</ResponseField>

        <ResponseField name="type" type="enum">
          Тип курса: `Bundle`, `Webinar`, `TextCourse`, `Assessment`, `VideoCourse`, `PersonalLesson`.
        </ResponseField>

        <ResponseField name="groupIds" type="integer[]">ID связанных групп курса.</ResponseField>
      </Expandable>
    </ResponseField>

    <ResponseField name="page" type="integer">Текущая страница.</ResponseField>
    <ResponseField name="count" type="integer">Общее количество записей.</ResponseField>
    <ResponseField name="pages" type="integer">Общее количество страниц.</ResponseField>
    <ResponseField name="isFirst" type="boolean">Признак первой страницы.</ResponseField>
    <ResponseField name="isLast" type="boolean">Признак последней страницы.</ResponseField>
    <ResponseField name="next" type="object">Параметры следующей страницы (`skip`, `take`, `page`).</ResponseField>
    <ResponseField name="prev" type="object">Параметры предыдущей страницы (`skip`, `take`, `page`).</ResponseField>
  </Expandable>
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --location 'https://api.exode.biz/saas/v2/course/list/raw?take=20&types=VideoCourse' \
    --header 'Seller-Id: {{ sellerId }}' \
    --header 'School-Id: {{ schoolId }}' \
    --header 'Authorization: Bearer YOUR_TOKEN'
  ```

  ```javascript Node.js theme={null}
  const axios = require('axios');

  const listCourses = async () => {
    const { data } = await axios.get('https://api.exode.biz/saas/v2/course/list/raw', {
      params: { take: 20, types: ['VideoCourse'] },
      headers: {
        'Seller-Id': '{{ sellerId }}',
        'School-Id': '{{ schoolId }}',
        'Authorization': 'Bearer YOUR_TOKEN',
      },
    });

    console.log(data.payload.items);
  };

  listCourses();
  ```

  ```php PHP theme={null}
  <?php

  $url = 'https://api.exode.biz/saas/v2/course/list/raw?take=20&types=VideoCourse';
  $headers = [
    'Seller-Id: {{ sellerId }}',
    'School-Id: {{ schoolId }}',
    'Authorization: Bearer YOUR_TOKEN'
  ];

  $ch = curl_init();
  curl_setopt($ch, CURLOPT_URL, $url);
  curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
  curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

  echo curl_exec($ch);
  curl_close($ch);
  ?>
  ```

  ```python Python theme={null}
  import requests

  url = 'https://api.exode.biz/saas/v2/course/list/raw'
  headers = {
    'Seller-Id': '{{ sellerId }}',
    'School-Id': '{{ schoolId }}',
    'Authorization': 'Bearer YOUR_TOKEN'
  }

  response = requests.get(url, params={ 'take': 20, 'types': ['VideoCourse'] }, headers=headers)
  print(response.json())
  ```

  ```bsl 1С theme={null}
  Соединение = Новый HTTPСоединение("api.exode.biz", 443, , , , 30, Новый OpenSSLSecureConnection);

  Запрос = Новый HTTPЗапрос("/saas/v2/course/list/raw?take=20&types=VideoCourse");
  Запрос.Заголовки.Вставить("Seller-Id", "{{ sellerId }}");
  Запрос.Заголовки.Вставить("School-Id", "{{ schoolId }}");
  Запрос.Заголовки.Вставить("Authorization", "Bearer YOUR_TOKEN");

  Ответ = Соединение.ВызватьHTTPМетод("GET", Запрос);

  Если Ответ.КодСостояния = 200 Тогда
      ЧтениеJSON = Новый ЧтениеJSON;
      ЧтениеJSON.УстановитьСтроку(Ответ.ПолучитьТелоКакСтроку());
      Результат = ПрочитатьJSON(ЧтениеJSON);
      Сообщить("Список курсов получен");
  Иначе
      Сообщить("Ошибка: HTTP " + Ответ.КодСостояния);
      Сообщить(Ответ.ПолучитьТелоКакСтроку());
  КонецЕсли;
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "success": true,
    "code": 200,
    "payload": {
      "page": 1,
      "count": 1,
      "pages": 1,
      "isFirst": true,
      "isLast": true,
      "items": [
        {
          "courseId": 10,
          "productId": 838,
          "name": "Подготовка к экзамену",
          "type": "VideoCourse",
          "groupIds": [
            501,
            502
          ]
        }
      ],
      "next": {
        "skip": 20,
        "take": 20,
        "page": 2
      },
      "prev": {
        "skip": 0,
        "take": 20,
        "page": 1
      }
    }
  }
  ```
</ResponseExample>

## Требования к правам доступа

<Check>
  Требуется аутентификация по токену и одно из прав: куратор курса (`CourseCurator`) или управление
  пользователями школы (`SchoolManageUsers`).
</Check>
