Repository navigation
services notificationsService
Baasic Notifications Service provides an easy way to consume Baasic Notifications REST API end-points. In order to obtain needed routes baasicNotificationsService uses baasicNotificationsRouteService.
Returns a promise that is resolved once the create notification action has been performed; this action creates a new notification resource.
Example:
baasicNotificationsService.publish.create({
channels: ['<channel-name', '<channel-name>'],
moduleName: '<module-name>',
templateName: '<template-name>',
templateContext: {
prop1: '<prop1-value>',
prop2: '<prop2-value>'
}
})
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the create notification action has been performed; this action creates new notification resources.
Example:
baasicNotificationsService.publish.create([{
channels: ['<channel-name', '<channel-name>'],
moduleName: '<module-name>',
templateName: '<template-name>',
templateContext: {
prop1: '<prop1-value>',
prop2: '<prop2-value>'
}
}])
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the create user subscription action has been performed; this action creates a new user subscription resource.
Example:
baasicNotificationsService.subscriptions.users.create({
channel: '<channel-name>',
userId: '<user-id>'
})
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the find action has been performed. Success response returns a list of user subscription resources matching the given criteria.
Example:
baasicNotificationsService.subscriptions.users.find({
pageNumber : 1,
pageSize : 10,
orderBy : '<field>',
orderDirection : '<asc|desc>',
search : '<search-phrase>',
channels: '<channel-name1>,<channel-name2>',
userIds: '<user-id1>,<user-id2>',
embed: '<embed>'
})
.success(function (collection) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
}); Returns a promise that is resolved once the get action has been performed. Success response returns the specified user subscription resource.
Example:
baasicNotificationsService.subscriptions.users.get('<subscription-id>')
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the remove user subscription action has been performed. This action will remove a user subscription resource from the system if successfully completed. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply baasicNotificationsRouteService route template. Here is an example of how a route can be obtained from HAL enabled objects:
var params = baasicApiService.removeParams(subscription);
var uri = params['model'].links('delete').href;
Example:
// subscription is a resource previously fetched using get action.
baasicNotificationsService.subscriptions.users.remove(subscription)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
}); Returns a promise that is resolved once the update user subscription action has been performed; this action updates a user subscription resource. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply baasicNotificationsRouteService route template. Here is an example of how a route can be obtained from HAL enabled objects:
var params = baasicApiService.updateParams(subscription);
var uri = params['model'].links('put').href;
Example:
// subscription is a resource previously fetched using get action.
subscription.channel = '<channel-name>';
baasicNotificationsService.subscriptions.users.update(subscription)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the create user subscription action has been performed; this action creates new user subscription resources.
Example:
baasicNotificationsService.subscriptions.users.batch.create([{
channel: '<channel-name>',
userId: '<user-id>'
}])
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the remove action has been performed. This action will remove user subscription resources from the system if successfully completed.
Example:
baasicNotificationsService.subscriptions.users.batch.remove(subscriptionIds)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
}); Returns a promise that is resolved once the update user subscriptions action has been performed; this action updates specified user subscription resources.
Example:
baasicNotificationsService.subscriptions.users.batch.update(subscriptions)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the create anonymous subscription action has been performed; this action creates a new anonymous subscription resource.
Example:
baasicNotificationsService.subscriptions.anonymous.create({
channel: '<channel-name>',
registrationId: '<registration-id>'
})
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the find action has been performed. Success response returns a list of anonymous subscription resources matching the given criteria.
Example:
baasicNotificationsService.subscriptions.anonymous.find({
pageNumber : 1,
pageSize : 10,
orderBy : '<field>',
orderDirection : '<asc|desc>',
search : '<search-phrase>',
channels: '<channel-name1>,<channel-name2>',
registrationIds: '<registration-id1>,<registration-id2>',
embed: '<embed>'
})
.success(function (collection) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
}); Returns a promise that is resolved once the get action has been performed. Success response returns the specified anonymous subscription resource.
Example:
baasicNotificationsService.subscriptions.anonymous.get('<subscription-id>')
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the remove anonymous subscription action has been performed. This action will remove a anonymous subscription resource from the system if successfully completed. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply baasicNotificationsRouteService route template. Here is an example of how a route can be obtained from HAL enabled objects:
var params = baasicApiService.removeParams(subscription);
var uri = params['model'].links('delete').href;
Example:
// subscription is a resource previously fetched using get action.
baasicNotificationsService.subscriptions.anonymous.remove(subscription)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
}); Returns a promise that is resolved once the update anonymous subscription action has been performed; this action updates a anonymous subscription resource. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply baasicNotificationsRouteService route template. Here is an example of how a route can be obtained from HAL enabled objects:
var params = baasicApiService.updateParams(subscription);
var uri = params['model'].links('put').href;
Example:
// subscription is a resource previously fetched using get action.
subscription.channel = '<channel-name>';
baasicNotificationsService.update(subscription)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the create anonymous subscription action has been performed; this action creates new anonymous subscription resources.
Example:
baasicNotificationsService.subscriptions.anonymous.batch.create([{
channel: '<channel-name>',
registrationId: '<registration-id>'
}])
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the remove action has been performed. This action will remove anonymous subscription resources from the system if successfully completed.
Example:
baasicNotificationsService.subscriptions.anonymous.batch.remove(subscriptionIds)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
}); Returns a promise that is resolved once the update anonymous subscriptions action has been performed; this action updates specified anonymous subscription resources.
Example:
baasicNotificationsService.subscriptions.anonymous.batch.update(subscriptions)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the create user registration action has been performed; this action creates a new user registration resource.
Example:
baasicNotificationsService.registrations.users.create({
provider: '<provider-name>',
providerData: <provider-data>,
userId: '<user-id>'
})
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the find action has been performed. Success response returns a list of user registrations resources matching the given criteria.
Example:
baasicNotificationsService.registrations.users.find({
pageNumber : 1,
pageSize : 10,
orderBy : '<field>',
orderDirection : '<asc|desc>',
search : '<search-phrase>',
providers: '<provider-name1>,<provider-name2>',
userIds: '<user-id1>,<user-id2>',
embed: '<embed>'
})
.success(function (collection) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
}); Returns a promise that is resolved once the get action has been performed. Success response returns the specified user registrations resource.
Example:
baasicNotificationsService.registrations.users.get('<registration-id>')
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the remove user registrations action has been performed. This action will remove a user registrations resource from the system if successfully completed. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply baasicNotificationsRouteService route template. Here is an example of how a route can be obtained from HAL enabled objects:
var params = baasicApiService.removeParams(registration);
var uri = params['model'].links('delete').href;
Example:
// registration is a resource previously fetched using get action.
baasicNotificationsService.registrations.users.remove(registration)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
}); Returns a promise that is resolved once the update user registration action has been performed; this action updates a user registration resource. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply baasicNotificationsRouteService route template. Here is an example of how a route can be obtained from HAL enabled objects:
var params = baasicApiService.updateParams(subsregistrationcription); var uri = params['model'].links('put').href;
Example:
// registration is a resource previously fetched using get action.
registration.provider = '<provider-name>';
baasicNotificationsService.registrations.users.update(registration)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the create user registration action has been performed; this action creates new user registration resources.
Example:
baasicNotificationsService.registrations.users.batch.create([{
provider: '<provider-name>',
providerData: <provider-data>,
userId: '<user-id>'
}])
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the remove action has been performed. This action will remove user registration resources from the system if successfully completed.
Example:
baasicNotificationsService.registrations.users.batch.remove(subscriptionIds)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
}); Returns a promise that is resolved once the update user registration action has been performed; this action updates specified user registration resources.
Example:
baasicNotificationsService.registrations.users.batch.update(registrations)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the create anonymous registration action has been performed; this action creates a new anonymous registration resource.
Example:
baasicNotificationsService.registrations.anonymous.create({
provider: '<provider-name>',
providerdata: <provider-data>,
expirationData: '<expiration-date>'
})
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the find action has been performed. Success response returns a list of anonymous registration resources matching the given criteria.
Example:
baasicNotificationsService.registrations.anonymous.find({
pageNumber : 1,
pageSize : 10,
orderBy : '<field>',
orderDirection : '<asc|desc>',
search : '<search-phrase>',
providers: '<provider-name1>,<provider-name2>',
embed: '<embed>'
})
.success(function (collection) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
}); Returns a promise that is resolved once the get action has been performed. Success response returns the specified anonymous registration resource.
Example:
baasicNotificationsService.registrations.anonymous.get('<registration-id>')
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the remove anonymous registration action has been performed. This action will remove a anonymous registration resource from the system if successfully completed. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply baasicNotificationsRouteService route template. Here is an example of how a route can be obtained from HAL enabled objects:
var params = baasicApiService.removeParams(registration);
var uri = params['model'].links('delete').href;
Example:
// registration is a resource previously fetched using get action.
baasicNotificationsService.registrations.anonymous.remove(registration)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
}); Returns a promise that is resolved once the update anonymous registration action has been performed; this action updates a anonymous registration resource. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply baasicNotificationsRouteService route template. Here is an example of how a route can be obtained from HAL enabled objects:
var params = baasicApiService.updateParams(registration);
var uri = params['model'].links('put').href;
Example:
// registration is a resource previously fetched using get action.
subscription.provider = '<provider-name>';
baasicNotificationsService.update(registration)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the create anonymous registration action has been performed; this action creates new anonymous registration resources.
Example:
baasicNotificationsService.registrations.anonymous.batch.create([{
provider: '<provider-name>',
providerData: <provider-data>,
expirationDate: <expiration-date>
}])
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the remove action has been performed. This action will remove anonymous registration resources from the system if successfully completed.
Example:
baasicNotificationsService.registrations.anonymous.batch.remove(subscriptionIds)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
}); Returns a promise that is resolved once the update anonymous registration action has been performed; this action updates specified anonymous registration resources.
Example:
baasicNotificationsService.registrations.anonymous.batch.update(registrations)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the get action has been performed. Success response returns the specified setting resource.
Example:
baasicNotificationsService.settings.get('<provider-name>')
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Returns a promise that is resolved once the update settings action has been performed; this action updates a settings resource. This route uses HAL enabled objects to obtain routes and therefore it doesn't apply baasicNotificationsRouteService route template. Here is an example of how a route can be obtained from HAL enabled objects:
var params = baasicApiService.updateParams(settings);
var uri = params['model'].links('put').href;
Example:
// settings is a resource previously fetched using get action.
baasicNotificationsService.update(settings)
.success(function (data) {
// perform success action here
})
.error(function (response, status, headers, config) {
// perform error handling here
});Provides direct access to baasicNotificationsRouteService.
Example:
baasicNotificationsService.routeService.publish.create.expand({});Notes:
- Refer to the REST API documentation for detailed information about available Baasic REST API end-points.
- All end-point objects are transformed by the associated route service.
(c) 2017 Mono Ltd.
Version: 1.0.0
Author: Mono Ltd.
License: MIT
Baasic Notifications Navigation