automizy-js-api
Version:
JavaScript API library for Automizy Marketing Automation software
48 lines (40 loc) • 1.15 kB
JavaScript
define([
'automizyApi/core',
'automizyApi/functions/initBasicFunctions',
'automizyApi/token'
], function () {
var Forms = function (obj) {
var t = this;
t.d = {
a: 3,
option: {},
url: $AA.u.forms
};
t.init();
if (typeof obj !== 'undefined') {
t.initParameter(obj);
}
};
var p = Forms.prototype;
p.getFullTimeLineById = function (id, from, to, step) {
var t = this;
var data = {
format:'timeline'
};
if(typeof from !== 'undefined' && from !== false){
data.from = from;
}
if(typeof to !== 'undefined' && to !== false){
data.to = to;
}
return $.ajax({
url: t.d.url + '/' + id + '/conversion' + t.d.urlSuffix,
type: 'GET',
dataType: 'json',
data: data,
headers: {Authorization: 'Bearer ' + $AA.token().get()},
error: $AA.token().error()
});
};
$AA.initBasicFunctions(Forms, "Forms");
});