Betting.WebApi

<back to all web services

GetUserNotifications

Requires Authentication
The following routes are available for this service:
All Verbs/qry/users/notifications
package dtos

import (
	"time"
)

type Severity int

const (
	SeveritySuccess Severity = 0
	SeverityInfo    Severity = 1
	SeverityWarning Severity = 2
	SeverityError   Severity = 3
)

type NotificationType int

const (
	NotificationTypeDefault                         NotificationType = 0
	NotificationTypeSlipDeliveryConfirmationRequest NotificationType = 1
	NotificationTypeSlipDeliveryIssueResolved       NotificationType = 2
)

type Notification struct {
	Severity Severity                          `json:"severity,omitempty"`
	Type     NotificationType                  `json:"type,omitempty"`
	Data     *RecordDictionary[string, string] `json:"data,omitempty"`
}

type UserNotification struct {
	Id           *string       `json:"id,omitempty"`
	Notification *Notification `json:"notification,omitempty"`
	DispatchedAt time.Time     `json:"dispatchedAt,omitempty"`
}

type UserNotifications struct {
	IsOverflown   bool                        `json:"isOverflown,omitempty"`
	Id            *string                     `json:"id,omitempty"`
	N             int                         `json:"n,omitempty"`
	S             int                         `json:"s,omitempty"`
	I             int                         `json:"i,omitempty"`
	W             int                         `json:"w,omitempty"`
	E             int                         `json:"e,omitempty"`
	Notifications map[string]UserNotification `json:"notifications,omitempty"`
}

type GetUserNotifications struct {
	Id *string `json:"id,omitempty"`
}

type RecordDictionary[TKey any, TVal any] map[TKey]TVal

Go GetUserNotifications 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 /qry/users/notifications HTTP/1.1 
Host: api.bettor.webhop.biz 
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length

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

{
	isOverflown: False,
	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-01
		}
	}
}