ServiceM8 JobContact API Endpoint

45 views Asked by At

I'm trying to push some notes from ServiceM8 to Zoho CRM. This triggers when a job is created or updated. I need to get the contact/client's email address first to match if it exist in the CRM.

Now, my problem is, I don't know how to get the contact/client details. What is the correct endpoint and parameters to use?

Please let me know what I need to do as I am new to all of this stuff, especially when it comes APIs. Thank you!

I tried the below screenshot, but getting an error. enter image description here

1

There are 1 answers

1
Andrew Gould On

End point for Job Contacts is
https://api.servicem8.com/api_1.0/jobcontact.json and you will need to do a filter to 'job_uuid' which will return a json with all contacts for that job. 'email' is the field.
$filter=job_uuid eq 'caf8ac40-609d-4163-b5de-1f02a417079b'

So query will look like:
https://api.servicem8.com/api_1.0/jobcontact.json?$filter=job_uuid eq 'caf8ac40-609d-4163-b5de-1f02a417079b'

Structure like below:

{  
    "edit_date": "2022-07-31 10:17:09",  
    "active": 1,  
    "job_uuid": "vssg-jwbj-bbxm-b-cinx",  
    "first": "Elsie",  
    "last": "Someone",  
    "email": "[email protected]",  
    "phone": "08 8080 0000",  
    "mobile": "0417 000 000",  
    "type": "JOB",     
    "uuid": "ffd3818a-6e38-4bee-b569-1ec951f104fa"  
  },  

End point for the actual CLIENT is:
https://api.servicem8.com/api_1.0/companycontact.json
and once again the email field is simply 'email'
and structure is like below:

 {  
    "edit_date": "2022-09-27 10:03:20",  
    "active": 1,  
    "is_primary_contact": "1",  
    "company_uuid": "767340-c62a-41d2-bb91-147t6554b",  
    "first": "Ima",  
    "last": "Dahboss",  
    "email": "[email protected]",  
    "phone": "",  
    "mobile": "0407 000 000",  
    "type": "BILLING",  
    "uuid": "f1vgbda03-649e-4347-9c0d-fb4cbrya2b"  
  }