LiquidPlanner Classic Forum

Ask a Question
Back to All

Problem with an ajax request using a token.

So i am having this problem : when i run this i don't receive any data however in de browser console I
get this : 'cross-origin request blocked the same origin policy disallows reading the remote resource'.
I've tried using username:password and token both resulting in the warning above.

$.ajax({
type: "GET",
url: "https://app.liquidplanner.com/api/v1/account",
dataType:'json',
headers:{
"Authorization":'Bearer mytoken'
},
success: function(resp){
var ws = resp.workspaces,
tableData = [];
for (var i = 0, len = ws.length; i < len; i++) {
tableData.push({
"company_name": ws[i].company_name,
"name": ws[i].name,
"owner_id": ws[i].owner_id,
"updated_at": ws[i].updated_at
});
}

            table.appendRows(tableData);
            doneCallback();
            }