I’m working on N8N to create a new Job, and it does get created, however, the Job Contact doesn’t get attached but the client is attached to the newly created.
It’s just that when a Job is created for an existing client, the job contact does not show up in the UI when viewing the job from the Dashboard.
This only happens when the client is already existing and we’re creating a new job for that existing client. Although, the client is connected to the new Job created, it’s just the Job Contact does not show up when viewing the job created.
If you only provide client_id when creating the Job, the Job will not inherit the contact. Fetch the clients contacts using the ServiceM8 API –> GET /api_1.0/client/{client_id}/contacts.json then Choose Primary Contact You can either select the first contact or a contact marked as primary Store contact_id for the next step. Create Job with Contact → Include client_contact_id when creating the job: POST /api_1.0/job.json
{
“client_id”: “12345”,
“client_contact_id”: “67890”, ←— you get this from ServiceM8 api_1.0/client/{client_id}/contacts.json
“job_type_id”: “111”,
“address”: “Some Address”
}
When creating a Job in the ServiceM8 vis API does not allow assigning a job contact during job creation.
Sorry for the misdirection on my first reply.
This is why the newly created job does not show a Job Contact in the ServiceM8 UI, even though the client is correctly linked. The ServiceM8 API does not automatically assign the client’s default contact like the UI does.
Since the Job endpoint doesn’t support client_contact_id, you must attach the Job Contact after the job is created.
Steps:
Create the Job (as you’re already doing).
After this step, you’ll have the job_uuid.
Create a JobContact using a second HTTP node.Use the job_uuid from step 1 and the correct contact_uuid.This is done by calling the JobContact endpoint:POST https://api.servicem8.com/api_1.0/JobContact.json with a body of {
"job_uuid": "JOB_UUID_HERE",
"contact_uuid": "CONTACT_UUID_HERE"
}
This should work, unfortunately can not accomplish with just one api call