Pepperi API Design
Search…
Generic Resource
PEPPERI NOTIFICATION SERVICE
Actions Queue
CPI Node
TODO training
Powered By GitBook
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
https://api.pepperi.com
/v1.0/notification/publish
Publish message for PNS
The addon subscription relative URL will be invoked (POST) with the body:
1
{
2
"Type": "",
3
"Message": {},
4
"FilterAttributes": {
5
[key: string]: number | string | string[]
6
}
7
}
Copied!
Below is a list of known notifications that are published in the PNS

Type: 'data'

data changes published from the NUC & ADAL & PAPI
1
{
2
"Type": "data",
3
"FilterAttributes": {
4
"ModifiedFields": ["Name", "IsFixedDiscount"],
5
"AddonUUID":"", // 00000000-0000-0000-0000-00000000c07e for nucleus, use lower case
6
"ModifiedObjects": [], // list of ObjectUUID - Phase 2
7
"Resource": "activities",
8
"Action": "update/insert/remove",
9
"UserUUID": "649f264b-3135-429a-862a-7212abfe3f66"
10
},
11
"Message": {
12
"ActionUUID": "9c9f3576-8d80-48d2-aea6-f11bc3ee263c",
13
"ModifiedObjects": [
14
{
15
"ObjectKey": "dad3e433-eb39-400f-ae4e-7c3864f148ea",
16
"ObjectModificationDateTime": "2021-03-10T12:30:45.627",
17
"ModifiedFields": [
18
{
19
"FieldID": "IsFixedDiscount",
20
"NewValue": false,
21
"OldValue": true
22
}
23
]
24
},
25
{
26
"ObjectKey": "0f39d939-ff4c-43a7-92e6-17851a407170",
27
"ObjectModificationDateTime": "2021-03-10T12:30:45.627",
28
"ModifiedFields": [
29
{
30
"FieldID": "Name",
31
"NewValue": "a",
32
"OldValue": "b"
33
}
34
]
35
}
36
]
37
}
38
}
Copied!
1
// expample for add-on's change version
2
{
3
"Type": "data",
4
"FilterAttributes": {
5
"ModifiedFields": ["Version"],
6
"AddonUUID":"00000000-0000-0000-0000-00000000a91",
7
"Resource": "installed_addons",
8
"Action": "update",
9
"UserUUID": "649f264b-3135-429a-862a-7212abfe3f66"
10
},
11
"Message": {
12
"ActionUUID": "9c9f3576-8d80-48d2-aea6-f11bc3ee263c",
13
"ModifiedObjects": [
14
{
15
"ObjectKey": "{{INSTALLED_ADDON_UUID}}",
16
"ObjectModificationDateTime": "2021-03-10T12:30:45.627",
17
"ModifiedFields": [
18
{
19
"FieldID": "Version",
20
"NewValue": "0.0.2",
21
"OldValue": "0.0.1"
22
}
23
]
24
}
25
]
26
}
27
}
Copied!
1
// expample for add-on uninstall
2
{
3
"Type": "data",
4
"FilterAttributes": {
5
"ModifiedFields": ["Hidden"],
6
"AddonUUID":"00000000-0000-0000-0000-00000000a91",
7
"Resource": "installed_addons",
8
"Action": "update",
9
"UserUUID": "649f264b-3135-429a-862a-7212abfe3f66"
10
},
11
"Message": {
12
"ActionUUID": "9c9f3576-8d80-48d2-aea6-f11bc3ee263c",
13
"ModifiedObjects": [
14
{
15
"ObjectKey": "{{INSTALLED_ADDON_UUID}}",
16
"ObjectModificationDateTime": "2021-03-10T12:30:45.627",
17
"ModifiedFields": [
18
{
19
"FieldID": "Hidden",
20
"NewValue": true,
21
"OldValue": false
22
}
23
]
24
}
25
]
26
}
27
}
Copied!

Type: 'action' - irrelevant maybe?

1
{
2
"Type": "action",
3
"FilterAttributes": {
4
"Status": "New" | "InProgress" | "Success" | "Failure" | "InRetry",
5
"UserUUID": "649f264b-3135-429a-862a-7212abfe3f66",
6
"AddonUUID": "9c9f3576-8d80-48d2-aea6-f11bc3ee263c",
7
"AddonRelativeURL": "", // no query params
8
},
9
"Message": {
10
"ActionUUID": "9c9f3576-8d80-48d2-aea6-f11bc3ee263c",
11
"ObjectURL": "addon/data/adal-uuid/executions/key",
12
13
}
14
}
Copied!

Type: 'event'

Events published from addons
1
{
2
"Type": "event".
3
"FilterAttributes": {
4
"UserUUID": "649f264b-3135-429a-862a-7212abfe3f66",
5
"AddonUUID": "9c9f3576-8d80-48d2-aea6-f11bc3ee263c",
6
"Name": "any event name defined by the addon",
7
addition fields per event
8
},
9
"Message": {
10
"ActionUUID": "9c9f3576-8d80-48d2-aea6-f11bc3ee263c",
11
"ObjectURL": "addon/data/adal-uuid/executions/key",
12
addition fields per event
13
}
14
}
Copied!
Last modified 3mo ago