curl --request POST \
--url https://api.velt.dev/v2/notifications/add \
--header 'Content-Type: application/json' \
--header 'x-velt-api-key: <x-velt-api-key>' \
--header 'x-velt-auth-token: <x-velt-auth-token>' \
--data '
{
"data": {
"organizationId": "<string>",
"createOrganization": true,
"documentId": "<string>",
"createDocument": true,
"actionUser": {},
"verifyUserPermissions": true,
"notificationId": "<string>",
"displayHeadlineMessageTemplate": "<string>",
"displayHeadlineMessageTemplateData": {
"actionUser": {},
"recipientUser": "<string>",
"yourCustomField": "<string>"
},
"displayBodyMessage": "<string>",
"notifyUsers": [
{}
],
"notifyAll": true,
"notificationSourceData": {},
"context": {
"access": {}
}
}
}
'{
"result": {
"status": "success",
"message": "Notification added successfully.",
"data": {
"success": true,
"message": "Notification added successfully."
}
}
}
curl --request POST \
--url https://api.velt.dev/v2/notifications/add \
--header 'Content-Type: application/json' \
--header 'x-velt-api-key: <x-velt-api-key>' \
--header 'x-velt-auth-token: <x-velt-auth-token>' \
--data '
{
"data": {
"organizationId": "<string>",
"createOrganization": true,
"documentId": "<string>",
"createDocument": true,
"actionUser": {},
"verifyUserPermissions": true,
"notificationId": "<string>",
"displayHeadlineMessageTemplate": "<string>",
"displayHeadlineMessageTemplateData": {
"actionUser": {},
"recipientUser": "<string>",
"yourCustomField": "<string>"
},
"displayBodyMessage": "<string>",
"notifyUsers": [
{}
],
"notifyAll": true,
"notificationSourceData": {},
"context": {
"access": {}
}
}
}
'{
"result": {
"status": "success",
"message": "Notification added successfully.",
"data": {
"success": true,
"message": "Notification added successfully."
}
}
}
POST https://api.velt.dev/v2/notifications/add
Show properties
false_, - are allowed.notifyUsers array.Show properties
Show example
{
"entityId": "numberOfVisitors",
"dashboardId": "myDashboard"
}
{
"data": {
"organizationId": "yourOrganizationId",
"documentId": "yourDocumentId",
"actionUser": {
"userId": "yourUserId",
"name": "User Name",
"email": "[email protected]"
},
"displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}, {yourCustomVariableWithStringValue}",
"displayHeadlineMessageTemplateData": {
"actionUser": {
"userId": "yourUserId",
"name": "User Name",
"email": "[email protected]"
},
"recipientUser": {
"userId": "recipientUserId",
"name": "Recipient Name",
"email": "[email protected]"
},
"yourCustomField": "Variable will be replaced with this text"
},
"displayBodyMessage": "This is body message (Secondary message)",
"notifyUsers": [
{
"email": "[email protected]",
"userId": "testingUserId"
},
{
"userId": "yourUserId",
"name": "User Name",
"email": "[email protected]"
}
]
}
}
{
"data": {
"organizationId": "org1",
"documentId": "document3",
"actionUser": {
"userId": "1.1"
},
"verifyUserPermissions": true,
"displayHeadlineMessageTemplate": "This is main template, you can pass variables using curly brackets like this: {actionUser}, {recipientUser}",
"displayHeadlineMessageTemplateData": {
"actionUser": {
"userId": "1.1"
},
"recipientUser": {
"userId": "2.2"
}
},
"displayBodyMessage": "This is body message (Secondary message)",
"notifyUsers": [
{
"userId": "2.2"
}
],
"notifyAll": false
}
}
verifyUserPermissions is enabled, the API checks document access for each user before creating notifications. Only users with access to the document will receive notifications.{
"data": {
"organizationId": "org1",
"documentId": "document3",
"actionUser": {
"userId": "1.1",
"name": "User One",
"email": "[email protected]"
},
"context": {
"access": {
"entityId": "numberOfVisitors",
"dashboardId": "myDashboard"
}
},
"displayHeadlineMessageTemplate": "New comment on {entityName}",
"displayHeadlineMessageTemplateData": {
"entityName": "Visitor Analytics"
},
"displayBodyMessage": "A new comment has been added to the visitor analytics dashboard",
"notifyUsers": [
{
"userId": "2.2"
}
],
"notifyAll": false
}
}
{
"result": {
"status": "success",
"message": "Notification added successfully.",
"data": {
"success": true,
"message": "Notification added successfully."
}
}
}
{
"error": {
"message": "ERROR_MESSAGE",
"status": "INVALID_ARGUMENT"
}
}
{
"result": {
"status": "success",
"message": "Notification added successfully.",
"data": {
"success": true,
"message": "Notification added successfully."
}
}
}
Was this page helpful?