Webhook Notification

  • 19.3.2
This article is may not be up to date with the latest stable release of M4.

Description

M4 API can send notifications in a webhooks style when events occur in the M4 systems. This allows systems to be activly notified when an event occures. Sufficient details are provided with each notification for subscribed systems to perform their necessary logic. Additional calls to M4 endpoints may be necessary.

Methods

Sender Workforce
EventType Schedule
Description Occures when a Workforce schedule event occures. This includes drag and drop scheduling, Auto Schedule, Assisted Auto Schedule, and API schedule events.
Sample Notification Object
{
  "ID": "559fdcbc-7348-4e0a-acfb-fc4d96f3fea1",
  "ObjectState": "Unchanged",
  "EventType": "Schedule",
  "Data": [
	{
	  "TicketID": 78,
	  "ApptID": 93,
	  "ApptStart": "2022 - 01 - 24T14:30:00",
	  "ApptEnd": "2022 - 01 - 24T15: 00:00",
	  "TechID": 26,
	  "EventTime": "2022 - 01 - 24T14: 27:33.537"
	}
  ],
  "CreatedOn": "2022-01-25T09:21:27.6653778-05:00",
  "Sender": "Workforce",
  "PollQID": 1493
}
Sender Workforce
EventType Unschedule
Description Occures when an appointment is removed and not immediately assigned to another tech.  This includes the Workforce UI and the M4 API DeleteAppointment.
Sample Notification Object
{
  "ID": "559fdcbc-7348-4e0a-acfb-fc4d96f3fea1",
  "ObjectState": "Unchanged",
  "EventType": "Unschedule",
  "Data": [
	{
	  "TicketID": 78,
	  "ApptID": 93,
	  "ApptStart": "2022 - 01 - 24T14:30:00",
	  "ApptEnd": "2022 - 01 - 24T15: 00:00",
	  "TechID": 26,
	  "EventTime": "2022 - 01 - 24T14: 27:33.537"
	}
  ],
  "CreatedOn": "2022-01-25T09:21:27.6653778-05:00",
  "Sender": "Workforce",
  "PollQID": 1493
}
Sender Workforce
EventType Reschedule
Description Occures when an appointment has its start time changed, or its tech is changed.  Includes actions performed in the Workforce UI, the Workforce optimizer, and the M4 API.
Sample Notification Object
{
  "ID": "559fdcbc-7348-4e0a-acfb-fc4d96f3fea1",
  "ObjectState": "Unchanged",
  "EventType": "Reschedule",
  "Data": [
	{
	  "TicketID": 78,
	  "ApptID": 93,
	  "ApptStart": "2022 - 01 - 24T14:30:00",
	  "ApptEnd": "2022 - 01 - 24T15: 00:00",
	  "TechID": 26,
	  "EventTime": "2022 - 01 - 24T14: 27:33.537"
	}
  ],
  "CreatedOn": "2022-01-25T09:21:27.6653778-05:00",
  "Sender": "Workforce",
  "PollQID": 1493
}
Sender Workforce
EventType StatusChange
Description Occures when an appointment status is changed.  Includes actions performed in Workforce UI, MTPro, and the M4API.
Sample Notification Object
{
  "ID": "559fdcbc-7348-4e0a-acfb-fc4d96f3fea1",
  "ObjectState": "Unchanged",
  "EventType": "StatusChange",
  "Data": [
	{
	  "TicketID": 78,
	  "ApptID": 93,
	  "ApptStart": "2022 - 01 - 24T14:30:00",
	  "ApptEnd": "2022 - 01 - 24T15: 00:00",
	  "TechID": 26,
	  "PreviousStatus": 6,
	  "CurrentStatus": 7,
	  "EventTime": "2022 - 01 - 24T14: 27:33.537"
	}
  ],
  "CreatedOn": "2022-01-25T09:21:27.6653778-05:00",
  "Sender": "Workforce",
  "PollQID": 1493
}
Sender Workforce
EventType TicketNoteAdd
Description Occures when a note is added to a ticket.  Includes Workforce UI, Assignment UI, MTPro, and the M4 API
Sample Notification Object
{
	"ID": "559fdcbc-7348-4e0a-acfb-fc4d96f3fea1",
	"ObjectState": "Unchanged",
	"EventType": "TicketNoteAdd",
	"Data": [
		{
		  "TicketID": 78,
		  "TicketNoteID": 93,
		  "EventTime": "2022 - 01 - 24T14: 27:33.537"
		}
	  ],
	"CreatedOn": "2022-01-25T09:21:27.6653778-05:00",
	"Sender": "Workforce",
	"PollQID": 1493
	}

Was this article helpful?

Related Articles