Platform API

<back to all web services

InsertNotification

Inserts a new notification

Requires Authentication
The following routes are available for this service:
POST/api/notification/insert
import 'package:servicestack/servicestack.dart';

class NotificationRole implements IConvertible
{
    String? RoleId;
    String? RoleName;

    NotificationRole({this.RoleId,this.RoleName});
    NotificationRole.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        RoleId = json['RoleId'];
        RoleName = json['RoleName'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'RoleId': RoleId,
        'RoleName': RoleName
    };

    getTypeName() => "NotificationRole";
    TypeContext? context = _ctx;
}

class Notification implements IConvertible
{
    String? NotificationId;
    String? NotificationGroupId;
    String? NotificationGroupName;
    String? SuiteId;
    String? SuiteName;
    String? NotificationValueId;
    List<NotificationRole>? Roles;
    String? RolesToDisplay;
    String? Name;
    String? Description;
    bool? IsMandatory;
    bool? IsCardinality;
    bool? IsSystem;
    bool? IsAudit;
    bool? IsVisibleToRecipients;
    bool? IsSingleUse;
    bool? Email;
    bool? EmailDefault;
    String? EmailTemplateId;
    String? EmailTemplateBody;
    String? EmailSubject;
    bool? SMS;
    bool? SMSDefault;
    String? SMSTemplateId;
    String? SMSTemplateBody;
    bool? UpdateNotification;
    bool? UpdateNotificationDefault;
    String? UpdateTemplateId;
    String? UpdateTemplateBody;
    String? UpdateSubject;
    bool? Push;
    bool? PushDefault;
    bool? Phone;
    bool? PhoneDefault;
    String? ContactIdOwner;
    String? RecordStatus;
    String? EmailTemplateDefinitionId;
    String? SMSTemplateDefinitionId;
    String? UpdateTemplateDefinitionId;
    int? Index;

    Notification({this.NotificationId,this.NotificationGroupId,this.NotificationGroupName,this.SuiteId,this.SuiteName,this.NotificationValueId,this.Roles,this.RolesToDisplay,this.Name,this.Description,this.IsMandatory,this.IsCardinality,this.IsSystem,this.IsAudit,this.IsVisibleToRecipients,this.IsSingleUse,this.Email,this.EmailDefault,this.EmailTemplateId,this.EmailTemplateBody,this.EmailSubject,this.SMS,this.SMSDefault,this.SMSTemplateId,this.SMSTemplateBody,this.UpdateNotification,this.UpdateNotificationDefault,this.UpdateTemplateId,this.UpdateTemplateBody,this.UpdateSubject,this.Push,this.PushDefault,this.Phone,this.PhoneDefault,this.ContactIdOwner,this.RecordStatus,this.EmailTemplateDefinitionId,this.SMSTemplateDefinitionId,this.UpdateTemplateDefinitionId,this.Index});
    Notification.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        NotificationId = json['NotificationId'];
        NotificationGroupId = json['NotificationGroupId'];
        NotificationGroupName = json['NotificationGroupName'];
        SuiteId = json['SuiteId'];
        SuiteName = json['SuiteName'];
        NotificationValueId = json['NotificationValueId'];
        Roles = JsonConverters.fromJson(json['Roles'],'List<NotificationRole>',context!);
        RolesToDisplay = json['RolesToDisplay'];
        Name = json['Name'];
        Description = json['Description'];
        IsMandatory = json['IsMandatory'];
        IsCardinality = json['IsCardinality'];
        IsSystem = json['IsSystem'];
        IsAudit = json['IsAudit'];
        IsVisibleToRecipients = json['IsVisibleToRecipients'];
        IsSingleUse = json['IsSingleUse'];
        Email = json['Email'];
        EmailDefault = json['EmailDefault'];
        EmailTemplateId = json['EmailTemplateId'];
        EmailTemplateBody = json['EmailTemplateBody'];
        EmailSubject = json['EmailSubject'];
        SMS = json['SMS'];
        SMSDefault = json['SMSDefault'];
        SMSTemplateId = json['SMSTemplateId'];
        SMSTemplateBody = json['SMSTemplateBody'];
        UpdateNotification = json['UpdateNotification'];
        UpdateNotificationDefault = json['UpdateNotificationDefault'];
        UpdateTemplateId = json['UpdateTemplateId'];
        UpdateTemplateBody = json['UpdateTemplateBody'];
        UpdateSubject = json['UpdateSubject'];
        Push = json['Push'];
        PushDefault = json['PushDefault'];
        Phone = json['Phone'];
        PhoneDefault = json['PhoneDefault'];
        ContactIdOwner = json['ContactIdOwner'];
        RecordStatus = json['RecordStatus'];
        EmailTemplateDefinitionId = json['EmailTemplateDefinitionId'];
        SMSTemplateDefinitionId = json['SMSTemplateDefinitionId'];
        UpdateTemplateDefinitionId = json['UpdateTemplateDefinitionId'];
        Index = json['Index'];
        return this;
    }

    Map<String, dynamic> toJson() => {
        'NotificationId': NotificationId,
        'NotificationGroupId': NotificationGroupId,
        'NotificationGroupName': NotificationGroupName,
        'SuiteId': SuiteId,
        'SuiteName': SuiteName,
        'NotificationValueId': NotificationValueId,
        'Roles': JsonConverters.toJson(Roles,'List<NotificationRole>',context!),
        'RolesToDisplay': RolesToDisplay,
        'Name': Name,
        'Description': Description,
        'IsMandatory': IsMandatory,
        'IsCardinality': IsCardinality,
        'IsSystem': IsSystem,
        'IsAudit': IsAudit,
        'IsVisibleToRecipients': IsVisibleToRecipients,
        'IsSingleUse': IsSingleUse,
        'Email': Email,
        'EmailDefault': EmailDefault,
        'EmailTemplateId': EmailTemplateId,
        'EmailTemplateBody': EmailTemplateBody,
        'EmailSubject': EmailSubject,
        'SMS': SMS,
        'SMSDefault': SMSDefault,
        'SMSTemplateId': SMSTemplateId,
        'SMSTemplateBody': SMSTemplateBody,
        'UpdateNotification': UpdateNotification,
        'UpdateNotificationDefault': UpdateNotificationDefault,
        'UpdateTemplateId': UpdateTemplateId,
        'UpdateTemplateBody': UpdateTemplateBody,
        'UpdateSubject': UpdateSubject,
        'Push': Push,
        'PushDefault': PushDefault,
        'Phone': Phone,
        'PhoneDefault': PhoneDefault,
        'ContactIdOwner': ContactIdOwner,
        'RecordStatus': RecordStatus,
        'EmailTemplateDefinitionId': EmailTemplateDefinitionId,
        'SMSTemplateDefinitionId': SMSTemplateDefinitionId,
        'UpdateTemplateDefinitionId': UpdateTemplateDefinitionId,
        'Index': Index
    };

    getTypeName() => "Notification";
    TypeContext? context = _ctx;
}

/**
* Inserts a new notification
*/
// @Api(Description="Inserts a new notification")
class InsertNotification implements IConvertible
{
    Notification? Notification;

    InsertNotification({this.Notification});
    InsertNotification.fromJson(Map<String, dynamic> json) { fromMap(json); }

    fromMap(Map<String, dynamic> json) {
        Notification = JsonConverters.fromJson(json['Notification'],'Notification',context!);
        return this;
    }

    Map<String, dynamic> toJson() => {
        'Notification': JsonConverters.toJson(Notification,'Notification',context!)
    };

    getTypeName() => "InsertNotification";
    TypeContext? context = _ctx;
}

TypeContext _ctx = TypeContext(library: 'pfapi.pstpf.com.au', types: <String, TypeInfo> {
    'NotificationRole': TypeInfo(TypeOf.Class, create:() => NotificationRole()),
    'Notification': TypeInfo(TypeOf.Class, create:() => Notification()),
    'List<NotificationRole>': TypeInfo(TypeOf.Class, create:() => <NotificationRole>[]),
    'InsertNotification': TypeInfo(TypeOf.Class, create:() => InsertNotification()),
});

Dart InsertNotification DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv

HTTP + JSV

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /api/notification/insert HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	Notification: 
	{
		NotificationGroupName: String,
		SuiteName: String,
		Roles: 
		[
			{
				RoleName: String
			}
		],
		RolesToDisplay: String,
		Name: String,
		Description: String,
		IsMandatory: False,
		IsCardinality: False,
		IsSystem: False,
		IsAudit: False,
		IsVisibleToRecipients: False,
		IsSingleUse: False,
		Email: False,
		EmailDefault: False,
		EmailTemplateBody: String,
		EmailSubject: String,
		SMS: False,
		SMSDefault: False,
		SMSTemplateBody: String,
		UpdateNotification: False,
		UpdateNotificationDefault: False,
		UpdateTemplateBody: String,
		UpdateSubject: String,
		Push: False,
		PushDefault: False,
		Phone: False,
		PhoneDefault: False,
		RecordStatus: String,
		Index: 0
	}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	ErrorCode: String,
	Message: String,
	StackTrace: String,
	Errors: 
	[
		{
			ErrorCode: String,
			FieldName: String,
			Message: String,
			Meta: 
			{
				String: String
			}
		}
	],
	Meta: 
	{
		String: String
	}
}