Всё в облаке
fetch('https://cssherman.bitrix24.de/rest/1/xxxxxxxxx/crm.contact.add ', {
method: "POST",
headers:{
'Content-Type': 'application/json'
},
body:JSON.stringify({
fields: {
"NAME": this.customer.firstname,
"LAST_NAME": this.customer.lastname,
"OPENED": "Y",
"ASSIGNED_BY_ID": 1
}
})
}).then(function(response) {
return response.json();
}).then(function(post){
console.log(post);
});
fetch('https://cssherman.bitrix24.de/rest/1/xxxxxxxxx/crm.deal.add ', {
method: "POST",
headers:{
'Content-Type': 'application/json'
},
body:JSON.stringify({
fields: {
"TITLE": `R-${this.repairIndex}: ${this.item.title}`,
"ASSIGNED_BY_ID": 21,
'UF_CRM_1551860115590': `${this.customer.address.street} ${this.customer.address.number}, ${this.customer.address.postal} ${this.customer.address.city}`,
'OPPORTUNITY': this.item.price,
'UF_CRM_1551852723': true
}
})
}).then(function(response) {
return response.json();
}).then(function(post) {
console.log(post);
});
fetch('https://cssherman.bitrix24.de/rest/1/xxxxxxxxx/crm.deal.contact.add ', {
method: "POST",
headers:{
'Content-Type': 'application/json'
},
body:JSON.stringify({
id: 21,
fields: {
"CONTACT_ID": 1
}
})
}).then(function(response) {
return response.json();
});
Поле ASSIGNED_BY_ID я так понимаю присваивает id сделке и контакту?!
fetch('
method: "POST",
headers:{
'Content-Type': 'application/json'
},
body:JSON.stringify({
fields: {
"NAME": this.customer.firstname,
"LAST_NAME": this.customer.lastname,
"OPENED": "Y",
"ASSIGNED_BY_ID": 1
}
})
}).then(function(response) {
return response.json();
}).then(function(post){
console.log(post);
});
fetch('
method: "POST",
headers:{
'Content-Type': 'application/json'
},
body:JSON.stringify({
fields: {
"TITLE": `R-${this.repairIndex}: ${this.item.title}`,
"ASSIGNED_BY_ID": 21,
'UF_CRM_1551860115590': `${this.customer.address.street} ${this.customer.address.number}, ${this.customer.address.postal} ${this.customer.address.city}`,
'OPPORTUNITY': this.item.price,
'UF_CRM_1551852723': true
}
})
}).then(function(response) {
return response.json();
}).then(function(post) {
console.log(post);
});
fetch('
method: "POST",
headers:{
'Content-Type': 'application/json'
},
body:JSON.stringify({
id: 21,
fields: {
"CONTACT_ID": 1
}
})
}).then(function(response) {
return response.json();
});
Поле ASSIGNED_BY_ID я так понимаю присваивает id сделке и контакту?!