Hi, we have several clients (about 10 now) who want to be able to see which service was assigned to a job (from the services add-on), and preferably also the questions and answers from the online form.
Even if it’s just a text blob like the bit which appears in the diary feed, eg:
Johann’s booking Service
2:18 PM 5/08/2020 by Developer
1 hour
How many people
2
Here are the API options that line up with what Johann was trying to extract (service selection plus the Q&A blob/answers).
Identifying which “Service” was applied to a Job (via job fields the Service can pre-fill)
When you create a Service, you can set default “Job Details” that populate the job card (including Job Description, Job Category, and Badges).
Those same fields are available on the Job record via GET /job/{uuid}.json (for example job_description, category_uuid, and badges).
Getting the customer’s submitted online booking text (the “text blob”) via the Inbox API
Inbox messages include message_text / message_html, have a message_type that includes online_booking, and include converted_to_job_uuid to link the message to the Job it was converted into.
You can list messages via GET /inboxmessage.json and then retrieve a specific one via GET /inboxmessage/{uuid}.json.
Getting Q&A as structured data (Form Responses)
If the questions/answers are captured as a ServiceM8 Form, you can pull them from Form Responses, where field_data contains the answers and the response links back via regarding_object / regarding_object_uuid.
For example: GET /api_1.0/formresponse.json?$filter=regarding_object eq ‘job’ and regarding_object_uuid eq ‘{job_uuid}’.
(Optional) Reconstructing the booking time/duration from schedule records
Job Activities can be listed via GET /jobactivity.json and filtered by job_uuid.
For example: GET /api_1.0/jobactivity.json?$filter=job_uuid eq ‘{job_uuid}’.
If the data still isn’t showing up where you expect for a specific workflow, email support@servicem8.com with an example job UUID and we’ll confirm which endpoint it’s stored under.