| POST | /bets |
|---|
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;
public class dtos
{
public static class PlaceBet
{
public String id = null;
public String slipId = null;
public String jpId = null;
public Reference bettor = null;
public Origin origin = null;
public Date placedAt = null;
public String roundId = null;
public Integer outcomeId = null;
public Float odds = null;
public BigDecimal stake = null;
public String getId() { return id; }
public PlaceBet setId(String value) { this.id = value; return this; }
public String getSlipId() { return slipId; }
public PlaceBet setSlipId(String value) { this.slipId = value; return this; }
public String getJpId() { return jpId; }
public PlaceBet setJpId(String value) { this.jpId = value; return this; }
public Reference getBettor() { return bettor; }
public PlaceBet setBettor(Reference value) { this.bettor = value; return this; }
public Origin getOrigin() { return origin; }
public PlaceBet setOrigin(Origin value) { this.origin = value; return this; }
public Date getPlacedAt() { return placedAt; }
public PlaceBet setPlacedAt(Date value) { this.placedAt = value; return this; }
public String getRoundId() { return roundId; }
public PlaceBet setRoundId(String value) { this.roundId = value; return this; }
public Integer getOutcomeId() { return outcomeId; }
public PlaceBet setOutcomeId(Integer value) { this.outcomeId = value; return this; }
public Float getOdds() { return odds; }
public PlaceBet setOdds(Float value) { this.odds = value; return this; }
public BigDecimal getStake() { return stake; }
public PlaceBet setStake(BigDecimal value) { this.stake = value; return this; }
}
public static class Reference
{
public String id = null;
public String value = null;
public String getId() { return id; }
public Reference setId(String value) { this.id = value; return this; }
public String getValue() { return value; }
public Reference setValue(String value) { this.value = value; return this; }
}
public static class Origin
{
public BettingApp application = null;
public String ip = null;
public Reference organization = null;
public Reference device = null;
public Reference location = null;
public Reference locationGroup = null;
public Reference clerk = null;
public BettingApp getApplication() { return application; }
public Origin setApplication(BettingApp value) { this.application = value; return this; }
public String getIp() { return ip; }
public Origin setIp(String value) { this.ip = value; return this; }
public Reference getOrganization() { return organization; }
public Origin setOrganization(Reference value) { this.organization = value; return this; }
public Reference getDevice() { return device; }
public Origin setDevice(Reference value) { this.device = value; return this; }
public Reference getLocation() { return location; }
public Origin setLocation(Reference value) { this.location = value; return this; }
public Reference getLocationGroup() { return locationGroup; }
public Origin setLocationGroup(Reference value) { this.locationGroup = value; return this; }
public Reference getClerk() { return clerk; }
public Origin setClerk(Reference value) { this.clerk = value; return this; }
}
public static class BettingApp
{
public String name = null;
public String version = null;
public String getName() { return name; }
public BettingApp setName(String value) { this.name = value; return this; }
public String getVersion() { return version; }
public BettingApp setVersion(String value) { this.version = value; return this; }
}
}
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 /bets HTTP/1.1
Host: grh1.api.bettor.webhop.biz
Accept: text/jsv
Content-Type: text/jsv
Content-Length: length
{
id: String,
slipId: String,
jpId: String,
bettor:
{
id: String,
value: String
},
origin:
{
application:
{
name: String,
version: String
},
ip: String,
organization:
{
id: String,
value: String
},
device:
{
id: String,
value: String
},
location:
{
id: String,
value: String
},
locationGroup:
{
id: String,
value: String
},
clerk:
{
id: String,
value: String
}
},
placedAt: 0001-01-01,
roundId: String,
outcomeId: 0,
odds: 0,
stake: 0
}
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
}
}