Service Notifications Api
!version
!nextVersion
!downloads
!license
!dependency
*
Full documentation
install: npm i @plasma-platform/service-notifications -S
- NotificationsService
- messages
- getResourceToken
- Parameters
- Examples
- getUserToken
- Parameters
- Examples
- addNewNotification
- Parameters
- Examples
- deleteNotificationByProperty
- Parameters
- Examples
- deleteNotification
- Parameters
- Examples
- eventsListenerEndpoint
- Parameters
- Examples
- getAllowedMethodsForNotification
- Examples
- getListOfNotifications
- Parameters
- Examples
- getPaginationHeaders
- Examples
- modifyNotification
- Parameters
- Examples
- viewSingleNotification
- Parameters
- Examples
- See:
object with class service messages
Type: object
Subscription - Get system centrifugo token based on resource id
#### Parameters
- params Object
- params.resourceId string Resource ID (orderId for example) (required)
- params.timestamp number UNIX Timestamp (required)
- params.prefix string prefix for centrifuge
#### Examples
Get membership plan info by ID
``javascript`
(async () => {
const service = new NotificationsService(url);
const response = await service.getResourceToken(params);
})();
Returns Promise<Object> Promise object represents info
Subscription - Get user token
#### Parameters
- timestamp number UNIX Timestamp (required)
#### Examples
Get membership plan info by ID
`javascript`
(async () => {
const service = new NotificationsService(url, token);
const response = await service.getUserToken(timestamp);
})();
Returns Promise<Object> Promise object represents info
Notification - Add new notification
#### Parameters
- params Object params.user_id
- string ID of the user for whom notification have been created (required)params.content
- string Notification html code (required)params.subject
- string Notification subject (required)params.params
- string JSON object with parameters of notification (type, etc.) (required)
#### Examples
`javascript`
(async () => {
const service = new NotificationsService(url, token);
const response = await service.addNewNotification(params);
})();
Returns Promise<Object> Promise object
Notification - Delete notification by property
#### Parameters
- params Object params.propertyName
- string Notification param property name (required)params.propertyValue
- string Notification param property value (required)
#### Examples
`javascript`
(async () => {
const service = new NotificationsService(url, token);
const response = await service.deleteNotificationByProperty(params);
})();
Returns Promise<Object> Promise object
Notification - Delete notification
#### Parameters
- id string Notification unique ID (required)
#### Examples
`javascript`
(async () => {
const service = new NotificationsService(url, token);
const response = await service.deleteNotification(params);
})();
Returns Promise<Object> Promise object
Notification - Events listener endpoint
#### Parameters
- params Object params.user_id
- string ID of the user for whom notification have been created (required)params.event
- string Event name (required)
#### Examples
`javascript`
(async () => {
const service = new NotificationsService(url, token);
const response = await service.eventsListenerEndpoint(params);
})();
Returns Promise<Object> Promise object
Notification - Get Allowed methods for Notification API
#### Examples
`javascript`
(async () => {
const service = new NotificationsService(url);
const response = await service.getAllowedMethodsForNotification();
})();
Returns Promise<Object> Promise object
Notification - Get list of notifications
#### Parameters
- params Object params.perPage
- string Number of notifications per one page (optional)params.page
- string Page number (optional)params.is_viewed
- string 0: find not viewed notifications, 1: find viewed notifications. Allowed values: 0, 1 (optional)
#### Examples
`javascript`
(async () => {
const service = new NotificationsService(url, token);
const response = await service.getListOfNotifications(params);
})();
Returns Promise<Object> Promise object
Notification - Get pagination headers
#### Examples
`javascript`
(async () => {
const service = new NotificationsService(url, token);
const response = await service.getPaginationHeaders(params);
})();
Returns Promise<Object> Promise object
Notification - Modify notification
#### Parameters
- params Object params.id
- string Notification unique ID (required)params.viewed_at
- string Time when notification was viewed (required)
#### Examples
`javascript`
(async () => {
const service = new NotificationsService(url, token);
const response = await service.modifyNotification(params);
})();
Returns Promise<Object> Promise object
Notification - View single notification
#### Parameters
- id string Notification unique ID (required)
#### Examples
`javascript``
(async () => {
const service = new NotificationsService(url, token);
const response = await service.viewSingleNotification(id);
})();