Fetch Jobs from ServiceM8 and Create Leads in ZOHO CRM

Fetch Jobs from ServiceM8 and Create Leads in ZOHO CRM

Hi,

I am trying to get all the jobs from ServiceM8 to create them in my ZOHO CRM Leads module through deluge using API.
when I use the API like this
response = invokeurl
[
type : GET
headers: header_map
];
info response;

it says "info messages stopped as the size tried to exceeded 500000 characters"

if I try it in for each loop "
Failed to execute function Mismatch of data type expression. Expected List but found String Line Number:14"

So, the Solution I found is using pagination you can get records but in serviceM8 API you cannot use Pagination Like this page=2&per_page=25. you have to use cursor like this 
"https://api.servicem8.com/api_1.0/jobcontact.json?cursor=-1"
and then through for each loop you can get all the records in page one.
But the problem is cursor=-1 gets only records on 1 page and I am unable to go to next page or find a proper way to get to the next page and get records from that page and like this get records from all the pages from serviceM8.

Thanks.