View difference between Paste ID: fJ0WbAkt and 31vaX3PD
SHOW: | | - or go back to the newest paste.
1-
var resource_uri = 'https://' + oneall_subdomain + ".api.oneall.com" + '/connections.json';
1+
2-
var result_json = "";    
2+
        var oneall_public_key = 'a349ba4a-896d-4726-b7c2-f38e417cc15f';
3-
var testHttp = new XMLHttpRequest();
3+
        var oneall_private_key = '6d2cca60-65e6-4972-89bc-6fa185ba88ba';
4
        var site_authentication = oneall_public_key + ":" + oneall_private_key;
5-
testHttp.open( "GET", resource_uri, true);
5+
        var bytes = [];
6-
testHttp.setRequestHeader("Authorization", "Basic " + encoded_site_authentication);
6+
7-
testHttp.send(null);
7+
        for (var i = 0; i < site_authentication.length; ++i)     
8
        bytes.push(site_authentication.charCodeAt(i));
9
     
10
        var encoded_site_authentication = btoa(bytes).replace("[\n\r]", "");
11
         
12
   
13
        var resource_uri = 'https://' + oneall_subdomain + ".api.oneall.com"; //+ '/connections.json';
14
        var result_json = "";    
15
16
17
        var testHttp = null;
18
        testHttp = new XMLHttpRequest();
19
        testHttp.open( "GET", resource_uri, false);
20
        //testHttp.setRequestHeader("Authorization", "Basic " + encoded_site_authentication);
21
        testHttp.send();//encoded_site_authentication);