rest api web developing human task 401

RestAPI get pending task ajax

Hi,
I use ajax to get list of pending tasks for loged in user, but i get 401 error I also send my x-bonita-api-token and JSESSIONID via hard code, and don't know how to make it dynamic.Also I am pretty sure my token and ID is update.
here is my get request :
$.ajax({
type:'GET',
dataType: 'jsonp',
headers: {
// 'Access-Control-Allow-Origin': '*',
'JSESSIONID' : '5618D77A0D13CC598FD632A24AD376A9',

Notifications