polls.schema

Scope: polls

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

Машиночитаемая схема всех методов polls.* (params, errors, HTTP).

HTTP: GET

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

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

Нет параметров.

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

Ответ в конверте модуля: result.result — объект схемы (scope, prefix, fetchAllMax, methods[] с полями method, http, params, errors, controller, action); result.error.

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

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

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

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

curl -G "https://{портал}/rest/{user_id}/{webhook_code}/polls.schema.json" \
          -H "Accept: application/json"
        

Описания в params[].description и errors[].description API отдаёт на английском (источник — MethodSchemaCatalog); в примере ниже — как в ответе, без перевода.

Пример ответа

{
          "result": {
            "result": {
              "scope": "polls",
              "prefix": "polls.",
              "batchMaxCalls": 0,
              "fetchAllMax": 5000,
              "methods": [
                {
                  "method": "polls.answer.add",
                  "http": "POST",
                  "controller": "Answer",
                  "action": "addAction",
                  "params": [
                    {
                      "name": "questionId",
                      "type": "int",
                      "required": true,
                      "description": "Parent question ID (required on add)"
                    },
                    {
                      "name": "message",
                      "type": "string",
                      "required": false,
                      "description": "Answer text; numeric string for NUMBER/SCALE types"
                    },
                    {
                      "name": "fieldType",
                      "type": "string",
                      "required": false,
                      "description": "Type xmlId or numeric ID from polls.answer.type.list"
                    },
                    {
                      "name": "active",
                      "type": "string",
                      "required": false,
                      "description": "Y/N or bool"
                    },
                    {
                      "name": "cSort",
                      "type": "int",
                      "required": false,
                      "description": "Sort (alias: sort)"
                    },
                    {
                      "name": "messageType",
                      "type": "string",
                      "required": false,
                      "description": "html, text, or num"
                    },
                    {
                      "name": "color",
                      "type": "string",
                      "required": false,
                      "description": "Answer color (hex)"
                    },
                    {
                      "name": "imageId",
                      "type": "int",
                      "required": false,
                      "description": "Image file ID"
                    },
                    {
                      "name": "comment",
                      "type": "int",
                      "required": false,
                      "description": "Comment mode enum ID (aliases: ufCommentSettings, UF_COMMENT_SETTINGS)"
                    },
                    {
                      "name": "fields",
                      "type": "object",
                      "required": false,
                      "description": "Optional wrapper for the same fields"
                    }
                  ],
                  "errors": [
                    {
                      "code": "UNAUTHORIZED",
                      "description": "User is not authorized"
                    },
                    {
                      "code": "INTERNAL_ERROR",
                      "description": "Internal server error"
                    },
                    {
                      "code": "ACCESS_DENIED",
                      "description": "Access denied"
                    },
                    {
                      "code": "VALIDATION_ERROR",
                      "description": "Invalid or missing parameter"
                    }
                  ]
                },
                {
                  "method": "polls.answer.delete",
                  "http": "POST",
                  "controller": "Answer",
                  "action": "deleteAction",
                  "params": [
                    {
                      "name": "id",
                      "type": "int",
                      "required": true,
                      "description": "Answer ID (alias: answerId)"
                    }
                  ],
                  "errors": [
                    {
                      "code": "UNAUTHORIZED",
                      "description": "User is not authorized"
                    },
                    {
                      "code": "INTERNAL_ERROR",
                      "description": "Internal server error"
                    },
                    {
                      "code": "ACCESS_DENIED",
                      "description": "Access denied"
                    },
                    {
                      "code": "NOT_FOUND",
                      "description": "Entity not found"
                    },
                    {
                      "code": "VALIDATION_ERROR",
                      "description": "Invalid or missing parameter"
                    }
                  ]
                },
                {
                  "method": "polls.answer.get",
                  "http": "GET",
                  "controller": "Answer",
                  "action": "getAction",
                  "params": [
                    {
                      "name": "id",
                      "type": "int",
                      "required": true,
                      "description": "Answer ID (alias: answerId)"
                    }
                  ],
                  "errors": [
                    {
                      "code": "UNAUTHORIZED",
                      "description": "User is not authorized"
                    },
                    {
                      "code": "INTERNAL_ERROR",
                      "description": "Internal server error"
                    },
                    {
                      "code": "ACCESS_DENIED",
                      "description": "Access denied"
                    },
                    {
                      "code": "NOT_FOUND",
                      "description": "Entity not found"
                    },
                    {
                      "code": "VALIDATION_ERROR",
                      "description": "Invalid or missing parameter"
                    }
                  ]
                },
                {
                  "_truncated": "... ещё 37 методов"
                }
              ]
            },
            "error": null
          },
          "time": {
            "start": 1787319171,
            "finish": 1787319171.392596,
            "duration": 0.3925960063934326,
            "processing": 0,
            "date_start": "2026-08-21T16:32:51+03:00",
            "date_finish": "2026-08-21T16:32:51+03:00"
          }
        }
        
Предыдущая
Следующая