| POST | /cmd/locations/devices/add |
|---|
const std = @import("std");
pub const DeviceUsageMode = enum(i32) {
ClerkServiced = 0,
Personal = 1,
SelfService = 2,
Unknown = -1,
};
pub const DeviceUserInterface = enum(i32) {
Tablet = 0,
Kiosk = 1,
Default = 2,
Unknown = -1,
};
pub const Ref = struct {
id: ?[]const u8 = null,
val: ?[]const u8 = null,
};
pub const DeviceManagement = enum(i32) {
Partner = 1,
Platform = 2,
};
pub const DeviceProfile = struct {
usageMode: ?DeviceUsageMode = null,
userInterface: ?DeviceUserInterface = null,
wallet: ?Ref = null,
managedBy: ?DeviceManagement = null,
};
pub const Device = struct {
id: ?[]const u8 = null,
name: ?[]const u8 = null,
isActive: bool = false,
profile: ?DeviceProfile = null,
integrationsData: ?RecordDictionary = null,
};
pub const AddLocationDevice = struct {
id: ?[]const u8 = null,
device: ?Device = null,
};
pub fn RecordDictionary(comptime TKey: type, comptime TVal: type) type {
_ = TKey;
_ = TVal;
return struct {};
}
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
}
}