﻿---
sidebar_position: 5
description: Get posts and other functions to work with Bitrix24 in the Open Integration Package, a free open-source integration library for 1C:Enterprise 8, OneScript and CLI
keywords: [1C, 1С, 1С:Enterprise, 1С:Enterprise 8.3, API, Integration, Services, Exchange, OneScript, CLI, Bitrix24]
---

import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# Get posts
 Gen post or array of post with ID or rights selection



`Function GetPosts(Val URL, Val PostID = "", Val Filter = "UA", Val Token = "") Export`

  | Parameter | CLI option | Type | Required | Description |
  |-|-|-|-|-|
  | URL | --url | String | &#x2714; | URL of webhook or a Bitrix24 domain, when token used |
  | PostID | --postid | String, Number | &#x2716; | Id of important post |
  | Filter | --sel | String | &#x2716; | Post selection by rights: UA all, SGn work group, Un user, DRn depart, Gn group |
  | Token | --token | String | &#x2716; | Access token, when app auth method used |

  
  Returns:  Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API

<br/>

:::tip
Method at API documentation: [log.blogpost.get](https://dev.1c-bitrix.ru/rest_help/log/log_blogpost_get.php)
:::
<br/>



```bsl title="1C:Enterprise/OneScript code example"
    PostID = "2508";
    URL    = "https://b24-ar17wx.bitrix24.by/rest/1/h0m...";

    Result = OPI_Bitrix24.GetPosts(URL, PostID);

    URL   = "b24-ar17wx.bitrix24.by";
    Token = "11ae5d68006e9f06006b12e400000001000...";

    Result = OPI_Bitrix24.GetPosts(URL, PostID, , Token);
```
 

 <Tabs>
  
    <TabItem value="bash" label="Bash" default>
        ```bash
            oint bitrix24 GetPosts \
             --url "b24-ar17wx.bitrix24.by" \
             --postid 2606 \
             --token "***"
        ```
    </TabItem>
  
    <TabItem value="bat" label="CMD/Bat" default>
        ```batch
            oint bitrix24 GetPosts ^
             --url "b24-ar17wx.bitrix24.by" ^
             --postid 2606 ^
             --token "***"
        ```
    </TabItem>
</Tabs>


```json title="Result"
{
 "result": [
  {
   "ID": "950",
   "BLOG_ID": "1",
   "PUBLISH_STATUS": "P",
   "TITLE": "New post title",
   "AUTHOR_ID": "1",
   "ENABLE_COMMENTS": "Y",
   "NUM_COMMENTS": "0",
   "CODE": null,
   "MICRO": "N",
   "DETAIL_TEXT": "New post text",
   "DATE_PUBLISH": "2024-10-09T09:19:18+03:00",
   "CATEGORY_ID": null,
   "HAS_SOCNET_ALL": "N",
   "HAS_TAGS": "N",
   "HAS_IMAGES": "N",
   "HAS_PROPS": "Y",
   "HAS_COMMENT_IMAGES": null,
   "UF_BLOG_POST_DOC": {
    "ID": "1",
    "ENTITY_ID": "BLOG_POST",
    "FIELD_NAME": "UF_BLOG_POST_DOC",
    "USER_TYPE_ID": "file",
    "XML_ID": "UF_BLOG_POST_DOC",
    "SORT": "100",
    "MULTIPLE": "Y",
    "MANDATORY": "N",
    "SHOW_FILTER": "N",
    "SHOW_IN_LIST": "N",
    "EDIT_IN_LIST": "Y",
    "IS_SEARCHABLE": "Y",
    "SETTINGS": {
     "SIZE": 20,
     "LIST_WIDTH": 0,
     "LIST_HEIGHT": 0,
     "MAX_SHOW_SIZE": 0,
     "MAX_ALLOWED_SIZE": 0,
     "EXTENSIONS": [],
     "TARGET_BLANK": "Y"
    },
    "EDIT_FORM_LABEL": null,
    "LIST_COLUMN_LABEL": null,
    "LIST_FILTER_LABEL": null,
    "ERROR_MESSAGE": null,
    "HELP_MESSAGE": null,
    "USER_TYPE": {
     "USER_TYPE_ID": "file",
     "CLASS_NAME": "Bitrix\\Main\\UserField\\Types\\FileType",
     "EDIT_CALLBACK": [
      "Bitrix\\Main\\UserField\\Types\\FileType",
      "renderEdit"
     ],
     "VIEW_CALLBACK": [
      "Bitrix\\Main\\UserField\\Types\\FileType",
      "renderView"
     ],
     "USE_FIELD_COMPONENT": true,
     "DESCRIPTION": "Файл",
     "BASE_TYPE": "file"
    },
    "VALUE": false,
    "ENTITY_VALUE_ID": 950,
    "VALUE_EXISTS": true,
    "VALUE_RAW": null,
    "CUSTOM_DATA": []
   },
   "UF_BLOG_POST_URL_PRV": {
    "ID": "5",
    "ENTITY_ID": "BLOG_POST",
    "FIELD_NAME": "UF_BLOG_POST_URL_PRV",
    "USER_TYPE_ID": "url_preview",
    "XML_ID": "UF_BLOG_POST_URL_PRV",
    "SORT": "100",
    "MULTIPLE": "N",
    "MANDATORY": "N",
    "SHOW_FILTER": "N",
    "SHOW_IN_LIST": "N",
    "EDIT_IN_LIST": "Y",
    "IS_SEARCHABLE": "Y",
    "SETTINGS": [],
    "EDIT_FORM_LABEL": null,
    "LIST_COLUMN_LABEL": null,
    "LIST_FILTER_LABEL": null,
    "ERROR_MESSAGE": null,
    "HELP_MESSAGE": null,
    "USER_TYPE": {
     "USER_TYPE_ID": "url_preview",
     "CLASS_NAME": "Bitrix\\Main\\UrlPreview\\UrlPreviewUserType",
     "DESCRIPTION": "Содержимое ссылки",
     "BASE_TYPE": "int"
    },
    "VALUE": null,
    "ENTITY_VALUE_ID": 950,
    "VALUE_EXISTS": true,
    "VALUE_RAW": null,
    "CUSTOM_DATA": []
   },
   "UF_GRATITUDE": {
    "ID": "9",
    "ENTITY_ID": "BLOG_POST",
    "FIELD_NAME": "UF_GRATITUDE",
    "USER_TYPE_ID": "integer",
    "XML_ID": "UF_GRATITUDE",
    "SORT": "100",
    "MULTIPLE": "N",
    "MANDATORY": "N",
    "SHOW_FILTER": "N",
    "SHOW_IN_LIST": "N",
    "EDIT_IN_LIST": "Y",
    "IS_SEARCHABLE": "N",
    "SETTINGS": {
     "SIZE": 20,
     "MIN_VALUE": 0,
     "MAX_VALUE": 0,
     "DEFAULT_VALUE": null
    },
    "EDIT_FORM_LABEL": null,
    "LIST_COLUMN_LABEL": null,
    "LIST_FILTER_LABEL": null,
    "ERROR_MESSAGE": null,
    "HELP_MESSAGE": null,
    "USER_TYPE": {
     "USER_TYPE_ID": "integer",
     "CLASS_NAME": "Bitrix\\Main\\UserField\\Types\\IntegerType",
     "EDIT_CALLBACK": [
      "Bitrix\\Main\\UserField\\Types\\IntegerType",
      "renderEdit"
     ],
     "VIEW_CALLBACK": [
      "Bitrix\\Main\\UserField\\Types\\IntegerType",
      "renderView"
     ],
     "USE_FIELD_COMPONENT": true,
     "DESCRIPTION": "Целое число",
     "BASE_TYPE": "int"
    },
    "VALUE": null,
    "ENTITY_VALUE_ID": 950,
    "VALUE_EXISTS": true,
    "VALUE_RAW": null,
    "CUSTOM_DATA": []
   },
   "UF_BLOG_POST_FILE": {
    "ID": "19",
    "ENTITY_ID": "BLOG_POST",
    "FIELD_NAME": "UF_BLOG_POST_FILE",
    "USER_TYPE_ID": "disk_file",
    "XML_ID": "UF_BLOG_POST_FILE",
...
```
