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 .csv suffix or ?format=csv

HTTP + CSV

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/csv
Content-Type: text/csv
Content-Length: length

{"ContactId":"00000000-0000-0000-0000-000000000000","LicenseeId":"00000000-0000-0000-0000-000000000000","SuiteId":"00000000-0000-0000-0000-000000000000"}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"Notifications":[{"GroupName":"String","Notifications":[{"NotificationId":"00000000-0000-0000-0000-000000000000","NotificationGroupName":"String","NotificationValueId":"00000000-0000-0000-0000-000000000000","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"}}}