PEPPERI NOTIFICATION SERVICE
Actions Queue
CPI Node

Publish message

Publish message for PNS

There are different types of messages that are published to the PNS.

data - changes in data published by the NUC ADAL or other data sources action - async addon API calls publish stages in the Job Info object event - addons can publish events that other addons can susbcribe

Only the ADAL & NUC can publish data Only the Addon Async API mechanism can publish action Only system addons can publish event

FilterAttributes available types: string, strings array and number

The Filter policy is applied to the filter attributes. If the filter attribute is an array, then the policy will pass if there is one value that is in both arrays (Union).

post
Publish message for PNS

https://api.pepperi.com/v1.0/notification/publish
Request
Response
Request
Headers
X-Pepperi-OwnerID
optional
string
addon uuid
X-Pepperi-SecretKey
optional
string
addon key
Body Parameters
Type
required
string
action/data/adal
Message
required
object
json message
FilterAttributes
required
object
filter attributes that matches to the subscribe filter policy
Response
200: OK
Cake successfully retrieved.
{
"Success": true
}

The addon subscription relative URL will be invoked (POST) with the body:

{
"Type": "",
"Message": {},
"FilterAttributes": {
[key: string]: number | string | string[]
}
}

Below is a list of known notifications that are published in the PNS

Type: 'data'

data changes published from the NUC & ADAL

{
"Type": "data",
"FilterAttributes": {
"ModifiedFields": ["Name", "IsFixedDiscount"],
"AddonUUID":"", // 00000000-0000-0000-0000-00000000c07e for nucleus, use lower case
"ModifiedObjects": [], // list of ObjectUUID - Phase 2
"Resource": "activities",
"Action": "update/insert/remove",
"UserUUID": "649f264b-3135-429a-862a-7212abfe3f66"
},
"Message": {
"ActionUUID": "9c9f3576-8d80-48d2-aea6-f11bc3ee263c",
"ModifiedObjects": [
{
"ObjectKey": "dad3e433-eb39-400f-ae4e-7c3864f148ea",
"ObjectModificationDateTime": "2021-03-10T12:30:45.627",
"ModifiedFields": [
{
"FieldID": "IsFixedDiscount",
"NewValue": false,
"OldValue": true
}
]
},
{
"ObjectKey": "0f39d939-ff4c-43a7-92e6-17851a407170",
"ObjectModificationDateTime": "2021-03-10T12:30:45.627",
"ModifiedFields": [
{
"FieldID": "Name",
"NewValue": "a",
"OldValue": "b"
}
]
}
]
}
}

Type: 'action' - irrelevant maybe?

{
"Type": "action",
"FilterAttributes": {
"Status": "New" | "InProgress" | "Success" | "Failure" | "InRetry",
"UserUUID": "649f264b-3135-429a-862a-7212abfe3f66",
"AddonUUID": "9c9f3576-8d80-48d2-aea6-f11bc3ee263c",
"AddonRelativeURL": "", // no query params
},
"Message": {
"ActionUUID": "9c9f3576-8d80-48d2-aea6-f11bc3ee263c",
"ObjectURL": "addon/data/adal-uuid/executions/key",
}
}

Type: 'event'

Events published from addons

{
"Type": "event".
"FilterAttributes": {
"UserUUID": "649f264b-3135-429a-862a-7212abfe3f66",
"AddonUUID": "9c9f3576-8d80-48d2-aea6-f11bc3ee263c",
"Name": "any event name defined by the addon",
addition fields per event
},
"Message": {
"ActionUUID": "9c9f3576-8d80-48d2-aea6-f11bc3ee263c",
"ObjectURL": "addon/data/adal-uuid/executions/key",
addition fields per event
}
}