List all Tasks return empty

Hello there,

My tasks lists are not geting extracted.

and when I call the task.json from the developer portal returns me an empty list, my sericem8 has over a 5K tasks, at least 300 are active,open,pending, Can anyone help me to solve this issue?

the sm8 developer portal call is this.

curl --request GET
–url https://api.servicem8.com/api_1.0/task.json
–header ‘X-Api-Key: #####’
–header ‘accept: application/json’

You are using the wrong endpoint (tasks.json).

The correct endpoint would be jobchecklist.json

Hi Susana,

For “list” endpoints you’ll generally need to use cursor-based pagination, starting with cursor=-1 (otherwise you can get an empty result back).

Try this first:

curl -X GET "https://api.servicem8.com/api_1.0/task.json?cursor=-1" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Accept: application/json"

If there are more than 5,000 records, read the x-next-cursor response header and call the same endpoint again with cursor={that_uuid} until x-next-cursor is no longer returned.

Also worth noting: in ServiceM8 13 and the Enhanced Job Card, “Tasks” in the UI were merged into “Checklists”, and job-attached Tasks are converted into Checklist items. In that case, the data you’re expecting may be available via the Job Checklist endpoint instead:

curl -X GET "https://api.servicem8.com/api_1.0/jobchecklist.json?cursor=-1" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Accept: application/json"

Reply here with whether cursor=-1 returns results for /task.json, and we’ll point you to the right endpoint for your setup.

Thanks,
Cody

Hi Susana,

In ServiceM8 13, “Tasks” were merged into the new “Checklists”, and the separate Tasks add-on was deprecated, so many “tasks” you see in the UI are actually Checklist items now.

In the REST API, GET /task.json is still a valid endpoint for listing legacy Task records, but it will return an empty array if there aren’t any legacy Task records in the account.

If you’re trying to extract job-related checklist tasks, you’ll want GET /jobchecklist.json instead. Each checklist item includes a job_uuid (the job it belongs to), and completed_timestamp (empty or 0000-00-00 00:00:00 indicates the item is not completed).

The API also supports $filter on list endpoints (for example $filter=active eq 1).

Try calling https://api.servicem8.com/api_1.0/jobchecklist.json and reply here to confirm if that returns the records you’re expecting.

Thanks,
Cody