Betting.WebApi

<back to all web services

OpenLocation

Requires Authentication
The following routes are available for this service:
POST/cmd/locations
package dtos

type Ref struct {
	Id  string `json:"id"`
	Val string `json:"val"`
}

type RefEx struct {
	Ref
	Data RecordDictionary[string, string] `json:"data"`
}

type GPSCoordinates struct {
	Lat float64 `json:"lat,omitempty"`
	Lng float64 `json:"lng,omitempty"`
}

type Address struct {
	Street     string                           `json:"street"`
	City       string                           `json:"city"`
	State      string                           `json:"state"`
	PostalCode string                           `json:"postalCode"`
	Country    Ref                              `json:"country"`
	Gps        GPSCoordinates                   `json:"gps"`
	Data       RecordDictionary[string, string] `json:"data"`
}

type DeviceUsageMode int

const (
	DeviceUsageModeClerkServiced DeviceUsageMode = 0
	DeviceUsageModePersonal      DeviceUsageMode = 1
	DeviceUsageModeSelfService   DeviceUsageMode = 2
	DeviceUsageModeUnknown       DeviceUsageMode = -1
)

type DeviceUserInterface int

const (
	DeviceUserInterfaceTablet  DeviceUserInterface = 0
	DeviceUserInterfaceKiosk   DeviceUserInterface = 1
	DeviceUserInterfaceDefault DeviceUserInterface = 2
	DeviceUserInterfaceUnknown DeviceUserInterface = -1
)

type DeviceManagement int

const (
	DeviceManagementPartner  DeviceManagement = 1
	DeviceManagementPlatform DeviceManagement = 2
)

type DeviceProfile struct {
	UsageMode     DeviceUsageMode     `json:"usageMode,omitempty"`
	UserInterface DeviceUserInterface `json:"userInterface,omitempty"`
	Wallet        *Ref                `json:"wallet,omitempty"`
	ManagedBy     *DeviceManagement   `json:"managedBy,omitempty"`
}

type Device struct {
	Id               *string                           `json:"id,omitempty"`
	Name             *string                           `json:"name,omitempty"`
	IsActive         bool                              `json:"isActive,omitempty"`
	Profile          *DeviceProfile                    `json:"profile,omitempty"`
	IntegrationsData *RecordDictionary[string, string] `json:"integrationsData,omitempty"`
}

type ProductReference struct {
	Id              *string `json:"id,omitempty"`
	Value           *string `json:"value,omitempty"`
	Category        *string `json:"category,omitempty"`
	ProductProvider *Ref    `json:"productProvider,omitempty"`
}

type ProductInstanceRef struct {
	Id      *string           `json:"id,omitempty"`
	Name    *string           `json:"name,omitempty"`
	Title   *string           `json:"title,omitempty"`
	Product *ProductReference `json:"product,omitempty"`
}

type Locale struct {
	TimeZone *Ref `json:"timeZone,omitempty"`
	Currency *Ref `json:"currency,omitempty"`
	Language *Ref `json:"language,omitempty"`
}

type OpenLocation struct {
	Id               *string              `json:"id,omitempty"`
	Name             *string              `json:"name,omitempty"`
	Organization     *RefEx               `json:"organization,omitempty"`
	Region           *Ref                 `json:"region,omitempty"`
	Group            *Ref                 `json:"group,omitempty"`
	Address          *Address             `json:"address,omitempty"`
	Devices          []Device             `json:"devices,omitempty"`
	ProductInstances []ProductInstanceRef `json:"productInstances,omitempty"`
	Locale           *Locale              `json:"locale,omitempty"`
	IntegrationsData map[string]string    `json:"integrationsData,omitempty"`
}

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

Go OpenLocation 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 /cmd/locations HTTP/1.1 
Host: api.bettor.webhop.biz 
Accept: text/csv
Content-Type: text/csv
Content-Length: length

{"id":"String","name":"String","organization":{"data":{"String":"String"},"id":"String","val":"String"},"region":{"id":"String","val":"String"},"group":{"id":"String","val":"String"},"address":{"street":"String","city":"String","state":"String","postalCode":"String","country":{"id":"String","val":"String"},"gps":{"lat":0,"lng":0},"data":{"String":"String"}},"devices":[{"id":"String","name":"String","isActive":false,"profile":{"usageMode":0,"userInterface":0,"wallet":{"id":"String","val":"String"},"managedBy":0},"integrationsData":{"String":"String"}}],"productInstances":[{"id":"String","name":"String","title":"String","product":{"id":"String","value":"String","category":"String","productProvider":{"id":"String","val":"String"}}}],"locale":{"timeZone":{"id":"String","val":"String"},"currency":{"id":"String","val":"String"},"language":{"id":"String","val":"String"}},"integrationsData":{"String":"String"}}
HTTP/1.1 200 OK
Content-Type: text/csv
Content-Length: length

{"errorCode":"String","message":"String","stackTrace":"String","errors":[{"errorCode":"String","fieldName":"String","message":"String","meta":{"String":"String"}}],"meta":{"String":"String"}}