1
0
mirror of https://github.com/Bayselonarrend/OpenIntegrations.git synced 2026-05-22 10:05:29 +02:00
Files
OpenIntegrations/docs/en/md/Bitrix24/Deals-managment/Update-deal.mdx
T
Vitaly the Alpaca (bot) 41eefb70fe Main build (Jenkins)
2024-11-12 23:15:46 +03:00

98 lines
2.8 KiB
Plaintext

---
sidebar_position: 5
---
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';
# Update deal
Modifies an existing deal
`Function UpdateDeal(Val URL, Val DealID, Val FieldsStructure, Val Token = "") Export`
| Parameter | CLI option | Type | Required | Description |
|-|-|-|-|-|
| URL | --url | String | ✔ | URL of webhook or a Bitrix24 domain, when token used |
| DealID | --deal | Number, String | ✔ | Deal ID |
| FieldsStructure | --fields | Structure of KeyAndValue | ✔ | Deal fields structure |
| Token | --token | String | ✖ | Access token, when app auth method used |
Returns: Map Of KeyAndValue - serialized JSON of answer from Bitrix24 API
<br/>
:::tip
Method at API documentation: [crm.deal.update](https://dev.1c-bitrix.ru/rest_help/crm/cdeals/crm_deal_update.php)
:::
<br/>
```bsl title="1C:Enterprise/OneScript code example"
FieldsStructure = New Structure;
FieldsStructure.Insert("TITLE" , "Sale in RUB");
FieldsStructure.Insert("CURRENCY_ID" , "RUB");
FieldsStructure.Insert("OPPORTUNITY" , 50000);
URL = "https://b24-ar17wx.bitrix24.by/rest/1/yg2...";
DealID = "1384";
Result = OPI_Bitrix24.UpdateDeal(URL, DealID, FieldsStructure);
FieldsStructure.Insert("TITLE" , "Future deal in RUB");
FieldsStructure.Insert("BEGINDATE", "2025-01-01");
URL = "b24-ar17wx.bitrix24.by";
Token = "48573267006e9f06006b12e400000001000...";
DealID = "1386";
Result = OPI_Bitrix24.UpdateDeal(URL, DealID, FieldsStructure, Token);
```
<Tabs>
<TabItem value="bash" label="Bash" default>
```bash
# JSON data can also be passed as a path to a .json file
oint bitrix24 UpdateDeal \
--url "b24-ar17wx.bitrix24.by" \
--deal 1394 \
--fields "{'TITLE':'Future deal in RUB','CURRENCY_ID':'RUB','OPPORTUNITY':50000,'BEGINDATE':'2025-01-01'}" \
--token "***"
```
</TabItem>
<TabItem value="bat" label="CMD/Bat" default>
```batch
:: JSON data can also be passed as a path to a .json file
oint bitrix24 UpdateDeal ^
--url "b24-ar17wx.bitrix24.by" ^
--deal 1394 ^
--fields "{'TITLE':'Future deal in RUB','CURRENCY_ID':'RUB','OPPORTUNITY':50000,'BEGINDATE':'2025-01-01'}" ^
--token "***"
```
</TabItem>
</Tabs>
```json title="Result"
{
"result": true,
"time": {
"start": 1728454947.49523,
"finish": 1728454947.66518,
"duration": 0.169941902160645,
"processing": 0.142473936080933,
"date_start": "2024-10-09T09:22:27+03:00",
"date_finish": "2024-10-09T09:22:27+03:00",
"operating_reset_at": 1728455547,
"operating": 0.142450094223022
}
}
```