Greyhounds.WebApi

<back to all web services

PlaceBets

The following routes are available for this service:
POST/bets/v2
import java.math.*;
import java.util.*;
import java.io.InputStream;
import net.servicestack.client.*;

public class dtos
{

    public static class PlaceBets
    {
        public String slipId = null;
        public Reference bettor = null;
        public Origin origin = null;
        public Date placedAt = null;
        public ArrayList<Bet> bets = null;
        
        public String getSlipId() { return slipId; }
        public PlaceBets setSlipId(String value) { this.slipId = value; return this; }
        public Reference getBettor() { return bettor; }
        public PlaceBets setBettor(Reference value) { this.bettor = value; return this; }
        public Origin getOrigin() { return origin; }
        public PlaceBets setOrigin(Origin value) { this.origin = value; return this; }
        public Date getPlacedAt() { return placedAt; }
        public PlaceBets setPlacedAt(Date value) { this.placedAt = value; return this; }
        public ArrayList<Bet> getBets() { return bets; }
        public PlaceBets setBets(ArrayList<Bet> value) { this.bets = 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; }
    }

    public static class Bet
    {
        public String id = null;
        public String jpId = null;
        public String roundId = null;
        public Integer outcomeId = null;
        public Float odds = null;
        public BigDecimal stake = null;
        
        public String getId() { return id; }
        public Bet setId(String value) { this.id = value; return this; }
        public String getJpId() { return jpId; }
        public Bet setJpId(String value) { this.jpId = value; return this; }
        public String getRoundId() { return roundId; }
        public Bet setRoundId(String value) { this.roundId = value; return this; }
        public Integer getOutcomeId() { return outcomeId; }
        public Bet setOutcomeId(Integer value) { this.outcomeId = value; return this; }
        public Float getOdds() { return odds; }
        public Bet setOdds(Float value) { this.odds = value; return this; }
        public BigDecimal getStake() { return stake; }
        public Bet setStake(BigDecimal value) { this.stake = value; return this; }
    }

}

Java PlaceBets DTOs

To override the Content-type in your clients, use the HTTP Accept Header, append the .xml suffix or ?format=xml

HTTP + XML

The following are sample HTTP requests and responses. The placeholders shown need to be replaced with actual values.

POST /bets/v2 HTTP/1.1 
Host: grh1.api.bettor.webhop.biz 
Accept: application/xml
Content-Type: application/xml
Content-Length: length

<PlaceBets xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/Greyhounds.WebApi.ServiceModel">
  <Bets>
    <PlaceBets.Bet>
      <Id>String</Id>
      <JPId>String</JPId>
      <Odds>0</Odds>
      <OutcomeId>0</OutcomeId>
      <RoundId>String</RoundId>
      <Stake>0</Stake>
    </PlaceBets.Bet>
  </Bets>
  <Bettor>
    <Id>String</Id>
    <Value>String</Value>
  </Bettor>
  <Origin>
    <Application>
      <Name>String</Name>
      <Version>String</Version>
    </Application>
    <Clerk>
      <Id>String</Id>
      <Value>String</Value>
    </Clerk>
    <Device>
      <Id>String</Id>
      <Value>String</Value>
    </Device>
    <IP>String</IP>
    <Location>
      <Id>String</Id>
      <Value>String</Value>
    </Location>
    <LocationGroup>
      <Id>String</Id>
      <Value>String</Value>
    </LocationGroup>
    <Organization>
      <Id>String</Id>
      <Value>String</Value>
    </Organization>
  </Origin>
  <PlacedAt>0001-01-01T00:00:00</PlacedAt>
  <SlipId>String</SlipId>
</PlaceBets>
HTTP/1.1 200 OK
Content-Type: application/xml
Content-Length: length

<ResponseStatus xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.servicestack.net/types">
  <ErrorCode>String</ErrorCode>
  <Message>String</Message>
  <StackTrace>String</StackTrace>
  <Errors>
    <ResponseError>
      <ErrorCode>String</ErrorCode>
      <FieldName>String</FieldName>
      <Message>String</Message>
      <Meta xmlns:d4p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
        <d4p1:KeyValueOfstringstring>
          <d4p1:Key>String</d4p1:Key>
          <d4p1:Value>String</d4p1:Value>
        </d4p1:KeyValueOfstringstring>
      </Meta>
    </ResponseError>
  </Errors>
  <Meta xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
    <d2p1:KeyValueOfstringstring>
      <d2p1:Key>String</d2p1:Key>
      <d2p1:Value>String</d2p1:Value>
    </d2p1:KeyValueOfstringstring>
  </Meta>
</ResponseStatus>