FSM Connector



Intro

The FSM connector is used to integrate with third-party application:

  • Duplicate ServiceOrder (ServiceCall, Activity, ReservedMaterial)
  • Notify about updates during resolution phase
  • Final notifications about work completion together with related details:
    • timeEfforts / Expenses
    • Materials
    • Mileages




Inboud API

The FSM Connector inbound API is a proxy to the Service API v2.

More details can be found here


Outbound API

Currently we have two types of integration, as detailed in the table below:

Integration Type Payload Stategy Communication Strategy
C4C Whole Asynchronous
S4 Delta Synchronous

Payload Strategy

Payload Strategy Description
Whole FSM connector always sends the whole payload.
Delta FSM connector only sends the delta changes.

Example: If we have one ServiceCall with three Activites, and Activity_2 is updated:

  • Using the Whole payload strategy, the FSM connector will send one ServiceCall with three Activities
  • But, when using a Delta payload strategy, the FSM connector will send only Activity_2 payload and only reference the ServiceCallrecord.

Communication Strategy:

Asynchronous FSM connector sends payload with “messageId” in the header and is unlocked to take care of different tasks. When the 3rd party endpoint is finished processing events, then a separate enpoint will send the confirmation (with the same “messageId” in the header, correlation is maintained) that this event has finished processing and is synchronized (or if applicable the current error state).
Synchronous FSM connector sends payload and waits while the event is fully consumed and confirmed on the 3rd party side.

All notifications are sent as an HTTP POST request with a JSON payload.

Example WebHook Notification Request

Request URL: {urlFromConfirguration}
Request Method: POST
Request Headers:
   Content-Type: application/json
   Accept: application/json
   X-Message-ID 8e515530-9eab-4a2b-9df1-83dc3bab30b3
   Authorization: Basic {credentialsFromConfiguration}
   X-Account-ID: 560347
   X-Company-ID: 587140
   X-Account-Name: core-vama
   X-Company-Name: comp1
Request Body:
   {JsonPayload}

Connector Configuration

Attention: the following steps are performed in the Admin portal. In order to perform these steps you must be assigned one of the following roles: ADMINISTRATOR, CUSTOMER, SUPPORT, SUPERUSER, EXTERNAL_SUPERUSER, or CONSULTANT.

In order to enable FSM connector you need to make setup in two steps:

1.) Navigate to Admin > Company > Settings and set the CoreSystems.FSM.Connector.Enabled setting to true.



Setting Value
CoreSystems.FSM.Connector.Enabled True. When true, the FSM Connector will be enabled.

2.) Navigate to Admin > Company > Messages > FSM Connector and configure the endpoints where notifications are sent:

Note: in the image below, the example endpoint to which FSM Connector event notifications are sent is https://mango.serveo.net/api/v1/thirdparty/mock.



Setting Description
Streaming Enabled Checked or unchecked. When checked, the FSM connector is currently enabled.
Extended Logs Enabled When checked, extended logs will be recorded for S4 and C4C events (depending on configuration), including UDFs, requirements, and attachment metadata.
Streaming URL Here you will enter the third-party endpoint that will receive notifications S4 and C4C events (depending on configuration).
Auth Method Read-only. Currently, only basic is supported at this point.
Auth user The user authenticated by the third-party to receive notifications.
Auth password Encrypted. The password associated with the auth user that is authenticated by the third-party to receive event notifications.
Integration Type Depending on selection, different events and payloads will be delivered.
Options include:
  • S4
  • C4C
Change Date Time The date and time at which the Streaming API configuration was last changed.
Last Modified By The Admin or Superuser last responsible for changing the FSM Connector configuration.

After an account has been assigned the STREAMING role, the Streaming API can then be configured.


C4C Outbound

Create Service Call in FSM with/without Activity & Reserved Material / Create Service Ticket in C4C

For create ServiceCall or Activity or ReserverMaterial or any combination of these, so example create serviceCall together with an Activity, etc. the whole payload is always sent.

For example, if a service call record with three activities and we then created new fourth activity, then the whole payload starting always from the tree top, which is the service call, will be sent.

If there is such a need 3rd party system can check if the externalId is set or not and take appropriate action:

Scenario FSM Connector Action
externalId`<>null The object was already created in C4C. No action required.
externalId==null The object needs to be created in C4C.

Below example of payload structure (it’s the same as palyload as serviceCall service API GET serviceCall operation):

{
  "eventType": "serviceCall.created",                            
  eventTypeVersion: "1.0",
  cloudEventsVersion: "0.1",
  source: "fsm-connector/api/v1",
  eventID: "263AADCA529C4D15BC4AA7F9A81AE81E",
  eventTime: "2019-03-23T22:23:14.888Z",
  contentType: "application/json",
  extensions: {
    traceId=2d1af04cc6ec42878a7a076df3810c4f
  },
  data: {
    "id": "ACB0605B150947AD87FD46A3A3B7A5AE",
    "code": "3",
    "externalId": "C4CSC0001",
    "lastChanged": 1552992130209,
    "businessPartner": {
      "id": "31192BAA08B844C5BD38F124D5BE2A1E",
      "code": "BP001",
      "externalId": "C4CBP001"
    },
    "contact": {
      "id": "FA174AFC196440A39BE7F6EA062999A6",
      "code": null,
      "externalId": "C4CCONT001"
    },
    "createPerson": {
      "id": "C8B596D87BAAE3EECD64EED9CE918FA4",
      "code": "EMP002",
      "externalId": "C4CEMP002"
    },
    "dueDateTime": "2019-03-05T08:38:00Z",
    "earliestStartDateTime": "2019-03-01T08:38:00Z",
    "durationInMinutes": null,
    "equipments": [
      {
        "id": "0B607DC8838C4440AD4DF0934723F577",
        "code": "EQ001",
        "externalId": "C4CEQ001"
      },
      {
        "id": "298E5F3B35B345B79DFB833F74E4556B",
        "code": "EQ002",
        "externalId": "C4CEQ002"
      }
    ],
    "status": "-2",
    "origin": "-1",
    "problemType": "-2",
    "priority": "HIGH",
    "remarks": "This is a service call created usiing new API",
    "resolution": "string",
    "responsibles": [
      {
        "id": "CF739486FC4018AF18301105EB2675EB",
        "code": "EMP001",
        "externalId": "C4CEMP001"
      }
    ],
    "subject": "This is from Post man with new API",
    "address": {
      "source": "SERVICECALL",
      "sourceId": "ACB0605B150947AD87FD46A3A3B7A5AE",
      "country": "IN",
      "state": "Karnataka",
      "city": "Bangalore",
      "zipCode": "560066",
      "street": "EPIP",
      "streetNumber": "138"
    },
    "activities": [
      {
        "id": "9478555DAAB64A90B307B13B6F6E4E02",
        "code": "2",
        "externalId": "C4CACT000101",
        "lastChanged": 1551617197798,
        "subject": "2- Created from post man march 1 2:30",
        "remarks": "1- This activity was Created from post man march 1 2:30",
        "contact": {
          "id": "FA174AFC196440A39BE7F6EA062999A6",
          "code": null,
          "externalId": "C4CCONT001"
        },
        "createPerson": {
          "id": "A7375F70D0AE4377B9635B3EA978EB7B",
          "code": null,
          "externalId": null
        },
        "durationInMinutes": 90,
        "dueDateTime": "2019-03-02T08:38:56Z",
        "earliestStartDateTime": "2019-03-01T08:38:56Z",
        "status": "DRAFT",
        "address": null,
        "equipment": {
          "id": "0B607DC8838C4440AD4DF0934723F577",
          "code": "EQ001",
          "externalId": "C4CEQ001"
        },
        "responsibles": [],
        "reservedMaterials": []
      },
      {
        "id": "0505D98B5BBE44579FE6526229B35330",
        "code": "3",
        "externalId": null,											// let's assume this one activity is the new one created, because externalId is null.
        "lastChanged": 1551617197910,
        "subject": "2 - Created from post man march 1 2:30",
        "remarks": "2 - This activity was Created from post man march 1 2:30",
        "contact": {
          "id": "FA174AFC196440A39BE7F6EA062999A6",
          "code": null,
          "externalId": "C4CCONT001"
        },
        "createPerson": {
          "id": "A7375F70D0AE4377B9635B3EA978EB7B",
          "code": null,
          "externalId": null
        },
        "durationInMinutes": 90,
        "dueDateTime": "2019-03-04T08:38:56Z",
        "earliestStartDateTime": "2019-03-01T08:38:56Z",
        "status": "DRAFT",
        "address": null,
        "equipment": {
          "id": "0B607DC8838C4440AD4DF0934723F577",
          "code": "EQ001",
          "externalId": "C4CEQ001"
        },
        "responsibles": [],
        "reservedMaterials": []
      }
    ],
    "reservedMaterials": [
      {
        "id": "C9B27C992B344DDAA11D1D3A8CBD6F89",
        "externalId": null,
        "item": {
          "id": "09630B3B811D4D7CB8DA458BE67289D3",
          "code": "MAT001",
          "externalId": "MCF-0003"
        },
        "serialNumber": null,
        "quantity": 3,
        "warehouse": {
          "id": "02EA5504744746C7AA14574ECC6BEA41",
          "code": "W000",
          "externalId": null
        },
        "used": 0,
        "moved": 0,
        "shipped": null
      }
    ]
  }
}

Update of Service Call in FSM / Update Corresponding Ticket in C4C

In case a ServiceCall, Activity, and/or ReservedMaterial (or any combination thereof) are updated in FSM, then FSM will always send whole payload (the same as for creation):

For example, if a service call record with three activities and we then created new fourth activity, then the whole payload starting always from the tree top, which in this case will be the service call record along with all four related activity records.

Below is example of payload structure (it’s the same as palyload as serviceCall service API GET serviceCall operation):

{
  "eventType": "serviceCall.updated",                 
  eventTypeVersion: "1.0",
  cloudEventsVersion: "0.1",
  source: "fsm-connector/api/v1",
  eventID: "263AADCA529C4D15BC4AA7F9A81AE81E",
  eventTime: "2019-03-23T22:23:14.888Z",
  contentType: "application/json",
  extensions: {
    traceId=2d1af04cc6ec42878a7a076df3810c4f
  },
  data:
  {
    "id": "ACB0605B150947AD87FD46A3A3B7A5AE",
    "code": "3",
    "externalId": "C4CSC0001",
    "lastChanged": 1552992130209,
    "businessPartner": {
      "id": "31192BAA08B844C5BD38F124D5BE2A1E",
      "code": "BP001",
      "externalId": "C4CBP001"
    },
    "contact": {
      "id": "FA174AFC196440A39BE7F6EA062999A6",
      "code": null,
      "externalId": "C4CCONT001"
    },
    "createPerson": {
      "id": "C8B596D87BAAE3EECD64EED9CE918FA4",
      "code": "EMP002",
      "externalId": "C4CEMP002"
    },
    "dueDateTime": "2019-03-05T08:38:00Z",
    "earliestStartDateTime": "2019-03-01T08:38:00Z",
    "durationInMinutes": null,
    "equipments": [
      {
        "id": "0B607DC8838C4440AD4DF0934723F577",
        "code": "EQ001",
        "externalId": "C4CEQ001"
      },
      {
        "id": "298E5F3B35B345B79DFB833F74E4556B",
        "code": "EQ002",
        "externalId": "C4CEQ002"
      }
    ],
    "status": "-2",
    "origin": "-1",
    "problemType": "-2",
    "priority": "HIGH",
    "remarks": "This is a service call created usiing new API",
    "resolution": "string",
    "responsibles": [
      {
        "id": "CF739486FC4018AF18301105EB2675EB",
        "code": "EMP001",
        "externalId": "C4CEMP001"
      }
    ],
    "subject": "This is from Post man with new API",
    "address": {
      "source": "SERVICECALL",
      "sourceId": "ACB0605B150947AD87FD46A3A3B7A5AE",
      "country": "IN",
      "state": "Karnataka",
      "city": "Bangalore",
      "zipCode": "560066",
      "street": "EPIP",
      "streetNumber": "138"
    },
    "activities": [
      {
        "id": "9478555DAAB64A90B307B13B6F6E4E02",
        "code": "2",
        "externalId": "C4CACT000101",
        "lastChanged": 1551617197798,
        "subject": "2- Created from post man march 1 2:30",
        "remarks": "1- This activity was Created from post man march 1 2:30",
        "contact": {
          "id": "FA174AFC196440A39BE7F6EA062999A6",
          "code": null,
          "externalId": "C4CCONT001"
        },
        "createPerson": {
          "id": "A7375F70D0AE4377B9635B3EA978EB7B",
          "code": null,
          "externalId": null
        },
        "durationInMinutes": 90,
        "dueDateTime": "2019-03-02T08:38:56Z",
        "earliestStartDateTime": "2019-03-01T08:38:56Z",
        "status": "DRAFT",
        "address": null,
        "equipment": {
          "id": "0B607DC8838C4440AD4DF0934723F577",
          "code": "EQ001",
          "externalId": "C4CEQ001"
        },
        "responsibles": [],
        "reservedMaterials": []
      },
      {
        "id": "0505D98B5BBE44579FE6526229B35330",
        "code": "3",
        "externalId": "C4CACT000102",
        "lastChanged": 1551617197910,
        "subject": "2 - Created from post man march 1 2:30",
        "remarks": "2 - This activity was Created from post man march 1 2:30",
        "contact": {
          "id": "FA174AFC196440A39BE7F6EA062999A6",
          "code": null,
          "externalId": "C4CCONT001"
        },
        "createPerson": {
          "id": "A7375F70D0AE4377B9635B3EA978EB7B",
          "code": null,
          "externalId": null
        },
        "durationInMinutes": 90,
        "dueDateTime": "2019-03-04T08:38:56Z",
        "earliestStartDateTime": "2019-03-01T08:38:56Z",
        "status": "DRAFT",
        "address": null,
        "equipment": {
          "id": "0B607DC8838C4440AD4DF0934723F577",
          "code": "EQ001",
          "externalId": "C4CEQ001"
        },
        "responsibles": [],
        "reservedMaterials": []
      }
    ],
    "reservedMaterials": [
      {
        "id": "C9B27C992B344DDAA11D1D3A8CBD6F89",
        "externalId": null,
        "item": {
          "id": "09630B3B811D4D7CB8DA458BE67289D3",
          "code": "MAT001",
          "externalId": "MCF-0003"
        },
        "serialNumber": null,
        "quantity": 3,
        "warehouse": {
          "id": "02EA5504744746C7AA14574ECC6BEA41",
          "code": "W000",
          "externalId": null
        },
        "used": 0,
        "moved": 0,
        "shipped": null
      }
    ]
  }
}

Activity Completed

The following is an example of a payload sent when Activity.status == CLOSED and all related efforts efforts.status<>OPEN and have been synced:

eventType: activity.completed
eventPayload: 
   ServiceCall1 (id, code, externalId)
      Activity1 (whole payload)						// signature from service API
         timeEfforts: [{
            TimeEffort1 {
                whole payload with externalId, 
				status: APPROVED 
            },
            TimeEffort2 {
                whole payload with externalId, 
				status: DECLINED_CLOSED 			// we provide the final state, not only APPROVED but also DECLINED_CLOSED
            },
         }],
         expenses: [{								
            Expense1,
            Expense2
         }],
         materials: [{
            Material1,
            Material2
         }],
         mileages: [{
			Mileage1,
			Mileage2
         }]
     }
  }


{
  "eventType": "activity.completed",
  eventTypeVersion: "1.0",
  cloudEventsVersion: "0.1",
  source: "fsm-connector/api/v1",
  eventID: "263AADCA529C4D15BC4AA7F9A81AE81E",
  eventTime: "2019-03-23T22:23:14.888Z",
  contentType: "application/json",
  extensions: {
    traceId=2d1af04cc6ec42878a7a076df3810c4f
  },
  data: {
    "id": "499EFD59949A46F99E91B72CB26FB291",
    "code": "31",
    "externalId": "sc1ExternalId",
    "lastChanged": 1552948361383,
    "businessPartner": {
      "id": "41D357DF882C448CAE9795501BA00D40",
      "code": null,
      "externalId": null
    },
    "contact": null,
    "createPerson": {
      "id": "14523B3D57424338858CB56BBF120696",
      "code": null,
      "externalId": "admin"
    },
    "dueDateTime": "2018-07-02T21:59:59Z",
    "earliestStartDateTime": "2018-07-02T16:15:00Z",
    "durationInMinutes": null,
    "equipments": [
      {
        "id": "5D398AC9985F4019930FD7CB09AD8765",
        "code": "6",
        "externalId": "E000004"
      }
    ],
    "status": "-2",
    "origin": "-1",
    "problemType": null,
    "priority": "MEDIUM",
    "remarks": null,
    "resolution": null,
    "responsibles": [
      {
        "id": "14523B3D57424338858CB56BBF120696",
        "code": null,
        "externalId": "admin"
      }
    ],
    "subject": "Install new ticket scanners",
    "address": null,
    "activities": [
      {
        "id": "4100432D358144C8BEC8B697D6B9F6D4",
        "code": "29",
        "externalId": null,
        "lastChanged": 1530545979996,
        "subject": "Install new ticket scanners",
        "remarks": null,
        "contact": null,
        "createPerson": {
          "id": "14523B3D57424338858CB56BBF120696",
          "code": null,
          "externalId": "admin"
        },
        "durationInMinutes": null,
        "dueDateTime": "2018-07-02T21:59:00Z",
        "earliestStartDateTime": "2018-07-02T15:38:00Z",
        "status": "DRAFT",
        "address": null,
        "equipment": {
          "id": "5D398AC9985F4019930FD7CB09AD8765",
          "code": "6",
          "externalId": "E000004"
        },
        "responsibles": [],
        "reservedMaterials": []
      },
      {
        "id": "FFE617B34D5341DDA5EB371B85696450",
        "code": "73",
        "externalId": null,
        "lastChanged": 1554703397213,
        "subject": "test1",
        "remarks": null,
        "contact": {
          "id": "F9A2DB4E9BE047348A2682D63408D176",
          "code": "kiw",
          "externalId": "C00004_kiw@coresystems.net"
        },
        "createPerson": {
          "id": "14523B3D57424338858CB56BBF120696",
          "code": "admin",
          "externalId": "admin"
        },
        "durationInMinutes": null,
        "dueDateTime": "2019-04-08T21:59:00Z",
        "earliestStartDateTime": "2019-04-08T05:14:00Z",
        "status": "CLOSED",
        "address": null,
        "equipment": null,
        "responsibles": [
          {
            "id": "60A745386C71444B96B29FBCCFC46C39",
            "code": null,
            "externalId": "tech1"
          }
        ],
        "reservedMaterials": [],
        "eventType": "activity.completed",
        "timeEfforts": [
          {
            "subTask": null,
            "totalPrice": null,
            "discount": null,
            "owners": null,
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "inactive": false,
            "startDateTimeTimeZoneId": "Europe/Warsaw",
            "endDateTimeTimeZoneId": "Europe/Warsaw",
            "id": "D8C00CB4086B4870A5A93C675E992608",
            "breakInMinutes": 0,
            "unitPrice": null,
            "timeZoneId": "UTC+02:00",
            "lastChanged": 1554702220040,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "endDateTime": "2019-04-08T05:44:00Z",
            "branches": null,
            "internalRemarks": null,
            "createDateTime": "2019-04-08T05:43:39Z",
            "breakStartDateTime": null,
            "startDateTime": "2019-04-08T05:43:00Z",
            "task": null,
            "udfMetaGroups": null,
            "breakStartDateTimeTimeZoneId": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          },
          {
            "subTask": null,
            "totalPrice": null,
            "discount": null,
            "owners": null,
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "inactive": false,
            "startDateTimeTimeZoneId": "Europe/Warsaw",
            "endDateTimeTimeZoneId": "Europe/Warsaw",
            "id": "4661A9FDA3F34B76B7E82F5B08668248",
            "breakInMinutes": 0,
            "unitPrice": null,
            "timeZoneId": "UTC+02:00",
            "lastChanged": 1554702192939,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "endDateTime": "2019-04-08T05:44:00Z",
            "branches": null,
            "internalRemarks": null,
            "createDateTime": "2019-04-08T05:43:12Z",
            "breakStartDateTime": null,
            "startDateTime": "2019-04-08T05:42:00Z",
            "task": null,
            "udfMetaGroups": null,
            "breakStartDateTimeTimeZoneId": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          },
          {
            "subTask": null,
            "totalPrice": null,
            "discount": null,
            "owners": null,
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "inactive": false,
            "startDateTimeTimeZoneId": "Europe/Warsaw",
            "endDateTimeTimeZoneId": "Europe/Warsaw",
            "id": "BCF8BAB781AD4CEABAEB78FACC25CC6E",
            "breakInMinutes": 0,
            "unitPrice": null,
            "timeZoneId": "UTC+02:00",
            "lastChanged": 1554702264961,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "endDateTime": "2019-04-08T05:43:00Z",
            "branches": null,
            "internalRemarks": null,
            "createDateTime": "2019-04-08T05:42:49Z",
            "breakStartDateTime": null,
            "startDateTime": "2019-04-08T05:42:00Z",
            "task": null,
            "udfMetaGroups": null,
            "breakStartDateTimeTimeZoneId": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_CHANGE_FOR_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "DECLINED_CLOSED"
          }
        ],
        "expenses": [
          {
            "date": "2019-04-08",
            "code": null,
            "lastChanged": 1554702331208,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "tax": null,
            "owners": null,
            "type": "DB4AF371046544EF851AB28DB4C2CBF3",
            "branches": null,
            "chargeOption": "NONCHARGEABLE",
            "createDateTime": "2019-04-08T05:45:31Z",
            "externalAmount": {
              "amount": 150.0,
              "currency": "EUR"
            },
            "syncObjectKPIs": null,
            "inactive": false,
            "udfMetaGroups": null,
            "internalAmount": {
              "amount": 100.0,
              "currency": "EUR"
            },
            "location": null,
            "id": "F492C952B1EC42B2A22C77268AB68AC1",
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          }
        ],
        "materials": [
          {
            "date": "2019-04-08",
            "code": null,
            "owners": null,
            "managedByBatchItems": [],
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "itemName": null,
            "inactive": false,
            "id": "8F7D49964A48497986941A34D373D21B",
            "unitPrice": {
              "amount": 70.0,
              "currency": "EUR"
            },
            "item": {
              "code": "5",
              "externalId": "I000005",
              "id": "16418A0965D14E699279EBD8E8353CC2"
            },
            "quantity": 5.0,
            "serialNumbers": [],
            "lastChanged": 1554702456289,
            "equipment": "338B8383CAF249DEB8565FFB83376B59",
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "warehouse": "02EA5504744746C7AA14574ECC6BEA41",
            "branches": null,
            "createDateTime": "2019-04-08T05:46:53Z",
            "udfMetaGroups": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_CHANGE_FOR_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "DECLINED_CLOSED"
          },
          {
            "date": "2019-04-08",
            "code": null,
            "owners": null,
            "managedByBatchItems": [],
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "itemName": null,
            "inactive": false,
            "id": "5CAF2FA4B5A1408C860A5ED71D70EEC8",
            "unitPrice": {
              "amount": 3.0,
              "currency": "EUR"
            },
            "item": {
              "code": "4",
              "externalId": "I000004",
              "id": "A0B3E87B3C534C91B3DC5ED703443C2B"
            },
            "quantity": 5.0,
            "serialNumbers": [],
            "lastChanged": 1554702374691,
            "equipment": "13FDBBE52C144D9CA7899F53E9CD428D",
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "warehouse": "02EA5504744746C7AA14574ECC6BEA41",
            "branches": null,
            "createDateTime": "2019-04-08T05:46:14Z",
            "udfMetaGroups": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          }
        ],
        "mileages": [
          {
            "date": null,
            "code": null,
            "distance": null,
            "destination": null,
            "owners": null,
            "source": null,
            "type": null,
            "travelEndDateTime": "2019-04-08T05:47:00Z",
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "travelEndDateTimeTimeZoneId": "Europe/Warsaw",
            "inactive": false,
            "travelStartDateTime": "2019-04-08T05:46:00Z",
            "id": "7301701CD4434FB6A611E79FC5E7AD32",
            "travelStartDateTimeTimeZoneId": "Europe/Warsaw",
            "lastChanged": 1554702440308,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "branches": null,
            "createDateTime": "2019-04-08T05:47:20Z",
            "driver": false,
            "udfMetaGroups": null,
            "location": null,
            "udfValues": null,
            "privateCar": false,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "FFE617B34D5341DDA5EB371B85696450",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          }
        ]
      }
    ],
    "reservedMaterials": []
  }
}

S4 Outbound

Activity Confirmed

This SAP Field Service Management event will only be sent when TimeEffort/Expsense/Material/Mileage entries are confirmed.

{
  "eventType": "activity.confirmed",
  "eventTypeVersion": "1.0",
  "cloudEventsVersion": "0.1",
  "source": "api/fsm-connector/v1",
  "eventID": "63d9114e-8783-4c47-a4ac-a84cb7e5e319",
  "eventTime": "2019-05-08T06:40:03.111Z",
  "contentType": "application/json",
  "extensions": {
    traceId=255e041053dcc4f8
  },
  "data": {
    "serviceCall": {
      "unifiedIdentifier": {
        "id": "263AADCA529C4D15BC4AA7F9A81AE81E",
        "code": "1",
        "externalId": "sc2ExId"
      },
      "activity": {
        "unifiedIdentifier": {
          "id": "4927D0D9B6DB4734A418B467FCE88162",
          "code": "1",
          "externalId": "act3ExId"
        },
        "activityData": {
          "id": "4927D0D9B6DB4734A418B467FCE88162",
          "code": "1",
          "externalId": "act3ExId",
          "lastChanged": 1554703397213,
          "subject": "test1",
          "remarks": null,
          "contact": {
            "id": "F9A2DB4E9BE047348A2682D63408D176",
            "code": "kiw",
            "externalId": "C00004_kiw@coresystems.net"
          },
          "createPerson": {
            "id": "14523B3D57424338858CB56BBF120696",
            "code": "admin",
            "externalId": "admin"
          },
          "durationInMinutes": null,
          "dueDateTime": "2019-04-08T21:59:00Z",
          "earliestStartDateTime": "2019-04-08T05:14:00Z",
          "status": "CLOSED",
          "address": null,
          "equipment": null,
          "responsibles": [
            {
              "id": "60A745386C71444B96B29FBCCFC46C39",
              "code": null,
              "externalId": "tech1"
            }
          ],
          "reservedMaterials": [],
          "type": "ASSIGNMENT",
          "sourceActivity": {
            "id": "CDA7EF1624E849FF91846CF27420FFEB",
            "code": "77",
            "externalId": "activityExternalId1"
          }
        },
        "timeEfforts": [
          {
            "subTask": null,
            "totalPrice": null,
            "discount": null,
            "owners": null,
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "inactive": false,
            "startDateTimeTimeZoneId": "Europe/Warsaw",
            "endDateTimeTimeZoneId": "Europe/Warsaw",
            "id": "8F5798B7F0AF434495DF9579A1E8A46C",
            "breakInMinutes": 0,
            "unitPrice": null,
            "timeZoneId": "UTC+02:00",
            "lastChanged": 1554480660624,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "endDateTime": "2019-04-05T18:12:00Z",
            "branches": null,
            "internalRemarks": null,
            "createDateTime": "2019-04-05T16:11:00Z",
            "breakStartDateTime": null,
            "startDateTime": "2019-04-05T16:10:00Z",
            "task": null,
            "udfMetaGroups": null,
            "breakStartDateTimeTimeZoneId": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": "Effort2",
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "4927D0D9B6DB4734A418B467FCE88162",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          },
          {
            "subTask": null,
            "totalPrice": null,
            "discount": null,
            "owners": null,
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "inactive": false,
            "startDateTimeTimeZoneId": "Europe/Warsaw",
            "endDateTimeTimeZoneId": "Europe/Warsaw",
            "id": "05A78AED82924F3DBEE1E672C8B3CDCC",
            "breakInMinutes": 0,
            "unitPrice": null,
            "timeZoneId": "UTC+02:00",
            "lastChanged": 1554480636038,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "endDateTime": "2019-04-05T17:11:00Z",
            "branches": null,
            "internalRemarks": null,
            "createDateTime": "2019-04-05T16:10:35Z",
            "breakStartDateTime": null,
            "startDateTime": "2019-04-05T16:10:00Z",
            "task": null,
            "udfMetaGroups": null,
            "breakStartDateTimeTimeZoneId": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": "Effort1",
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "4927D0D9B6DB4734A418B467FCE88162",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          }
        ],
        "expenses": [
          {
            "date": "2019-04-05",
            "code": null,
            "lastChanged": 1554480782766,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "tax": null,
            "owners": null,
            "type": {
              "code": "2",
              "externalId": "ET2",
              "id": "DB4AF371046544EF851AB28DB4C2CBF3"
            },
            "branches": null,
            "chargeOption": "NONCHARGEABLE",
            "createDateTime": "2019-04-05T16:13:02Z",
            "externalAmount": {
              "amount": 200.0,
              "currency": "EUR"
            },
            "syncObjectKPIs": null,
            "inactive": false,
            "udfMetaGroups": null,
            "internalAmount": {
              "amount": 100.0,
              "currency": "EUR"
            },
            "location": null,
            "id": "48A8C5EAFE4649369308A51F9905EEB5",
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "4927D0D9B6DB4734A418B467FCE88162",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          }
        ],
        "materials": [
          {
            "date": "2019-04-05",
            "code": null,
            "owners": null,
            "managedByBatchItems": [],
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "itemName": null,
            "inactive": false,
            "id": "50926FA7BCAF40B59E2812E2712F0435",
            "unitPrice": {
              "amount": 200.0,
              "currency": "EUR"
            },
            "item": {
              "code": "5",
              "externalId": "I000005",
              "id": "16418A0965D14E699279EBD8E8353CC2"
            },
            "quantity": 30.0,
            "serialNumbers": [],
            "lastChanged": 1554480964210,
            "equipment": "13FDBBE52C144D9CA7899F53E9CD428D",
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "warehouse": "02EA5504744746C7AA14574ECC6BEA41",
            "branches": null,
            "createDateTime": "2019-04-05T16:16:00Z",
            "udfMetaGroups": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": "Material2 Item2",
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "4927D0D9B6DB4734A418B467FCE88162",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED",
            "reservedMaterials": []
          },
          {
            "date": "2019-04-05",
            "code": null,
            "owners": null,
            "managedByBatchItems": [],
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "itemName": null,
            "inactive": false,
            "id": "3D1F030C1F6F4A5CBEC8714A986FD2AC",
            "unitPrice": {
              "amount": 100.0,
              "currency": "EUR"
            },
            "item": {
              "code": "4",
              "externalId": "I000004",
              "id": "A0B3E87B3C534C91B3DC5ED703443C2B"
            },
            "quantity": 50.0,
            "serialNumbers": [],
            "lastChanged": 1554480912558,
            "equipment": "13FDBBE52C144D9CA7899F53E9CD428D",
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "warehouse": "02EA5504744746C7AA14574ECC6BEA41",
            "branches": null,
            "createDateTime": "2019-04-05T16:15:12Z",
            "udfMetaGroups": null,
            "location": null,
            "udfValues": null,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": "Material1 Item1",
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "4927D0D9B6DB4734A418B467FCE88162",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED",
            "reservedMaterials": [
              {
                "id": "605D75A14E8843F9A84421EA54E0E52E",
                "code": null,
                "externalId": "82"
              }
            ]
          }
        ],
        "mileages": [
          {
            "date": null,
            "code": null,
            "distance": null,
            "destination": null,
            "owners": null,
            "source": null,
            "type": null,
            "travelEndDateTime": "2019-04-05T17:17:00Z",
            "chargeOption": "NONCHARGEABLE",
            "syncObjectKPIs": null,
            "travelEndDateTimeTimeZoneId": "Europe/Warsaw",
            "inactive": false,
            "travelStartDateTime": "2019-04-05T16:16:00Z",
            "id": "D75A874458BD48BD9FEDA9CCB28D2B10",
            "travelStartDateTimeTimeZoneId": "Europe/Warsaw",
            "lastChanged": 1554480993669,
            "createPerson": "60A745386C71444B96B29FBCCFC46C39",
            "externalId": null,
            "groups": null,
            "branches": null,
            "createDateTime": "2019-04-05T16:16:33Z",
            "driver": false,
            "udfMetaGroups": null,
            "location": null,
            "udfValues": null,
            "privateCar": false,
            "lastChangedBy": "14523B3D57424338858CB56BBF120696",
            "remarks": null,
            "syncStatus": "REQUIRES_APPROVAL",
            "object": {
              "objectId": "4927D0D9B6DB4734A418B467FCE88162",
              "objectType": "ACTIVITY"
            },
            "approvalStatus": "APPROVED"
          }
        ]
      }
    }
  }
}

Activity Completed

This event occurs when activity.status == CLOSED and all related EMME entries (timeEffort/expense/material/mileage) are in final Approval status (APPROVED or DECLINED_CLOSED).

For example:

  • The Activity was closed and all related EMME entries (timeEffort/expense/material/mileage) were already in final Approval status (APPROVED or DECLINED_CLOSED).

Example Payload for Completed Activiy

{
  "eventType": "activity.completed",
  "eventTypeVersion": "1.0",
  "cloudEventsVersion": "0.1",
  "source": "fsm-connector/api/v1",
  "eventID": "67795466-3882-484b-893b-cc4b541efb98",
  "eventTime": "2019-05-03T16:40:06.417Z",
  "contentType": "application/json",
  "extensions": {
    traceId=8fcc999fabb0e8b7
  },
  "data": {
    "id": "499EFD59949A46F99E91B72CB26FB291",
    "code": "31",
    "externalId": "sc1ExternalId",
    "lastChanged": 1552948361383,
    "businessPartner": {
      "id": "41D357DF882C448CAE9795501BA00D40",
      "code": null,
      "externalId": null
    },
    "contact": null,
    "createPerson": {
      "id": "14523B3D57424338858CB56BBF120696",
      "code": null,
      "externalId": "admin"
    },
    "dueDateTime": "2018-07-02T21:59:59Z",
    "earliestStartDateTime": "2018-07-02T16:15:00Z",
    "durationInMinutes": null,
    "equipments": [
      {
        "id": "5D398AC9985F4019930FD7CB09AD8765",
        "code": "6",
        "externalId": "E000004"
      }
    ],
    "status": "-2",
    "origin": "-1",
    "problemType": null,
    "priority": "MEDIUM",
    "remarks": null,
    "resolution": null,
    "responsibles": [
      {
        "id": "14523B3D57424338858CB56BBF120696",
        "code": null,
        "externalId": "admin"
      }
    ],
    "subject": "Install new ticket scanners",
    "address": null,
    "activities": [
      {
        "id": "4100432D358144C8BEC8B697D6B9F6D4",
        "code": "29",
        "externalId": null,
        "lastChanged": 1530545979996,
        "subject": "Install new ticket scanners",
        "remarks": null,
        "contact": null,
        "createPerson": {
          "id": "14523B3D57424338858CB56BBF120696",
          "code": null,
          "externalId": "admin"
        },
        "durationInMinutes": null,
        "dueDateTime": "2018-07-02T21:59:00Z",
        "earliestStartDateTime": "2018-07-02T15:38:00Z",
        "status": "DRAFT",
        "address": null,
        "equipment": {
          "id": "5D398AC9985F4019930FD7CB09AD8765",
          "code": "6",
          "externalId": "E000004"
        },
        "responsibles": [],
        "reservedMaterials": []
      },
      {
        "id": "FFE617B34D5341DDA5EB371B85696450",
        "code": "73",
        "externalId": null,
        "lastChanged": 1554703397213,
        "subject": "test1",
        "remarks": null,
        "contact": {
          "id": "F9A2DB4E9BE047348A2682D63408D176",
          "code": "kiw",
          "externalId": "C00004_kiw@coresystems.net"
        },
        "createPerson": {
          "id": "14523B3D57424338858CB56BBF120696",
          "code": "admin",
          "externalId": "admin"
        },
        "durationInMinutes":