| POST | /cmd/locations/devices/add |
|---|
using System;
using System.IO;
using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using ServiceStack;
using ServiceStack.DataAnnotations;
using Betting.WebApi.ServiceModel;
using Betting.Common;
using Starnet.Common;
namespace Betting.Common
{
public enum DeviceManagement
{
Partner = 1,
Platform = 2,
}
public partial class DeviceProfile
{
public virtual DeviceUsageMode UsageMode { get; set; }
public virtual DeviceUserInterface UserInterface { get; set; }
public virtual Ref? Wallet { get; set; }
public virtual DeviceManagement? ManagedBy { get; set; }
}
public enum DeviceUsageMode
{
ClerkServiced = 0,
Personal = 1,
SelfService = 2,
Unknown = -1,
}
public enum DeviceUserInterface
{
Tablet = 0,
Kiosk = 1,
Default = 2,
Unknown = -1,
}
}
namespace Betting.WebApi.ServiceModel
{
public partial class AddLocationDevice
{
public virtual string? Id { get; set; }
public virtual Device? Device { get; set; }
}
public partial class Device
{
public virtual string? Id { get; set; }
public virtual string? Name { get; set; }
public virtual bool IsActive { get; set; }
public virtual DeviceProfile? Profile { get; set; }
public virtual RecordDictionary<string, string>? IntegrationsData { get; set; }
}
}
namespace Starnet.Common
{
public partial class RecordDictionary<TKey, TVal>
: Dictionary<TKey, TVal>
{
}
public partial class Ref
{
public virtual string Id { get; set; }
public virtual string Val { get; set; }
}
}
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
}
}