Platform API

<back to all web services

GetContactNotifications

Get notifications for the specified contact

Requires Authentication
The following routes are available for this service:
All Verbs/api/contact/{ContactId}/notifications
import datetime
import decimal
from marshmallow.fields import *
from servicestack import *
from typing import *
from dataclasses import dataclass, field
from dataclasses_json import dataclass_json, LetterCase, Undefined, config
from enum import Enum, IntEnum


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class InputSwitch:
    id: Optional[str] = None
    name: Optional[str] = None
    is_disabled: bool = False
    is_checked: bool = False


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class NotificationDetails:
    notification_id: Optional[str] = None
    notification_group_name: Optional[str] = None
    notification_value_id: Optional[str] = None
    name: Optional[str] = None
    description: Optional[str] = None
    is_mandatory: bool = False
    is_cardinality: bool = False
    is_system: bool = False
    is_visible_to_recipients: bool = False
    index: int = 0
    email: Optional[InputSwitch] = None
    sms: Optional[InputSwitch] = None
    update_notification: Optional[InputSwitch] = None
    push: Optional[InputSwitch] = None
    phone: Optional[InputSwitch] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class NotificationGroup:
    group_name: Optional[str] = None
    notifications: Optional[List[NotificationDetails]] = None


# @ApiResponse(Description="List of contact notifications")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetContactNotificationsResponse:
    notifications: Optional[List[NotificationGroup]] = None
    response_status: Optional[ResponseStatus] = None


# @Api(Description="Get notifications for the specified contact")
@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetContactNotifications:
    """
    Get notifications for the specified contact
    """

    # @ApiMember(Description="Id of contact to get notifications for", IsRequired=true, Name="ContactId")
    contact_id: Optional[str] = None
    """
    Id of contact to get notifications for
    """


    # @ApiMember(Description="Id of licensee to get notifications for", IsRequired=true, Name="LicenseeId")
    licensee_id: Optional[str] = None
    """
    Id of licensee to get notifications for
    """


    # @ApiMember(Description="Id of suite to get notifications for", IsRequired=true, Name="Suite")
    suite_id: Optional[str] = None
    """
    Id of suite to get notifications for
    """

Python GetContactNotifications 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/contact/{ContactId}/notifications HTTP/1.1 
Host: pfapi.pstpf.com.au 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

{
	
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length

{
	Notifications: 
	[
		{
			GroupName: String,
			Notifications: 
			[
				{
					NotificationGroupName: String,
					Name: String,
					Description: String,
					IsMandatory: False,
					IsCardinality: False,
					IsSystem: False,
					IsVisibleToRecipients: False,
					Index: 0,
					Email: 
					{
						Id: String,
						Name: String,
						IsDisabled: False,
						IsChecked: False
					},
					SMS: 
					{
						Id: String,
						Name: String,
						IsDisabled: False,
						IsChecked: False
					},
					UpdateNotification: 
					{
						Id: String,
						Name: String,
						IsDisabled: False,
						IsChecked: False
					},
					Push: 
					{
						Id: String,
						Name: String,
						IsDisabled: False,
						IsChecked: False
					},
					Phone: 
					{
						Id: String,
						Name: String,
						IsDisabled: False,
						IsChecked: False
					}
				}
			]
		}
	],
	ResponseStatus: 
	{
		ErrorCode: String,
		Message: String,
		StackTrace: String,
		Errors: 
		[
			{
				ErrorCode: String,
				FieldName: String,
				Message: String,
				Meta: 
				{
					String: String
				}
			}
		],
		Meta: 
		{
			String: String
		}
	}
}