Originally posted by Test User
Hi how do I get the item and services list for a job? The get job api doesnt return any items related to the job and have looked everywhere cant see anything.
Originally posted by Test User
Hi how do I get the item and services list for a job? The get job api doesnt return any items related to the job and have looked everywhere cant see anything.
Hi there,
You’re correct that the /job endpoint doesn’t include the items and services directly in its response. To retrieve the materials and items that have been added to a job, you’ll need to use the /jobmaterial endpoint.
Here’s how to get the items for a specific job:
/jobmaterial.json endpoint with a filter to get materials for a specific job:
job_uuid to get all materials tied to that job
https://api.servicem8.com/api_1.0/jobmaterial.json?$filter=job_uuid eq 'YOUR_JOB_UUID'The filtering syntax follows this pattern: $filter=FIELD OPERATOR 'VALUE' and ensure your filter statement is URL-encoded.
For broader job-related data including invoicing details, you can also check the /material and /materialbundle endpoints depending on your specific needs.
If you need more detailed API reference information, please refer to the complete endpoint documentation at developer.servicem8.com.
Thanks,
Cody
Thanks Cody. This works when querying the api directly. Im testing the Servicem8 module in Make and since there’s no method for jobmaterial I used the api call but it doesnt work and throws an access denied error. Any ideas?
Ah yes just had to update the scopes. All good
Hi there,
You’re right that the GET job API doesn’t return the line items directly. In ServiceM8, the “Line items on a quote/invoice” are accessed through the JobMaterial endpoint, not the Job endpoint.
To get all items and services for a specific job, you’ll need to use the /jobmaterial.json endpoint with a filter for the job UUID. Here’s how you can do it:
GET https://api.servicem8.com/api_1.0/jobmaterial.json?$filter=job_uuid eq 'YOUR_JOB_UUID'
The JobMaterial endpoint returns records with fields like name, quantity, price, displayed_amount, tax_rate_uuid, and more. Each JobMaterial record represents a line item on the quote or invoice for that job.
If you need to filter for a specific job, make sure to URL encode the filter parameter properly.
That should sort it — thanks!
Cody