• Post category:События
  • Запись изменена:28.10.2022

POST api/2.0/community/event/{feedid}/vote

Для этой функции требуется аутентификация. 

Description

Sends a vote to a certain option in a poll-type event with the ID specified in the request. ?

Описание

Отправляет голосование за определенный вариант в опросе с идентификатором, указанным в запросе.

Параметры
НазваниеОписаниеТипПример
feedid

sent in url
Идентификатор событияномер1234
variants

sent in body
Опциимассив чисел[1234,123]

Примечание
Если событие не является опросом, вы получите сообщение об ошибке.

Пример

             Sending data in application/json:
             {
                 variants:[1,2,3],
             }
              Sending data in application/x-www-form-urlencoded
             variants=[1,2,3]

Возвращает
Событие

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

application/json

{
  "status": 0,
  "response": {
    "id": 10,
    "title": "Sample news",
    "created": "2022-10-03T19:03:27.4979052Z",
    "updated": "2022-10-03T19:03:27.4979052Z",
    "type": 1,
    "createdBy": {
      "id": "00000000-0000-0000-0000-000000000000",
      "displayName": "Mike Zanyatski",
      "title": "Manager",
      "avatarSmall": "url to small avatar",
      "profileUrl": ""
    },
    "text": "Text of feed",
    "poll": {
      "pollType": 0,
      "endDate": "2022-10-03T19:03:27.4979052Z",
      "startDate": "2022-10-03T19:03:27.4979052Z",
      "voted": false,
      "votes": [
        {
          "id": 133,
          "name": "Variant 1",
          "votes": 100
        }
      ]
    }
  }
}

text/xml

<result>
  <status>0</status>
  <response>
    <id>10</id>
    <title>Sample news</title>
    <created>2022-10-03T19:03:27.4979052Z</created>
    <updated>2022-10-03T19:03:27.4979052Z</updated>
    <type>1</type>
    <createdBy>
      <id>00000000-0000-0000-0000-000000000000</id>
      <displayName>Mike Zanyatski</displayName>
      <title>Manager</title>
      <avatarSmall>url to small avatar</avatarSmall>
      <profileUrl></profileUrl>
    </createdBy>
    <text>Text of feed</text>
    <poll>
      <pollType>0</pollType>
      <endDate>2022-10-03T19:03:27.4979052Z</endDate>
      <startDate>2022-10-03T19:03:27.4979052Z</startDate>
      <voted>false</voted>
      <votes>
        <id>133</id>
        <name>Variant 1</name>
        <votes>100</votes>
      </votes>
    </poll>
  </response>
</result>