Skip to main content

Handling notifications

What Is a Notification?​

A Notification represents a request from a Data Owner to another to perform an operation.
As for now, there are three types of Notifications:

  • KEY_PAIR_UPDATE: when a Patient loses their private key and gets a new one, they can send this type of Notification to a Healthcare professional to ask them to share their data with them again.
  • NEW_USER_OWN_DATA_ACCESS: when a Patient logs in for the first time, they can send this type of Notification to a Healthcare professional to aks for access to their own data.
  • OTHER: all the other use cases.

Status of a Notification​

You can manage the lifecycle of a Notification by altering its status. Each Notification can have four possible states:

  • pending: the Notification was created, and it is waiting to be managed.
  • ongoing: the Notification was acknowledged, and the operations it prescribes are being managed.
  • completed: the Notification was managed, and the operations it prescribes ended.
  • cancelled: the Notification was cancelled without starting the operations it prescribes.

Creating a Notification​

note

To perform the following operations, we suppose you have at least a Patient and a Healthcare professional in your database.

In the following example, a Patient creates a Notification for a Healthcare professional communicating that they have a new key and need access to their data.

const accessNotification = await patientApi.notificationApi.createOrModify(
new Notification({
type: NotificationTypeEnum.KeyPairUpdate,
}),
hcp.id,
)
accessNotification
{
"id": "ac89c39d-b027-4e61-8d5a-545f20f96e8a",
"rev": "1-74da0a8944ab3b41297537200fd6ee21",
"status": "pending",
"created": 1700058669705,
"identifiers": [],
"modified": 1700058669705,
"author": "*",
"responsible": "*",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "Wd1S2JpAImXeqGCqyynEWxJ1vHJF7CpCrqiEe6fuQwRKg6/lRllF8nN41ca53vid",
"tags": {}
}
}
note

The default status of a Notification is pending

Retrieving a Notification​

Retrieving a Notification Using its Id​

In the following example, a Patient creates a Notification for a Healthcare professional and then retrieves it using its id.

const createdNotification = await patientApi.notificationApi.createOrModify(
new Notification({
type: NotificationTypeEnum.Other,
}),
hcp.id,
)

const retrievedNotification = await patientApi.notificationApi.get(createdNotification.id)
createdNotification
{
"id": "6f5a659a-9d0a-4eb6-8458-52128facd75f",
"rev": "1-b6c03e30839ca9506fd1f6d442b3289b",
"status": "pending",
"created": 1700058669742,
"identifiers": [],
"modified": 1700058669742,
"author": "*",
"responsible": "*",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "2JkArNw6iO/MzoagKU6OsnKaSwIgaAJPZOtsmKcBLn108KJcWIpNZmPZw4l8JXk1",
"tags": {}
}
}
retrievedNotification
{
"id": "6f5a659a-9d0a-4eb6-8458-52128facd75f",
"rev": "1-b6c03e30839ca9506fd1f6d442b3289b",
"status": "pending",
"created": 1700058669742,
"identifiers": [],
"modified": 1700058669742,
"author": "*",
"responsible": "*",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "2JkArNw6iO/MzoagKU6OsnKaSwIgaAJPZOtsmKcBLn108KJcWIpNZmPZw4l8JXk1",
"tags": {}
}
}

Retrieving Notifications Using Complex Criteria​

If you want to retrieve a set of Notifications that satisfy complex criteria, you can use a Filter.
In this example, a Healthcare professional filters all their Notifications that were created after a certain date.

const startTimestamp = new Date(2022, 8, 27).getTime()

const afterDateFilter = await new NotificationFilter(api)
.forDataOwner(user.healthcarePartyId)
.afterDate(startTimestamp)
.build()
afterDateFilter
{
"healthcarePartyId": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"date": 1664229600000,
"$type": "MaintenanceTasksAfterDateFilter"
}
note

You can learn more about Filters in the Filters How-To

After creating the filter, is it possible to use it to retrieve the Notifications.

const notificationsFirstPage = await api.notificationApi.filterBy(afterDateFilter, undefined, 10)
notificationsFirstPage
{
"rows": [
{
"id": "0f4d17e0-000a-4293-8c01-a570098cf87f",
"rev": "1-c974724265430b245f93c739feed4e89",
"status": "pending",
"created": 1700058616254,
"identifiers": [],
"modified": 1700058616254,
"author": "*",
"responsible": "*",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "FQVyGnTJMOnnnEsz1UnaYs86BmuneifvT8e7i143/W70IPD8wHsCtReqpju6JK+i",
"tags": {}
}
},
{
"id": "1437f725-00ef-43aa-a82d-e7138d21af30",
"rev": "1-f9d714ebf39772895c324fe48731c697",
"status": "pending",
"created": 1700058616477,
"identifiers": [],
"modified": 1700058616477,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "mqAKgG/l8yCFp9zyI65k+6cp7HNpZKF0fBAedmGCWsaPmVDmdHuybQQdeO8rysM4",
"tags": {}
}
},
{
"id": "1b1a1323-e5c3-408e-b88e-47ba55b84c7d",
"rev": "2-96ad9536c315bffe2cb3f285376ab54c",
"status": "ongoing",
"created": 1700058616620,
"identifiers": [],
"modified": 1700058616620,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "bdsEKC7slguI6j8L6yKR+fHJI9okNSDjT2Gyf6A5sPp+io3mysb2c4RHl+3B87+f",
"tags": {}
}
},
{
"id": "36854fcc-463d-462d-85cc-ed16d3aa7f8b",
"rev": "1-2a162788959b03d053262590640dbff0",
"status": "pending",
"created": 1700058616399,
"identifiers": [],
"modified": 1700058616399,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "WPls2VA7JBrldN4lp8uUE/AZded4tLV4J8QZ8RZRZ1lDMnE0UUjQcqt0WERVNjjI",
"tags": {}
}
},
{
"id": "3c8397c1-99f1-4e01-bda9-182be7797f6c",
"rev": "1-9c70c95a146d1cbe0df3ddead7f61a0d",
"status": "pending",
"created": 1700058616368,
"identifiers": [],
"modified": 1700058616368,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "Eki9vHWNA+6hgEwqBSEx7syjAMekr0RyrMNwOgTWdevxw8zqqtd39XGKCSe76OmT",
"tags": {}
}
},
{
"id": "3f2f9895-1b6c-4256-89aa-c505417f72d0",
"rev": "2-a2b7eddf0eefa03707a830f6ff57b38d",
"status": "completed",
"created": 1700058648389,
"identifiers": [],
"modified": 1700058648389,
"author": "6ba80fc7-9fc4-4090-8678-3093dab9aad8",
"responsible": "a7cdd592-022d-496a-b2cf-3b8544aa899f",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "9cZOGYopggDOnE35aRVbdSz/ZEoq/3L5U+Oc1GCJz4T4lPv1vs1HxtfQ5zoVZWLO",
"tags": {}
}
},
{
"id": "45b1f8b2-49b1-4f44-a502-81ee9ecb58f9",
"rev": "1-23fd600d74bb44725a15897ecab1b2a8",
"status": "pending",
"created": 1700058616420,
"identifiers": [],
"modified": 1700058616420,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "m8uADFLoThZDSV3hJFp3hNbQLYpDg93AuFG9s9EUfHwWEE/jeQCyy+rraV06Mzy+",
"tags": {}
}
},
{
"id": "4d6c0f6e-9e17-41d3-9023-caa0718ae386",
"rev": "1-f4e46c25156dd9c3480876a35ee8834b",
"status": "pending",
"created": 1700058616339,
"identifiers": [],
"modified": 1700058616339,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "36lZD5XT5MHfZdyrzO/FUoR9Y4voOhzu+dbM5dp835+zh8FkgtYCh1cWKJjpRqv9",
"tags": {}
}
},
{
"id": "59fc8317-7b69-46b6-9c9b-b8545cfb25b9",
"rev": "1-167e34e95b17ee9bd13dd6e732a1d84e",
"status": "pending",
"created": 1700058616384,
"identifiers": [],
"modified": 1700058616384,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "x9kkscGo+dUVhknoYwpjwOmEfW3MtV5326+AEk9hJNFOL2tTIy8XqTV6ushL6ORm",
"tags": {}
}
},
{
"id": "5b5cb4e7-ea0d-4ce1-8ed6-9c1b1523dafb",
"rev": "1-05a84d91b9b4d0ad3dc4c773d4608e58",
"status": "pending",
"created": 1700058616285,
"identifiers": [],
"modified": 1700058616285,
"author": "*",
"responsible": "*",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "Ms80pzAxBlM6YKHEa07/UBjpfHCINfSsFO7ZG99CXzr4SeaP1P+i7O/axAgxRLtI",
"tags": {}
}
}
],
"nextKeyPair": {
"startKey": "5c091fb4-a375-4765-b4b5-27bc2750ed45",
"startKeyDocId": "5c091fb4-a375-4765-b4b5-27bc2750ed45"
}
}

The filter method returns a PaginatedList, which contains up to limit Notifications in the rows field, as specified by the method parameter (1000 by default). If the PaginatedList has a non-null field startKeyDocId there are more notifications which can be retrieved with this filter: you can use this value to retrieve (part of) the remaining notifications.

const notificationsSecondPage = await api.notificationApi.filterBy(
afterDateFilter,
notificationsFirstPage.nextKeyPair.startKeyDocId,
10,
)
notificationsSecondPage
{
"rows": [
{
"id": "5c091fb4-a375-4765-b4b5-27bc2750ed45",
"rev": "2-1623d59c505c850304df1ea75c5b2128",
"status": "ongoing",
"created": 1700058616589,
"identifiers": [],
"modified": 1700058616589,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "aQNDyu8V/SCou8VNk0lm0flwG8uGrE09JFrrsqSitXvHMKvpghQ/gGS86tXfB5rF",
"tags": {}
}
},
{
"id": "6f5a659a-9d0a-4eb6-8458-52128facd75f",
"rev": "1-b6c03e30839ca9506fd1f6d442b3289b",
"status": "pending",
"created": 1700058669742,
"identifiers": [],
"modified": 1700058669742,
"author": "*",
"responsible": "*",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "2JkArNw6iO/MzoagKU6OsnKaSwIgaAJPZOtsmKcBLn108KJcWIpNZmPZw4l8JXk1",
"tags": {}
}
},
{
"id": "78ed553b-5e42-492f-aa9d-ffef10fa9f27",
"rev": "1-0b4941bdedf275ec95d17ac4e7ee4ee3",
"status": "pending",
"created": 1700058616456,
"identifiers": [],
"modified": 1700058616456,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "KxVznl/7KnABMXlCoFqon5Cc0tZY5W5o13TnMgQLbDDbHdS5GxMgkRw4dsVYStdz",
"tags": {}
}
},
{
"id": "83002827-4fcf-43b3-9195-b25499692051",
"rev": "1-c650621291a9907739a4601e401cdefd",
"status": "pending",
"created": 1700058644792,
"identifiers": [],
"modified": 1700058644792,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "ILmhjU8arqEGaj7StsV3AQh2LYllE24U+iWkmwLc5MYHm5dq5EXCbmuBQGF0z1lqObqBP7Lh+3/BnwHC3960FCNRO00evXPPcmGKwDuLARAAm/0IOI7lWwxYeEuJdXEJWSWA8Dh4XHUf0fwXdZaEw6IHd74XL1AEr1Am51hQk6w8LNA3UO/GRVWo7X9APad3UImyypp63i2iGIINzUMOGhUSA/6GbLxKR5UXBIA5kLSg9ocvIRfbP19KOmD1VHDpOYVn25izsyz1Yt0f13pkX8Y8kdeEr8ulVxO5xVyMtEppNo0iHAgVjapkLG3UKpU5gSpkgZN0kU5KWpWX3Ba1QbcAICAcNpSFQujACxcSV3fddwaMKAyZ33PzRDRMMagavw9FhzB/rJFC42GtWKD+vLVndM3O5OF8hO4HKU+UCoabvQavndIZQxXFki+YU51BTvzGQ80dBKZS3l5mYJP3uzkAws35W1J2BlkcDc6Rq1vKFYVdGVQvclv1ZD6uaBX2rgSTGD80kdwhxXV1lXaDeLvi8lmqVwTt4di3cDBMRlJ6p2qPQaKyhoAHdDw/7QMxgQtRG+zWFiuPig+rvdz2I+UGMiNFdQ9J/55lj9ZTX/krIuJzIqXb8x+IHtR3nurLU/7h+9kY1c+kPyupX+HZDC8xbe2mHKAU10vNJ9n6zj7vlQCePqEFWOo4SgbFB+e2adxikiQniCOg60LH18O0w4NPhtDuZXnKI4BXyC95e0RLo2kLQiKG8fdazI4xKswGyttfXqL77klcUW16N/IqZXKUMFNEkjHro6IxV1J4V1F25CwoGuVhj3fTChz6nCgrutzjN7fcyRZhnWpqf1Aia4lWyu+bnoGIEI59+yF+tMybbh5ox/9qrG6tQ9F+Wxf6x/N459M32Hri30azcWV0hIy3vFulGYVGj0XLmqK3gBmn/Ho6BJTVrG4jbHhMaQ5JjW3AD/RODVuAHgiSIFTFTeb0xVoAMV4FtEJ6/AMtccdEPAbMSzstpyQoLDHdgeNszEaJOrJQRxgG8FVz68AAA0QI67uTgWfpZBES3bq6neLMhQTh6inheytFgH5cvmVJrxeYeOOAoXz7BWw0bFjfgZE8oCb59bWUpRmQiRdG3Kools4AxwsfHmQr+2TX0gd6xXSN6/L3SzYPnkynVrk+4g==",
"tags": {}
}
},
{
"id": "93695877-5aed-489f-8752-bb12701fa494",
"rev": "1-c6ed0e6b3a47ca2ec0b47b307a2efdfc",
"status": "pending",
"created": 1700058599261,
"identifiers": [],
"modified": 1700058599261,
"author": "*",
"responsible": "*",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "ujjYdFpdUBZ6o0LdGwLGRvXGKpBtfSsQ8S18pfBKYeFRfFljjeqlMnGmB0cxPKH8EuXaR48DgAXYm9B4eIR4mUAh0tyIa1ApORojqw2mIHhf1wIqSVYGkhNLFS4I5kd9z/ekQAtZvID6etagcECNf5UCu2cFa1pi0hrs10hgpgPrxzfQR9Z6v+ZlMQW7MmechtGKLZLLUhsl6kf8FA1Ctgkv5ob9X70xBZpGLKhRoBCbVYfA/uvt4rGgCClvMY6e/riLQydnyOVBg0AwQmu4FHvnvxbT9YnO1urskpUTXJwYQgWJBZ1x9VHA/E71hzeY//SRQoX0KXy8W3kRTa5IX9CsbNs89YpWo8+CZfYSgJljwWR32k6Egva7P9MpmtfoaCYav8LCYD5PvNMsonE6L0ZO2qESYXuc+I/6Mf8EMVBD6UV6E4wqN5Ku2B1cKOB6yMgorpfLB4dpDECAUtAXV7HEf1qUPSwtJMWqKkLDQIuUy1q5SQbSnX0rdPNwHbhZS9Y3M2krVxf6JR5nUkbyVQxL0k55LxfuTIZqB/Hg48/wVgZd7AcylXxrLJujLbDCsXPE23FNFuHFvtzK3cjxVUQp0FFctaCDKtWzov7+qt+88hKr8hmz64V46M68FwOVGNu+2LeoANLLuXub5vjUsCpUhSOryjmiwG28NG4Ec+BA/BBT7g9pV0nCau0nFyr6hjJycq/q83vLHSvjdmrZT8iUO/fcOfBD3EV4yPigx/ipjBwKy14ESAlQndSmKjAXJIMP6BjvNzJIBJ8wcMn1zSeoHkU77iNC6ndKwM2AlZZqzGhHWIIyO2SO+HYl6CaPDP97FVtTtveUmiCTIE3XCOfMqXDWin2x4vz1evIrsCNkT2zaiDfcCmgOAen9Aj0/Tc0MBIe2xTTIcJ2XJV3dbNb0bw4ynT9YFjRbyVt0PK4jWYiepSXLgenWrkVY7N1pp43FbE8FUincqxHWlFouyl76eU/zznQmvoNUDBQmTv9zur75PFYKpOXFevlxwBfB4pU/8jJ1fWI9cXcgY02jY94E058r9FGOGk0QsDPSZR27gQb+AjhLyalO2dBY/UpwkVCu4vesyGHuH1T1LnEAbAk8pOaHk524GOuxgpRVbPGfGOVmhucP9CFzrldhdtIUFFVHTQhqTWvbp+5j89LwLA==",
"tags": {}
}
},
{
"id": "9d536e51-fd7b-48df-996d-9a9bdac182b9",
"rev": "1-6adc8fdc2eb932941c81170a16fa0fa6",
"status": "pending",
"created": 1700058616439,
"identifiers": [],
"modified": 1700058616439,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "UUMGXdg2roMmScp41sVWU8hcG+jnyFFHFXcKJigExgG5FwsmZLJ3QrPeEp0dUVy5",
"tags": {}
}
},
{
"id": "ac89c39d-b027-4e61-8d5a-545f20f96e8a",
"rev": "1-74da0a8944ab3b41297537200fd6ee21",
"status": "pending",
"created": 1700058669705,
"identifiers": [],
"modified": 1700058669705,
"author": "*",
"responsible": "*",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "Wd1S2JpAImXeqGCqyynEWxJ1vHJF7CpCrqiEe6fuQwRKg6/lRllF8nN41ca53vid",
"tags": {}
}
},
{
"id": "bc571b70-de33-4c08-80b2-a0a3b37dcca9",
"rev": "1-500b636dc2fcdfb5834e37dba3d9a96b",
"status": "pending",
"created": 1700058646495,
"identifiers": [],
"modified": 1700058646495,
"author": "*",
"responsible": "*",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "7Irk+el2VduwZitqGNnXjOp0dFL872TgjIg/scyTQB+hbz/MYhm9eMvosvV1r/SiGGRuRUMEioU7eT40mdOelIlHJnJa5DRiULwI87N232Vqq15JCQ3/8AydGY6sO2l55tohTNSInrEnHBru1DiRNXUutS1KiJRjFYH7IivJkDqwLq5HVAP1H0l1dt/jKjZd90dQSdSrFmVOwlcdOc+8Uky8mqhVEtna3640H2fEnbWWfOLCOepsqCBEhx4ieF0yunrGyEdsWnpCJMYlNEeLjhm4p5TaU8OqJ+hOU2FR+xxwyzQ/vMijop783AdGIoDFiI+TdcUVCNStsxSo4RD9e/s/uA1AWMky8sD4WSXdH25mI36Xu42b9/SGg5XWTWJuocFJDVpCsqSLJpl6w2UOueEMTadtCq+slI0DPk2TwoyYEzz7Cul/ftmrgWizDVz14QHeBBHWfiQI3ilqgQhuy/QYIIK91ziEDYKceKT7yCV8LCYqzxnFT4qepOcSkxN+fgvWJ/AOAV9wy9GUaUlHiGf3K9vS6SOizKolBFfuo5TBCjSxJskuZHa2sGG5UxhR8yDPt5SEHgDbOzpatPOcZ6x0Rn+1VYz42ltLnnteOpZpn/TvivgZVap5WSSPVcLqLB42YcuK+mydzFgYiqfx3EyoHaY356FP0XDqApK6oue70wzQpc1j+DerZn/oA72zY54cT6PUvdPTWQesI5/a1fnvIv3+GkLhixpa4XYqNC2G/9TkZsbx9predZk04RqzB2grAf20Ou62keOPpgyCrXVdQOjY3Fxet5pmeHmNN+6rP0d/T9rP1N1SEv9FDMGb7tengaXY4QV/MCY2AdrOasMuijDd2Kz4cTWjwIncIra+f6qUHlQuafO8295mgpwoaxGrkbguinFD1uELyjOP7aMpK8r7nNQGTJFzju5ziE40LCDq+g9WRIJfoBKbODitWGdFvDfnRN4R+iFqkYRRPeKEvhiMARw3JvJt+jJdIS0leowegGK9vQvU69zw+TgEGcWcx190f/Vk0YW9wq2aEPfeXqljM1BFwMSDW89JCo+4SYxmCHS/iFh6K7HinZ6OdfUtos8RTzZzwFXFxma/uIUCt1vNn7QCa3XZ5Lf+MeJLe6pXZl5vjOSH1NspcbfU256FnoUpoOYbRFR2X2xPSA==",
"tags": {}
}
},
{
"id": "c9583cab-4549-4889-9630-feaa11132c81",
"rev": "3-5f001767dee5a6d57d8c1a5090ecccbf",
"status": "completed",
"created": 1700058623099,
"identifiers": [],
"modified": 1700058623099,
"author": "2163c1e4-8255-487c-9c6d-20c5944efe1d",
"responsible": "97011d2d-4e31-4b0c-b659-179354669f7e",
"properties": {},
"type": "NEW_USER_OWN_DATA_ACCESS",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "r3MmYQOwgDf5bxBWdxrtuiDxgMTWNF1m4jgolXk4/5tLc26dfolcofL6Njm18Kc9",
"tags": {}
}
},
{
"id": "cfdac5e9-7b82-4a02-a065-91534823988a",
"rev": "3-15685682584d372fc6d7219108ab1cab",
"status": "completed",
"created": 1700058655076,
"identifiers": [],
"modified": 1700058655076,
"author": "e065123c-0ce8-4003-a15c-4b5b133cc2a7",
"responsible": "f82ae3f1-3478-49b8-83ed-038d8a9c6721",
"properties": {},
"type": "NEW_USER_OWN_DATA_ACCESS",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "Yn9SO7fUMEM8iNDxD1aFihYDcIoMyqWYGE7bHPSzxewULxN0rMcR6C1LvBkHy/IK",
"tags": {}
}
}
],
"nextKeyPair": {
"startKey": "d38d71c3-1a8b-4821-8d95-6b813e5476ec",
"startKeyDocId": "d38d71c3-1a8b-4821-8d95-6b813e5476ec"
}
}

Retrieving all the Pending Notifications​

A Healthcare professional can also retrieve all the Notifications assigned to him that have a pending status.

const pendingNotifications = await api.notificationApi.getPendingAfter()
pendingNotifications
[
{
"id": "0f4d17e0-000a-4293-8c01-a570098cf87f",
"rev": "1-c974724265430b245f93c739feed4e89",
"status": "pending",
"created": 1700058616254,
"identifiers": [],
"modified": 1700058616254,
"author": "*",
"responsible": "*",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "FQVyGnTJMOnnnEsz1UnaYs86BmuneifvT8e7i143/W70IPD8wHsCtReqpju6JK+i",
"tags": {}
}
},
{
"id": "1437f725-00ef-43aa-a82d-e7138d21af30",
"rev": "1-f9d714ebf39772895c324fe48731c697",
"status": "pending",
"created": 1700058616477,
"identifiers": [],
"modified": 1700058616477,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "mqAKgG/l8yCFp9zyI65k+6cp7HNpZKF0fBAedmGCWsaPmVDmdHuybQQdeO8rysM4",
"tags": {}
}
},
{
"id": "36854fcc-463d-462d-85cc-ed16d3aa7f8b",
"rev": "1-2a162788959b03d053262590640dbff0",
"status": "pending",
"created": 1700058616399,
"identifiers": [],
"modified": 1700058616399,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "WPls2VA7JBrldN4lp8uUE/AZded4tLV4J8QZ8RZRZ1lDMnE0UUjQcqt0WERVNjjI",
"tags": {}
}
},
{
"id": "3c8397c1-99f1-4e01-bda9-182be7797f6c",
"rev": "1-9c70c95a146d1cbe0df3ddead7f61a0d",
"status": "pending",
"created": 1700058616368,
"identifiers": [],
"modified": 1700058616368,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "Eki9vHWNA+6hgEwqBSEx7syjAMekr0RyrMNwOgTWdevxw8zqqtd39XGKCSe76OmT",
"tags": {}
}
},
{
"id": "45b1f8b2-49b1-4f44-a502-81ee9ecb58f9",
"rev": "1-23fd600d74bb44725a15897ecab1b2a8",
"status": "pending",
"created": 1700058616420,
"identifiers": [],
"modified": 1700058616420,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "m8uADFLoThZDSV3hJFp3hNbQLYpDg93AuFG9s9EUfHwWEE/jeQCyy+rraV06Mzy+",
"tags": {}
}
},
{
"id": "4d6c0f6e-9e17-41d3-9023-caa0718ae386",
"rev": "1-f4e46c25156dd9c3480876a35ee8834b",
"status": "pending",
"created": 1700058616339,
"identifiers": [],
"modified": 1700058616339,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "36lZD5XT5MHfZdyrzO/FUoR9Y4voOhzu+dbM5dp835+zh8FkgtYCh1cWKJjpRqv9",
"tags": {}
}
},
{
"id": "59fc8317-7b69-46b6-9c9b-b8545cfb25b9",
"rev": "1-167e34e95b17ee9bd13dd6e732a1d84e",
"status": "pending",
"created": 1700058616384,
"identifiers": [],
"modified": 1700058616384,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "x9kkscGo+dUVhknoYwpjwOmEfW3MtV5326+AEk9hJNFOL2tTIy8XqTV6ushL6ORm",
"tags": {}
}
},
{
"id": "5b5cb4e7-ea0d-4ce1-8ed6-9c1b1523dafb",
"rev": "1-05a84d91b9b4d0ad3dc4c773d4608e58",
"status": "pending",
"created": 1700058616285,
"identifiers": [],
"modified": 1700058616285,
"author": "*",
"responsible": "*",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "Ms80pzAxBlM6YKHEa07/UBjpfHCINfSsFO7ZG99CXzr4SeaP1P+i7O/axAgxRLtI",
"tags": {}
}
},
{
"id": "6f5a659a-9d0a-4eb6-8458-52128facd75f",
"rev": "1-b6c03e30839ca9506fd1f6d442b3289b",
"status": "pending",
"created": 1700058669742,
"identifiers": [],
"modified": 1700058669742,
"author": "*",
"responsible": "*",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "2JkArNw6iO/MzoagKU6OsnKaSwIgaAJPZOtsmKcBLn108KJcWIpNZmPZw4l8JXk1",
"tags": {}
}
},
{
"id": "78ed553b-5e42-492f-aa9d-ffef10fa9f27",
"rev": "1-0b4941bdedf275ec95d17ac4e7ee4ee3",
"status": "pending",
"created": 1700058616456,
"identifiers": [],
"modified": 1700058616456,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "KxVznl/7KnABMXlCoFqon5Cc0tZY5W5o13TnMgQLbDDbHdS5GxMgkRw4dsVYStdz",
"tags": {}
}
},
{
"id": "83002827-4fcf-43b3-9195-b25499692051",
"rev": "1-c650621291a9907739a4601e401cdefd",
"status": "pending",
"created": 1700058644792,
"identifiers": [],
"modified": 1700058644792,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "ILmhjU8arqEGaj7StsV3AQh2LYllE24U+iWkmwLc5MYHm5dq5EXCbmuBQGF0z1lqObqBP7Lh+3/BnwHC3960FCNRO00evXPPcmGKwDuLARAAm/0IOI7lWwxYeEuJdXEJWSWA8Dh4XHUf0fwXdZaEw6IHd74XL1AEr1Am51hQk6w8LNA3UO/GRVWo7X9APad3UImyypp63i2iGIINzUMOGhUSA/6GbLxKR5UXBIA5kLSg9ocvIRfbP19KOmD1VHDpOYVn25izsyz1Yt0f13pkX8Y8kdeEr8ulVxO5xVyMtEppNo0iHAgVjapkLG3UKpU5gSpkgZN0kU5KWpWX3Ba1QbcAICAcNpSFQujACxcSV3fddwaMKAyZ33PzRDRMMagavw9FhzB/rJFC42GtWKD+vLVndM3O5OF8hO4HKU+UCoabvQavndIZQxXFki+YU51BTvzGQ80dBKZS3l5mYJP3uzkAws35W1J2BlkcDc6Rq1vKFYVdGVQvclv1ZD6uaBX2rgSTGD80kdwhxXV1lXaDeLvi8lmqVwTt4di3cDBMRlJ6p2qPQaKyhoAHdDw/7QMxgQtRG+zWFiuPig+rvdz2I+UGMiNFdQ9J/55lj9ZTX/krIuJzIqXb8x+IHtR3nurLU/7h+9kY1c+kPyupX+HZDC8xbe2mHKAU10vNJ9n6zj7vlQCePqEFWOo4SgbFB+e2adxikiQniCOg60LH18O0w4NPhtDuZXnKI4BXyC95e0RLo2kLQiKG8fdazI4xKswGyttfXqL77klcUW16N/IqZXKUMFNEkjHro6IxV1J4V1F25CwoGuVhj3fTChz6nCgrutzjN7fcyRZhnWpqf1Aia4lWyu+bnoGIEI59+yF+tMybbh5ox/9qrG6tQ9F+Wxf6x/N459M32Hri30azcWV0hIy3vFulGYVGj0XLmqK3gBmn/Ho6BJTVrG4jbHhMaQ5JjW3AD/RODVuAHgiSIFTFTeb0xVoAMV4FtEJ6/AMtccdEPAbMSzstpyQoLDHdgeNszEaJOrJQRxgG8FVz68AAA0QI67uTgWfpZBES3bq6neLMhQTh6inheytFgH5cvmVJrxeYeOOAoXz7BWw0bFjfgZE8oCb59bWUpRmQiRdG3Kools4AxwsfHmQr+2TX0gd6xXSN6/L3SzYPnkynVrk+4g==",
"tags": {}
}
},
{
"id": "93695877-5aed-489f-8752-bb12701fa494",
"rev": "1-c6ed0e6b3a47ca2ec0b47b307a2efdfc",
"status": "pending",
"created": 1700058599261,
"identifiers": [],
"modified": 1700058599261,
"author": "*",
"responsible": "*",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "ujjYdFpdUBZ6o0LdGwLGRvXGKpBtfSsQ8S18pfBKYeFRfFljjeqlMnGmB0cxPKH8EuXaR48DgAXYm9B4eIR4mUAh0tyIa1ApORojqw2mIHhf1wIqSVYGkhNLFS4I5kd9z/ekQAtZvID6etagcECNf5UCu2cFa1pi0hrs10hgpgPrxzfQR9Z6v+ZlMQW7MmechtGKLZLLUhsl6kf8FA1Ctgkv5ob9X70xBZpGLKhRoBCbVYfA/uvt4rGgCClvMY6e/riLQydnyOVBg0AwQmu4FHvnvxbT9YnO1urskpUTXJwYQgWJBZ1x9VHA/E71hzeY//SRQoX0KXy8W3kRTa5IX9CsbNs89YpWo8+CZfYSgJljwWR32k6Egva7P9MpmtfoaCYav8LCYD5PvNMsonE6L0ZO2qESYXuc+I/6Mf8EMVBD6UV6E4wqN5Ku2B1cKOB6yMgorpfLB4dpDECAUtAXV7HEf1qUPSwtJMWqKkLDQIuUy1q5SQbSnX0rdPNwHbhZS9Y3M2krVxf6JR5nUkbyVQxL0k55LxfuTIZqB/Hg48/wVgZd7AcylXxrLJujLbDCsXPE23FNFuHFvtzK3cjxVUQp0FFctaCDKtWzov7+qt+88hKr8hmz64V46M68FwOVGNu+2LeoANLLuXub5vjUsCpUhSOryjmiwG28NG4Ec+BA/BBT7g9pV0nCau0nFyr6hjJycq/q83vLHSvjdmrZT8iUO/fcOfBD3EV4yPigx/ipjBwKy14ESAlQndSmKjAXJIMP6BjvNzJIBJ8wcMn1zSeoHkU77iNC6ndKwM2AlZZqzGhHWIIyO2SO+HYl6CaPDP97FVtTtveUmiCTIE3XCOfMqXDWin2x4vz1evIrsCNkT2zaiDfcCmgOAen9Aj0/Tc0MBIe2xTTIcJ2XJV3dbNb0bw4ynT9YFjRbyVt0PK4jWYiepSXLgenWrkVY7N1pp43FbE8FUincqxHWlFouyl76eU/zznQmvoNUDBQmTv9zur75PFYKpOXFevlxwBfB4pU/8jJ1fWI9cXcgY02jY94E058r9FGOGk0QsDPSZR27gQb+AjhLyalO2dBY/UpwkVCu4vesyGHuH1T1LnEAbAk8pOaHk524GOuxgpRVbPGfGOVmhucP9CFzrldhdtIUFFVHTQhqTWvbp+5j89LwLA==",
"tags": {}
}
},
{
"id": "9d536e51-fd7b-48df-996d-9a9bdac182b9",
"rev": "1-6adc8fdc2eb932941c81170a16fa0fa6",
"status": "pending",
"created": 1700058616439,
"identifiers": [],
"modified": 1700058616439,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "UUMGXdg2roMmScp41sVWU8hcG+jnyFFHFXcKJigExgG5FwsmZLJ3QrPeEp0dUVy5",
"tags": {}
}
},
{
"id": "ac89c39d-b027-4e61-8d5a-545f20f96e8a",
"rev": "1-74da0a8944ab3b41297537200fd6ee21",
"status": "pending",
"created": 1700058669705,
"identifiers": [],
"modified": 1700058669705,
"author": "*",
"responsible": "*",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "Wd1S2JpAImXeqGCqyynEWxJ1vHJF7CpCrqiEe6fuQwRKg6/lRllF8nN41ca53vid",
"tags": {}
}
},
{
"id": "bc571b70-de33-4c08-80b2-a0a3b37dcca9",
"rev": "1-500b636dc2fcdfb5834e37dba3d9a96b",
"status": "pending",
"created": 1700058646495,
"identifiers": [],
"modified": 1700058646495,
"author": "*",
"responsible": "*",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "7Irk+el2VduwZitqGNnXjOp0dFL872TgjIg/scyTQB+hbz/MYhm9eMvosvV1r/SiGGRuRUMEioU7eT40mdOelIlHJnJa5DRiULwI87N232Vqq15JCQ3/8AydGY6sO2l55tohTNSInrEnHBru1DiRNXUutS1KiJRjFYH7IivJkDqwLq5HVAP1H0l1dt/jKjZd90dQSdSrFmVOwlcdOc+8Uky8mqhVEtna3640H2fEnbWWfOLCOepsqCBEhx4ieF0yunrGyEdsWnpCJMYlNEeLjhm4p5TaU8OqJ+hOU2FR+xxwyzQ/vMijop783AdGIoDFiI+TdcUVCNStsxSo4RD9e/s/uA1AWMky8sD4WSXdH25mI36Xu42b9/SGg5XWTWJuocFJDVpCsqSLJpl6w2UOueEMTadtCq+slI0DPk2TwoyYEzz7Cul/ftmrgWizDVz14QHeBBHWfiQI3ilqgQhuy/QYIIK91ziEDYKceKT7yCV8LCYqzxnFT4qepOcSkxN+fgvWJ/AOAV9wy9GUaUlHiGf3K9vS6SOizKolBFfuo5TBCjSxJskuZHa2sGG5UxhR8yDPt5SEHgDbOzpatPOcZ6x0Rn+1VYz42ltLnnteOpZpn/TvivgZVap5WSSPVcLqLB42YcuK+mydzFgYiqfx3EyoHaY356FP0XDqApK6oue70wzQpc1j+DerZn/oA72zY54cT6PUvdPTWQesI5/a1fnvIv3+GkLhixpa4XYqNC2G/9TkZsbx9predZk04RqzB2grAf20Ou62keOPpgyCrXVdQOjY3Fxet5pmeHmNN+6rP0d/T9rP1N1SEv9FDMGb7tengaXY4QV/MCY2AdrOasMuijDd2Kz4cTWjwIncIra+f6qUHlQuafO8295mgpwoaxGrkbguinFD1uELyjOP7aMpK8r7nNQGTJFzju5ziE40LCDq+g9WRIJfoBKbODitWGdFvDfnRN4R+iFqkYRRPeKEvhiMARw3JvJt+jJdIS0leowegGK9vQvU69zw+TgEGcWcx190f/Vk0YW9wq2aEPfeXqljM1BFwMSDW89JCo+4SYxmCHS/iFh6K7HinZ6OdfUtos8RTzZzwFXFxma/uIUCt1vNn7QCa3XZ5Lf+MeJLe6pXZl5vjOSH1NspcbfU256FnoUpoOYbRFR2X2xPSA==",
"tags": {}
}
},
{
"id": "dcca5e35-bb2a-4045-aa5e-abb5e1c99c11",
"rev": "1-d6b4120a7949fad0e388fd5f18524f53",
"status": "pending",
"created": 1700058616308,
"identifiers": [],
"modified": 1700058616308,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "3qnJT6LA7YSzZ9VB/TWxaIJa6NKNbDOkIiH4zhr4Nz65qp65td9Jh8Ixu8nCcsQG",
"tags": {}
}
},
{
"id": "f33d5d53-da65-418e-9c2f-f71c40d8b58d",
"rev": "1-758b5be031cf497ff489af4302a4e1f3",
"status": "pending",
"created": 1700058616356,
"identifiers": [],
"modified": 1700058616356,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "OTHER",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "YL5LMosYA4tEmG1OOzXMQ6wNvacXD2jUIqkCg2ECvfZQcc+6bRC7rRHZiSNbUh+C",
"tags": {}
}
}
]

Modifying a Notification​

A Data Owner can modify a Notification.

const newNotification = await api.notificationApi.createOrModify(
new Notification({
type: NotificationTypeEnum.KeyPairUpdate,
}),
hcp.id,
)

const notificationToModify = new Notification({ ...newNotification, status: StatusEnum.Ongoing })

const modifiedNotification = await api.notificationApi.createOrModify(notificationToModify, hcp.id)
modifiedNotification
{
"id": "a1c0b1a8-7c65-47a8-80cf-70b10e793004",
"rev": "2-467bc5457f3d1f14b93f7be4e7f8950e",
"status": "ongoing",
"created": 1700058669910,
"identifiers": [],
"modified": 1700058669910,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "lH26s5D5VRaKm8sY0mPKbKHWXl/DSwCGBk0MYUpt83P1oanLuUkVje3/hVF/pQkn",
"tags": {}
}
}
caution

Only the status, identifiers, and property fields can be modified.

Updating the Status of a Notification​

The NotificationApi also provides a shortcut method to update the status of a Notification.

const notificationToUpdate = await api.notificationApi.createOrModify(
new Notification({
type: NotificationTypeEnum.KeyPairUpdate,
status: StatusEnum.Pending,
}),
hcp.id,
)

const updatedNotification = await api.notificationApi.updateStatus(
notificationToUpdate,
StatusEnum.Ongoing,
)
updatedNotification
{
"id": "b4db7d95-be18-4db3-a125-63741e81d72b",
"rev": "2-c11e3d373e264d50e32b45e355057340",
"status": "ongoing",
"created": 1700058669940,
"identifiers": [],
"modified": 1700058669940,
"author": "17e392da-8e36-4e4e-abd7-7eef3e434395",
"responsible": "3ed06450-17e5-47b6-ba4f-7a0a084df56b",
"properties": {},
"type": "KEY_PAIR_UPDATE",
"systemMetaData": {
"secretForeignKeys": [],
"cryptedForeignKeys": {},
"delegations": {},
"encryptionKeys": {},
"securityMetadata": {
"secureDelegations": {},
"keysEquivalences": {}
},
"encryptedSelf": "uu6v02tWXiajMVFSqTNjWMrYnO30OCejGeC+iBs8DV9C9ijD3GXJ5PmQ9Ouxvepq",
"tags": {}
}
}

Deleting a Notification​

Finally, a Data Owner that has access to a Notification can decide to delete it.

const notificationToDelete = await api.notificationApi.createOrModify(
new Notification({
type: NotificationTypeEnum.KeyPairUpdate,
}),
hcp.id,
)

const deletedNotificationId = await api.notificationApi.delete(notificationToDelete.id)
deletedNotificationId
e66921b6-159a-4462-8792-01b7814471d2