-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExample.js
More file actions
24 lines (17 loc) · 860 Bytes
/
Example.js
File metadata and controls
24 lines (17 loc) · 860 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
/** EXAMPLE
* 1. set out webhook by lead added
* 2. public your script as webApp, and set url of webApp in Bitrix out webhook
* 3. set inbound webhook in Bitrix, get auth key from UI and owner ID (in example url) and put them in webHookOption
*/
function doPost(e) {
const webHookOptions = {
authCod: 'xxxxxxxxxxxxxxx', //see special security cod from bitrix, in webhooks interface
webHookOwnerId: '1', //id of user, which set webhook
}
let Bitrix = new BitrixMain()
Bitrix.setBitrixOptions(e, webHookOptions);
let row = Bitrix.getDeal().getParamsRow('ID', 'DATE_CREATE', 'UF_CRM_1583254123774');
let SS = SpreadsheetApp.openById('xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx');
let sheet = SS.getSheets()[0];
sheet.getRange(sheet.getLastRow() + 1, 1, row.length, row[0].length).setValues(row)
}