Services information via API

Originally posted by Johann du Toit

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

We can parse out what we need.

Any help would be appreciated, thanks.

Johann
Wink Reports

Any updates on this?

Hi Andres,

Here are the API options that line up with what Johann was trying to extract (service selection plus the Q&A blob/answers).

  1. 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).

  2. 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.

  3. 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}’.

  4. (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.

Thanks,
Cody