1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2025-05-31 23:20:02 +02:00

105 lines
3.1 KiB
Plaintext
Raw Normal View History

2024-10-15 10:50:56 +03:00
---
2024-10-15 10:16:04 +03:00
sidebar_position: 2
---
2024-10-15 10:50:56 +03:00
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
2024-10-15 10:16:04 +03:00
# Update post
Change post data
`Function UpdatePost(Val URL, Val PostID, Val Text, Val Visibility = "UA", Val Files = "", Val Title = "", Val Token = "") Export`
2024-10-15 15:15:47 +03:00
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| URL | --url | String | ✔ | URL of webhook or a Bitrix24 domain, when token used |
| PostID | --postid | String, Number | ✔ | Post ID |
| Text | --text | String | ✔ | Text of post |
| Visibility | --vision | String | ✖ | Array or 1 recipient: UA all, SGn w. group, Un user, DRn department, Gn group |
| Files | --files | Map Of KeyAndValue | ✖ | Key > file name, value > path or binary data |
| Title | --title | String | ✖ | Post title |
| Token | --token | String | ✖ | Access token, when app auth method used |
2024-10-15 10:16:04 +03:00
Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
<br/>
:::tip
2024-11-21 13:27:18 +03:00
Method at API documentation: [log.blogpost.update](https://dev.1c-bitrix.ru/rest_help/log/log_blogpost_update.php)
2024-10-15 10:16:04 +03:00
:::
<br/>
2024-12-16 19:38:57 +03:00
2024-10-15 21:15:56 +03:00
```bsl title="1C:Enterprise/OneScript code example"
2024-10-15 10:16:04 +03:00
Text = "New post text";
Title = "New post title";
Image1 = "https://api.athenaeum.digital/test_data/picture.jpg"; // URL, Path or Binary Data
2025-01-11 21:13:24 +03:00
PostID = "1808";
2024-10-15 10:16:04 +03:00
Files = New Map;
Files.Insert("1.png", Image1);
2024-12-08 12:04:47 +03:00
URL = "https://b24-ar17wx.bitrix24.by/rest/1/ps5...";
2024-10-15 10:16:04 +03:00
Result = OPI_Bitrix24.UpdatePost(URL, PostID, Text, , Files, Title);
URL = "b24-ar17wx.bitrix24.by";
2025-01-11 21:13:24 +03:00
Token = "14bb8267006e9f06006b12e400000001000...";
PostID = "1806";
2024-10-15 10:16:04 +03:00
Result = OPI_Bitrix24.UpdatePost(URL, PostID, Text, , Files, Title, Token);
```
2024-10-20 22:36:03 +03:00
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
2024-10-22 08:59:24 +03:00
# JSON data can also be passed as a path to a .json file
2024-10-20 22:36:03 +03:00
oint bitrix24 UpdatePost \
2024-10-22 08:59:24 +03:00
--url "b24-ar17wx.bitrix24.by" \
2025-01-10 12:07:46 +03:00
--postid 1770 \
2024-10-22 08:59:24 +03:00
--text "New post text" \
--files "{'1.png':'https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture.jpg'}" \
--title "New post title" \
--token "***"
2024-10-20 22:36:03 +03:00
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
2024-10-22 08:59:24 +03:00
:: JSON data can also be passed as a path to a .json file
2024-10-20 22:36:03 +03:00
oint bitrix24 UpdatePost ^
2024-10-22 08:59:24 +03:00
--url "b24-ar17wx.bitrix24.by" ^
2025-01-10 12:07:46 +03:00
--postid 1770 ^
2024-10-22 08:59:24 +03:00
--text "New post text" ^
--files "{'1.png':'https://github.com/Bayselonarrend/OpenIntegrations/raw/main/service/test_data/picture.jpg'}" ^
--title "New post title" ^
--token "***"
2024-10-20 22:36:03 +03:00
```
</TabItem>
</Tabs>
2024-10-15 10:16:04 +03:00
```json title="Result"
{
"result": 948,
"time": {
"start": 1728454763.57528,
"finish": 1728454764.20608,
"duration": 0.630802154541016,
"processing": 0.599277019500732,
"date_start": "2024-10-09T09:19:23+03:00",
"date_finish": "2024-10-09T09:19:24+03:00",
"operating_reset_at": 1728455363,
"operating": 0.599257946014404
}
}
```