¿How can I obtain JSON data from bonita using JQuery?

I try to connect to bonita BPM using a jQuery function with following code:

$.ajax({ url: 'http://host:port/bonita/loginservice', data: { username :'uname', password : 'myPassw', redirect : 'true', redirectURL : '/API/bpm/archivedCase/3127/context' }, dataType: 'json', success: function (json) { alert("from bonita: "+json); //do something useful here }, error: function(request, status, error){ alert(request.status); alert(status); alert(error); } });
the objective for this code is to get a JSON object and then get all files used in some archived cases for download it. somebody can tell me how can I do it?

A Tip on displaying CODE/LOGS correctly in Posts:

Do not use the Supplied Buttons above, for some reason they refuse to work correctly, and despite bringing it to Bonitasofts attention, it’s low priority.

To Show Code/Logs correctly use

< code >
your code/log
< /code >

removing the spaces to allow the showing of code/logs correctly as here:

your code/log

You should still be able to edit your post to ensure the correct formatting of the code to help us understand it easier.

Thanks and regards