Greyhounds.WebApi

<back to all web services

PlaceBet

The following routes are available for this service:
POST/bets
import Foundation
import ServiceStack

public class PlaceBet : Codable
{
    public var id:String
    public var slipId:String
    public var jpId:String
    public var bettor:Reference
    public var origin:Origin
    public var placedAt:Date
    public var roundId:String
    public var outcomeId:Int
    public var odds:Float
    public var stake:Double

    required public init(){}
}

public class Reference : Codable
{
    public var id:String
    public var value:String

    required public init(){}
}

public class Origin : Codable
{
    public var application:BettingApp
    public var ip:String
    public var organization:Reference
    public var device:Reference
    public var location:Reference
    public var locationGroup:Reference
    public var clerk:Reference

    required public init(){}
}

public class BettingApp : Codable
{
    public var name:String
    public var version:String

    required public init(){}
}


Swift PlaceBet DTOs

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

HTTP + 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
	}
}