How do I filter for materials on a specific job card

Originally posted by Haydon Turner-White

I’m trying to use a GET Webhook to retrieve all the materials listed under a job card but I can’t figure out how to use the filtering. When I test my webhook using this URL https://api.servicem8.com/api_1.0/jobmaterial.json$filter=uuideq’{UUID}’
it always lists a material that isn’t on the job card card.

How do I correctly use the filtering?

Your filter in the example is filtering by ‘uuid’ not ‘job_uuid’ which could be the issue.

Also, you’ve got no spaces in your filter, which would return an error.

Otherwise, if you’re using the correct job_uuid and filter syntax, and still getting JobMaterials that aren’t on the job card, it might be returning deleted JobMaterials (active = 0)? Try “$filter=job_uuid eq {job_uuid} and active eq 1”

Remember to encode the URI if you’re getting more errors.