| POST | /cmd/locations/devices/add |
|---|
package dtos
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 Ref struct {
Id string `json:"id"`
Val string `json:"val"`
}
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 AddLocationDevice struct {
Id *string `json:"id,omitempty"`
Device *Device `json:"device,omitempty"`
}
type RecordDictionary[TKey any, TVal any] map[TKey]TVal
To override the Content-type in your clients, use the HTTP Accept Header, append the .jsv suffix or ?format=jsv
The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.
POST /cmd/locations/devices/add HTTP/1.1
Host: api.bettor.webhop.biz
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: String,
device:
{
id: String,
name: String,
isActive: False,
profile:
{
usageMode: 0,
userInterface: 0,
wallet:
{
id: String,
val: String
},
managedBy: 0
},
integrationsData:
{
String: String
}
}
}
HTTP/1.1 200 OK
Content-Type: text/jsv
Content-Length: length
{
errorCode: String,
message: String,
stackTrace: String,
errors:
[
{
errorCode: String,
fieldName: String,
message: String,
meta:
{
String: String
}
}
],
meta:
{
String: String
}
}