var sensei_api = function() {
var baseUrl = 'https://api.sensei.plus/v1/';
var self = this;
this.send = function (url, method, data) {
data = data || {};
var params = {
url: baseUrl + url,
data: data,
method: method,
dataType: 'json',
headers: {
'X-Auth-Sensei-Token': 'Ваш Sensei-токен'
},
success: function(data) {
console.log(data);
}
};
return new $.ajax(params);
};
this.getProcesses = function () {
self.send('process/list', 'GET');
};
};
api = new sensei_api;
api.getProcesses();
POST https://api.sensei.plus/v1/process/start/(Id процесса)
{
"data": [
{"entity_id":30188325, "entity_type":1},
{"entity_id":30188323, "entity_type":1},
{"entity_id":30188321, "entity_type":1},
{"entity_id":30188319, "entity_type":1},
{"entity_id":30188315, "entity_type":1},
{"entity_id":30188313, "entity_type":1},
{"entity_id":30188291, "entity_type":1}
]
}
var sensei_api = function() {
var baseUrl = 'https://api.sensei.plus/v1/';
var self = this;
this.send = function (url, method, data) {
data = data || {}
var params = {
url: baseUrl + url,
data: data,
method: method,
dataType: 'json',
headers: {
'X-Auth-Sensei-Token': 'Ваш Sensei-токен'
},
success: function(data) {
console.log(data);
}
};
return new $.ajax(params);
};
};
api = new sensei_api;
api.send('process/start/Ваш ID процесса', 'POST', { "data":[
{"entity_type":1, "entity_id":AMOCRM.constant('card_id')}
]
}
)
POST https://api.sensei.plus/v1/process/start/(Id процесса)
{
"data": [
{
"entity_id": "31211609",
"entity_type": "1"
}
],
"param_values": {
"local": [
{"name": "name", "value": "Иван Петров"},
{"name": "phone", "value": "+79001234567"},
{"name": "email", "value": "tеst@mail.ru"}
]
}
}
var sensei_api = function() {
var baseUrl = 'https://api.sensei.plus/v1/';
var self = this;
this.send = function (url, method, data) {
data = data || {};
var params = {
url: baseUrl + url,
data: data,
method: method,
dataType: 'json',
headers: {
'X-Auth-Sensei-Token': 'Ваш Sensei-токен'
},
success: function(data) {
console.log(data);
}
};
return new $.ajax(params);
};
};
api = new sensei_api;
api.send('process/start/22984', 'POST',{
"data": [
{
"entity_id": "31211609",
"entity_type": "1"
}
],
"param_values": {
"local": [
{"name": "name", "value": "Иван Петров"},
{"name": "phone", "value": "+79001234567"},
{"name": "email", "value": "tеst@mail.ru"}
]
}
}
)
{
"entity_id": 33123425,
"entity_type": 1,
"result_caption": "Ваш результат задачи",
"task_id": 27931775
}
var sensei_api = function() {
var baseUrl = 'https://api.sensei.plus/v1/';
var self = this;
this.send = function (url, method, data) {
data = data || {}
var params = {
url: baseUrl + url,
data: data,
method: method,
dataType: 'json',
headers: {
'X-Auth-Sensei-Token': 'Ваш Sensei-токен'
},
success: function(data) {
console.log(data);
}
};
return new $.ajax(params);
};
};
api = new sensei_api;
api.send('element/task/complete', 'POST', {
"entity_id": AMOCRM.constant('card_id'),
"entity_type": 1,
"result_caption": "Перезвонить",
"task_id": 14211113
}
)
POST https://api.sensei.plus/v1/process/stop/(id)
{
"close_tasks": true,
"data":[
{"entity_type":1, "entity_id":41130554},
{"entity_type":1, "entity_id":41130956},
{"entity_type":1, "entity_id":41131044},
{"entity_type":1, "entity_id":41136110},
{"entity_type":1, "entity_id":41136112},
{"entity_type":1, "entity_id":41136114}
]
}
var sensei_api = function() {
var baseUrl = 'https://api.sensei.plus/v1/';
var self = this;
this.send = function (url, method, data) {
data = data || {};
var params = {
url: baseUrl + url,
data: data,
method: method,
dataType: 'json',
headers: {
'X-Auth-Sensei-Token': 'Ваш Sensei-токен'
},
success: function(data) {
console.log(data);
}
};
return new $.ajax(params);
};
};
api = new sensei_api;
api.send('process/stop/13574', 'POST', {"close_tasks": true,
"data":[
{"entity_type":1, "entity_id":AMOCRM.constant('card_id')}]})
var sensei_api = function() {
var baseUrl = 'https://api.sensei.plus/v1/';
var self = this;
this.send = function (url, method, data) {
data = data || {};
var params = {
url: baseUrl + url,
data: data,
method: method,
dataType: 'json',
headers: {
'X-Auth-Sensei-Token': 'Ваш Sensei-токен'
},
success: function(data) {
console.log(data);
}
};
return new $.ajax(params);
};
};
api = new sensei_api;
api.send('process/stop-entity/123', 'POST', {"close_tasks": true,
"data":[
{"entity_type":1, "entity_id":AMOCRM.constant('card_id')}]})