Betting.WebApi

<back to all web services

GetUserNotifications

Requires Authentication
The following routes are available for this service:
All Verbs/qry/users/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


class Severity(IntEnum):
    SUCCESS = 0
    INFO = 1
    WARNING = 2
    ERROR = 3


class NotificationType(IntEnum):
    DEFAULT = 0
    SLIP_DELIVERY_CONFIRMATION_REQUEST = 1
    SLIP_DELIVERY_ISSUE_RESOLVED = 2


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class Notification:
    severity: Optional[Severity] = None
    type: Optional[NotificationType] = None
    data: Optional[RecordDictionary[str, str]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UserNotification:
    id: Optional[str] = None
    notification: Optional[Notification] = None
    dispatched_at: datetime.datetime = datetime.datetime(1, 1, 1)


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class UserNotifications:
    id: Optional[str] = None
    n: int = 0
    s: int = 0
    i: int = 0
    w: int = 0
    e: int = 0
    notifications: Optional[Dict[str, UserNotification]] = None


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class GetUserNotifications:
    id: Optional[str] = None


TKey = TypeVar('TKey')
TVal = TypeVar('TVal')


@dataclass_json(letter_case=LetterCase.CAMEL, undefined=Undefined.EXCLUDE)
@dataclass
class RecordDictionary(Generic[TKey, TVal], Dict[TKey,TVal]):
    pass

Python GetUserNotifications DTOs

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

HTTP + OTHER

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

POST /qry/users/notifications HTTP/1.1 
Host: api.sbbet.ath.cx 
Accept: text/jsonl
Content-Type: text/jsonl
Content-Length: length

{"id":"String"}
HTTP/1.1 200 OK
Content-Type: text/jsonl
Content-Length: length

{"id":"String","n":1,"s":1,"i":0,"w":0,"e":0,"notifications":{"String":{"id":"String","notification":{"severity":0,"type":0,"data":{"String":"String"}},"dispatchedAt":"0001-01-01T00:00:00.0000000Z"}}}