Answer the question
In order to leave comments, you need to log in
How to send a batch request to Bitrix in a convenient form on fetch api.?
The matter is that I can send normal object when I address to one method.
But if I do the same with butch, then the request is empty.
If for example , I will write this 'comp': 'crm.company.get?ID=1' as follows
'comp': {
'crm.company.get':{
'ID'=1;
}
let limitF = document.querySelector('.limit').value;
fetch("https://17iuna21.bitrix24.ru/rest/1/zuvojt2d1osnlurg/batch", {
method: "POST",
mode: 'cors',
credentials: 'same-origin',
headers: new Headers(
{
Accept: 'application/json',
'Content-Type': 'application/json'
}),
body: JSON.stringify(
{
'halt': 0,
'cmd': {
'leads': `crm.lead.list?FILTER[>OPPORTUNITY]=${limitF}&SELECT[]=*&SELECT[]=UF_CRM_1624283873527`,
'Deal': `crm.deal.list?FILTER[>OPPORTUNITY]=${limitF}`,
'comp': 'crm.company.get?ID=1'
}
}),
redirect: 'follow',
referrerPolicy: "no-referrer", // no-referrer, *client
})
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question