function boltCall(apicall, payload, resultcb) {
        $.ajax({
            url: boltUrlBase + "request/" + apicall,
            type: "POST",
            data: JSON.stringify(payload),
            beforeSend: function (xhr) {
                xhr.setRequestHeader("Authorization", "Basic " + btoa(username + ":" + userkey));
            },
            success: function (data, status) {
                //console.log(data);
                if (data.complete) {
                    resultcb(data);
                }
                else {
                    boltRepeatCall(data.id, resultcb, 1);
                }
            },
            error: function () {
                console.log("Request error");
                resultcb({ error: "request" });
            },
        });
    }
/**
     * boltCall makes an api call and return the result to the callback if complete. if not, show
     * loading modal until request completes, then call the callback. resultcb may be called multiple times
     * if the call has data but is not complete!
     */
boltCall makes an api call and return the result to the callback if complete. if not, show
loading modal until request completes, then call the callback. resultcb may be called multiple times
if the call has data but is not complete!
boltCall makes an api call and return the result to the callback if complete . if not show loading modal until request completes then call the callback . resultcb may be called multiple times if the call has data but is not complete!
function boltCall(apicall, payload, resultcb) {
        $.ajax({
            url: boltUrlBase + "request/" + apicall,
            type: "POST",
            data: JSON.stringify(payload),
            beforeSend: function (xhr) {
                xhr.setRequestHeader("Authorization", "Basic " + btoa(username + ":" + userkey));
            },
            success: function (data, status) {
                if (data.complete) {
                    resultcb(data);
                }
                else {
                    boltRepeatCall(data.id, resultcb, 1);
                }
            },
            error: function () {
                console.log("Request error");
                resultcb({ error: "request" });
            },
        });
    }
function boltCall ( apicall , payload , resultcb ) { $ . ajax ( { url : boltUrlBase + "request/" + apicall , type : "POST" , data : JSON . stringify ( payload ) , beforeSend : function ( xhr ) { xhr . setRequestHeader ( "Authorization" , "Basic " + btoa ( username + ":" + userkey ) ) ; } , success : function ( data , status ) { if ( data . complete ) { resultcb ( data ) ; } else { boltRepeatCall ( data . id , resultcb , 1 ) ; } } , error : function ( ) { console . log ( "Request error" ) ; resultcb ( { error : "request" } ) ; } , } ) ; }
boltCall makes an api call and return the result to the callback if complete.
boltCall makes an api call and return the result to the callback if complete .
//console.log(data);