Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Current »

The Activity Webhook REST API Interface defines the REST API interface which customers will need to implement if they would like to consume and process ServiceMobility webhooks via their own systems.

By implementing an API which matches the Activity Webhook REST API Interface, customers can receive real-time updates regarding Activity records within ServiceMobility.

Activity Webhook payload will contain one Activity Export Notification Object.

Resource URL Summary

Activity Export Notification

POST <REST Endpoint URI>/Activities/

HTTP Headers

ServiceMobility will set both of the Standard HTTP Headers when calling this REST API Interface.

That is:

  • The Content-Type header will be set to application/json; and
  • The x-access-token header will be set to the JWT that was used in the call to the API that triggered ServiceMobility to call the configured endpoint that implements this interface.

The x-access-token header will either be the JWT issued by ServiceMobility, or by the endpoint that implements the Authentication REST API Interface that ServiceMobility has been configured to use.

Implementations of this interface may evaluate the JWT supplied, if required, but please note that ServiceMobility will have already authenticated the JWT in the initial API call before passing the call on to the configured endpoint.


API Specifics

Activity Export Notification

URL

POST <REST Endpoint URI>/Activities/

HTTP Request Body

The HTTP request body will contain a valid Webhook Request Object. Within the data property of the Webhook Request Object will be a valid Activity Export API Object.

Webhook Request Object Formats

JSON Format
{
    "id": "f0facfbb-e945-4b90-977d-1671bc0c60ab",
	"type": "Activity|PhysicalInventoryRequest|LoadInventory|InventoryTransfer|InventoryUsage|StockLevelRecommendation|TimeEntry|UserAudit|WorkOrder",
	"specversion": "1.0",
	"source": "5ad09380-8258-4d84-a440-e2d35043ae92",
	"subject": null, // Not used
	"time": "2022-07-27T23:10:12.000Z",
	"datacontenttype": "application/json",
	"action": "",
	"data": {} // Will vary depending on precise use case
}

Webhook Request Object Properties

(info) Required properties are in bold.

PropertyTypeDescription
idstring

ID representing this unique payload. Subsequent requests with duplicate IDs should be disregarded.

typestring

The object type represented by the data field.

Valid values are:

  • Activity
  • PhysicalInventoryRequest
  • LoadInventory
  • InventoryTransfer
  • InventoryUsage
  • StockLevelRecommendation
  • TimeEntry
  • UserAudit
  • WorkOrder
specversionstringThe CloudEvents spec version that this payload complies with.
sourcestringThe ID of the webhook that generated this message.
subjectstringNot used.
timestringTime that this webhook execution was generated.
datacontenttypestring

The format of the data object.

Valid values are:

  • application/json
actionstringAdditional information and context for this webhook call.
dataobject

The data payload, matching the format of the object type specified in type property.

Activity Export Notification Object

JSON Format
{
    "rowver" : "",
    "rows" : [
        {
            "rowver" : "",
            "Activity" : {
               //  Activity JSON object properties
           }
        }
    ]
}

HTTP Response

Response Codes

HTTP CodeDescription
200OK. The Activity request was received successfully.
401Invalid Logon.
500Server error. An error occurred while processing the request. The HTTP response body should have more details as to the possible cause.

On success, an HTTP response code of 200 must be returned.

  • No labels