Greyhounds.WebApi

<back to all web services

GetFeed

The following routes are available for this service:
All Verbs/feed
"use strict";
/** @typedef {number} */
export var RoundStatus;
(function (RoundStatus) {
    RoundStatus[RoundStatus["Pending"] = 0] = "Pending"
    RoundStatus[RoundStatus["InProgress"] = 1] = "InProgress"
    RoundStatus[RoundStatus["Ended"] = 2] = "Ended"
})(RoundStatus || (RoundStatus = {}));
/** @typedef {number} */
export var RTPStrategies;
(function (RTPStrategies) {
    RTPStrategies[RTPStrategies["RNG"] = 0] = "RNG"
    RTPStrategies[RTPStrategies["Default"] = 1] = "Default"
})(RTPStrategies || (RTPStrategies = {}));
export class RoundConfiguration {
    /** @param {{countdownDurationInSeconds?:number,raceDurationInSeconds?:number,resultsDurationInSeconds?:number,rtpStrategy?:RTPStrategies}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    countdownDurationInSeconds;
    /** @type {number} */
    raceDurationInSeconds;
    /** @type {number} */
    resultsDurationInSeconds;
    /** @type {RTPStrategies} */
    rtpStrategy;
}
/** @typedef {number} */
export var OutcomeStatus;
(function (OutcomeStatus) {
    OutcomeStatus[OutcomeStatus["Unknown"] = 0] = "Unknown"
    OutcomeStatus[OutcomeStatus["Lost"] = 1] = "Lost"
    OutcomeStatus[OutcomeStatus["Won"] = 2] = "Won"
    OutcomeStatus[OutcomeStatus["Void"] = 3] = "Void"
})(OutcomeStatus || (OutcomeStatus = {}));
export class Outcome {
    /** @param {{id?:number,odds?:number,status?:OutcomeStatus}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {number} */
    id;
    /** @type {number} */
    odds;
    /** @type {OutcomeStatus} */
    status;
}
export class JackpotInfo {
    /** @param {{isGiven?:boolean,id?:string,slipId?:string,jpId?:string,amount?:number,locationId?:string,locationName?:string,addressLine?:string,amountAccumulated?:number}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {boolean} */
    isGiven;
    /** @type {?string} */
    id;
    /** @type {?string} */
    slipId;
    /** @type {?string} */
    jpId;
    /** @type {number} */
    amount;
    /** @type {?string} */
    locationId;
    /** @type {?string} */
    locationName;
    /** @type {?string} */
    addressLine;
    /** @type {number} */
    amountAccumulated;
}
/** @typedef {number} */
export var Stages;
(function (Stages) {
    Stages[Stages["None"] = 0] = "None"
    Stages[Stages["Countdown"] = 1] = "Countdown"
    Stages[Stages["Processing"] = 2] = "Processing"
    Stages[Stages["Race"] = 3] = "Race"
    Stages[Stages["Results"] = 4] = "Results"
})(Stages || (Stages = {}));
export class RoundProgress {
    /** @param {{stage?:Stages,step?:number,steps?:number,utcTimestamp?:string}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {Stages} */
    stage;
    /** @type {number} */
    step;
    /** @type {number} */
    steps;
    /** @type {string} */
    utcTimestamp;
}
export class Round {
    /** @param {{id?:string,createdAt?:string,updatedAt?:string,status?:RoundStatus,configuration?:RoundConfiguration,odds?:{ [index:number]: Outcome; },jackpotInfo?:JackpotInfo,sequence?:string,progress?:RoundProgress,isLocked?:boolean,isCalculated?:boolean}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {?string} */
    id;
    /** @type {string} */
    createdAt;
    /** @type {string} */
    updatedAt;
    /** @type {RoundStatus} */
    status;
    /** @type {?RoundConfiguration} */
    configuration;
    /** @type {?{ [index:number]: Outcome; }} */
    odds;
    /** @type {?JackpotInfo} */
    jackpotInfo;
    /** @type {?string} */
    sequence;
    /** @type {?RoundProgress} */
    progress;
    /** @type {boolean} */
    isLocked;
    /** @type {boolean} */
    isCalculated;
}
export class Feed {
    /** @param {{id?:string,round?:Round,lastJackpotInfo?:JackpotInfo}} [init] */
    constructor(init) { Object.assign(this, init) }
    /** @type {?string} */
    id;
    /** @type {?Round} */
    round;
    /** @type {?JackpotInfo} */
    lastJackpotInfo;
}
export class GetFeed {
    constructor(init) { Object.assign(this, init) }
}

JavaScript GetFeed DTOs

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

To embed the response in a jsonp callback, append ?callback=myCallback

HTTP + JSON

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

POST /feed HTTP/1.1 
Host: grh1.api.bettor.webhop.biz 
Accept: application/json
Content-Type: application/json
Content-Length: length

{}
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: length

{"id":"String","round":{"id":"String","createdAt":"0001-01-01T00:00:00.0000000Z","updatedAt":"0001-01-01T00:00:00.0000000Z","status":0,"configuration":{"countdownDurationInSeconds":0,"raceDurationInSeconds":0,"resultsDurationInSeconds":0,"rtpStrategy":0},"odds":{"0":{"id":0,"odds":0,"status":0}},"jackpotInfo":{"isGiven":false,"id":"String","slipId":"String","jpId":"String","amount":0,"locationId":"String","locationName":"String","addressLine":"String","amountAccumulated":0},"sequence":"String","progress":{"stage":0,"step":0,"steps":0,"utcTimestamp":"0001-01-01T00:00:00.0000000Z"},"isLocked":false,"isCalculated":false},"lastJackpotInfo":{"isGiven":false,"id":"String","slipId":"String","jpId":"String","amount":0,"locationId":"String","locationName":"String","addressLine":"String","amountAccumulated":0}}