• Post category:Форумы
  • Запись изменена:28.10.2022

POST api/2.0/community/forum/{threadid}

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

Описание
Добавляет новую тему в существующую ветку с предметом, содержанием и типом темы, указанными в запросе.

Параметры

Название Описание Тип Пример
threadid

sent in url
Идентификатор темы номер 1234
subject

sent in body
Предмет темы строковый текст
content

sent in body
Теси темы строковый текст
topicType

sent in body
Тип темы Informational, Poll
Пример
POST api/2.0/community/forum/1234
Host: yourportal.r7-office.ru
Content-Type: application/json
Accept: application/json

{
  "subject": "some text",
  "content": "some text",
  "topicType": "informational"
}

Возвращает
Добавлена тема

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

application/json

{
  "status": 0,
  "response": {
    "id": 10,
    "title": "Sample topic",
    "created": "2022-10-03T19:03:27.5140733Z",
    "updated": "2022-10-03T19:03:27.5140733Z",
    "text": "This is sample post",
    "updatedBy": {
      "id": "00000000-0000-0000-0000-000000000000",
      "displayName": "Mike Zanyatski",
      "title": "Manager",
      "avatarSmall": "url to small avatar",
      "profileUrl": ""
    },
    "threadTitile": null,
    "status": 2,
    "type": 0,
    "posts": [
      {
        "id": 123,
        "subject": "Sample subject",
        "text": "Post text",
        "created": "2022-10-03T19:03:27.5140733Z",
        "updated": "2022-10-03T19:03:27.5140733Z",
        "createdBy": {
          "id": "00000000-0000-0000-0000-000000000000",
          "displayName": "Mike Zanyatski",
          "title": "Manager",
          "avatarSmall": "url to small avatar",
          "profileUrl": ""
        },
        "threadTitle": null,
        "attachments": [
          {
            "name": "picture.jpg",
            "contentType": "image\/jpeg",
            "created": "2022-10-03T19:03:27.5140733Z",
            "updated": "2022-10-03T19:03:27.5140733Z",
            "size": 122345,
            "path": "url to file"
          }
        ]
      }
    ],
    "tags": [
      "Tag1",
      "Tag2"
    ]
  }
}

text/xml

<result>
  <status>0</status>
  <response>
    <id>10</id>
    <title>Sample topic</title>
    <created>2022-10-03T19:03:27.5140733Z</created>
    <updated>2022-10-03T19:03:27.5140733Z</updated>
    <text>This is sample post</text>
    <updatedBy>
      <id>00000000-0000-0000-0000-000000000000</id>
      <displayName>Mike Zanyatski</displayName>
      <title>Manager</title>
      <avatarSmall>url to small avatar</avatarSmall>
      <profileUrl></profileUrl>
    </updatedBy>
    <threadTitile />
    <status>2</status>
    <type>0</type>
    <posts>
      <id>123</id>
      <subject>Sample subject</subject>
      <text>Post text</text>
      <created>2022-10-03T19:03:27.5140733Z</created>
      <updated>2022-10-03T19:03:27.5140733Z</updated>
      <createdBy>
        <id>00000000-0000-0000-0000-000000000000</id>
        <displayName>Mike Zanyatski</displayName>
        <title>Manager</title>
        <avatarSmall>url to small avatar</avatarSmall>
        <profileUrl></profileUrl>
      </createdBy>
      <threadTitle />
      <attachments>
        <name>picture.jpg</name>
        <contentType>image/jpeg</contentType>
        <created>2022-10-03T19:03:27.5140733Z</created>
        <updated>2022-10-03T19:03:27.5140733Z</updated>
        <size>122345</size>
        <path>url to file</path>
      </attachments>
    </posts>
    <tags>Tag1</tags>
    <tags>Tag2</tags>
  </response>
</result>