gamification.schema

Scope: gamification

Кто может вызывать: Любой авторизованный пользователь. Подробнее: Права доступа

Машиночитаемое описание REST API модуля: все методы с HTTP-методом, правами, параметрами, кодами ошибок и кратким описанием ответа. Список методов строится по контроллерам (то, что действительно вызывается), описание параметров — по справочнику модуля.

HTTP: GET

Побочные эффекты: нет.

Параметры метода

Параметры отсутствуют.

Возвращаемые данные

result.result:

Поле Тип Описание
scope string gamification
prefix string gamification.
module string ithive.gamification
moduleVersion string Установленная версия модуля
fetchAllMax int Защитный лимит fetchAll
access object Расшифровка значений access у методов: authorized, adminOrManager, moduleWrite
methods array Методы по алфавиту: method, http, access, params (name, type, required, description), errors (code, description), returns, controller, action

Параметры, доступные только администратору портала, помечены в description словами «Administrator only».

Обработка ошибок

Справочник кодов ошибок.

Код Описание
UNAUTHORIZED Пользователь не авторизован
INTERNAL_ERROR Внутренняя ошибка

Пример запроса (GET)

curl "https://{портал}/rest/{user_id}/{webhook_code}/gamification.schema.json"
        

Пример ответа (сокращён):

{
          "result": {
            "result": {
              "scope": "gamification",
              "prefix": "gamification.",
              "module": "ithive.gamification",
              "moduleVersion": "12.1.3",
              "fetchAllMax": 5000,
              "access": { "authorized": "Any authorized user", "adminOrManager": "Portal administrator or module manager", "moduleWrite": "Right to change the module settings (module access above \"read\"; the portal administrator has it)" },
              "methods": [
                {
                  "method": "gamification.thanks.send",
                  "http": "POST",
                  "access": "authorized",
                  "params": [
                    { "name": "toUserId", "type": "int", "required": true, "description": "Recipient, an active user (aliases: to_user_id, userId, USER_ID)" },
                    { "name": "fromUserId", "type": "int", "required": false, "description": "Administrator only: sender, an active user; default - the current user" }
                  ],
                  "errors": [ { "code": "USER_NOT_FOUND", "description": "Sender or recipient not found or inactive" } ],
                  "returns": "transactionId, creditTransactionId, new_balance, fromUserId, toUserId, categoryId, cost, currency, recipientCurrency, postId",
                  "controller": "Thanks",
                  "action": "sendAction"
                }
              ]
            },
            "total": null,
            "next": null,
            "error": null
          }
        }
        

См. также

Следующая